/* ============================================================
   scottruiter.github.io — site design system
   Dark, immersive, scroll-driven portfolio
   ============================================================ */

:root {
    --bg: #070b12;
    --bg-2: #0b111c;
    --surface: #101826;
    --surface-2: #15203270;
    --line: #1e2c42;
    --text: #dbe5f1;
    --text-dim: #8fa1b8;
    --accent: #4fd1ff;
    --accent-2: #7c6cff;
    --amber: #ffc860;
    --radius: 14px;
    --font-display: "Space Grotesk", "Segoe UI", sans-serif;
    --font-body: "Inter", "Segoe UI", sans-serif;
    --nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: #9be4ff; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.01em; }

::selection { background: rgba(79, 209, 255, .3); }

/* ---------- Scroll progress bar ---------- */
#progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    z-index: 1001;
    transition: width .08s linear;
}

/* ---------- Navigation ---------- */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(16px, 4vw, 48px);
    z-index: 1000;
    background: rgba(7, 11, 18, .72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s ease, background .3s ease;
}

.nav.scrolled { border-bottom-color: var(--line); }

.nav-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo img { width: 30px; height: 30px; border-radius: 8px; }
.nav-logo span b { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2.2vw, 30px);
    list-style: none;
}

.nav-links a {
    color: var(--text-dim);
    font-size: .92rem;
    font-weight: 500;
    letter-spacing: .02em;
}

.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-links a.btn-resume {
    color: #06121c;
    background: var(--accent);
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 700;
    transition: transform .2s ease, box-shadow .2s ease;
}

.nav-links a.btn-resume:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(79, 209, 255, .35);
}

.nav-burger {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    width: 42px; height: 42px;
    position: relative;
    z-index: 1002;
}

.nav-burger span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text);
    margin: 5px auto;
    transition: transform .3s ease, opacity .3s ease;
}

@media (max-width: 860px) {
    .nav-burger { display: block; }
    /* The nav's backdrop-filter makes it the containing block for fixed
       descendants, so size the overlay explicitly instead of using inset. */
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        gap: 28px;
        background: rgba(7, 11, 18, .97);
        opacity: 0;
        pointer-events: none;
        transition: opacity .3s ease;
    }
    .nav-links.open { opacity: 1; pointer-events: auto; }
    .nav-links a { font-size: 1.25rem; }
    body.nav-open { overflow: hidden; }
    .nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-burger.open span:nth-child(2) { opacity: 0; }
    .nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: -12% 0;
    background-size: cover;
    background-position: center;
    will-change: transform;
    z-index: 0;
    filter: saturate(1.05);
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(80% 70% at 25% 45%, rgba(7, 11, 18, .35) 0%, rgba(7, 11, 18, .92) 100%),
        linear-gradient(180deg, rgba(7, 11, 18, .55) 0%, rgba(7, 11, 18, .25) 45%, var(--bg) 100%);
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1150px;
    margin: 0 auto;
    padding: calc(var(--nav-h) + 40px) clamp(20px, 5vw, 48px) 90px;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: .85rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid rgba(79, 209, 255, .35);
    background: rgba(79, 209, 255, .08);
    padding: 7px 16px;
    border-radius: 999px;
    margin-bottom: 26px;
}

.hero-kicker::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

.hero h1 {
    font-size: clamp(2.6rem, 7vw, 5rem);
    font-weight: 700;
    margin-bottom: 18px;
}

.hero h1 .grad {
    background: linear-gradient(92deg, var(--accent) 10%, var(--accent-2) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    font-size: clamp(1.05rem, 2.2vw, 1.3rem);
    color: var(--text-dim);
    max-width: 640px;
    margin-bottom: 34px;
}

.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 56px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .98rem;
    padding: 14px 28px;
    border-radius: 999px;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn-primary { background: var(--accent); color: #06121c; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(79, 209, 255, .4); color: #06121c; }

.btn-ghost { border: 1px solid var(--line); color: var(--text); background: rgba(16, 24, 38, .5); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    max-width: 760px;
}

.stat {
    border: 1px solid var(--line);
    background: rgba(16, 24, 38, .55);
    backdrop-filter: blur(6px);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.stat .num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat .num sup { font-size: 1.1rem; }
.stat .lbl { font-size: .82rem; color: var(--text-dim); letter-spacing: .04em; text-transform: uppercase; }

.scroll-cue {
    position: absolute;
    bottom: 26px; left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    color: var(--text-dim);
    font-size: .78rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.scroll-cue::after {
    content: "";
    width: 1px; height: 42px;
    background: linear-gradient(180deg, var(--accent), transparent);
    animation: cue 1.8s ease-in-out infinite;
}

@keyframes cue {
    0% { transform: scaleY(0); transform-origin: top; }
    45% { transform: scaleY(1); transform-origin: top; }
    55% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- Sections ---------- */
.section {
    position: relative;
    padding: clamp(70px, 10vw, 130px) clamp(20px, 5vw, 48px);
}

.section-inner { max-width: 1150px; margin: 0 auto; position: relative; z-index: 1; }

.section-kicker {
    font-family: var(--font-display);
    color: var(--accent);
    font-size: .82rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.section h2 {
    font-size: clamp(1.9rem, 4.4vw, 3rem);
    margin-bottom: 18px;
}

.section-lead { color: var(--text-dim); max-width: 720px; margin-bottom: 48px; font-size: 1.06rem; }

.section.alt { background: var(--bg-2); }

/* Full-bleed image band with parallax */
.band {
    position: relative;
    min-height: 52vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
    padding: 90px 24px;
}

.band-bg {
    position: absolute;
    inset: -14% 0;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

.band-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--bg) 0%, rgba(7, 11, 18, .55) 18%, rgba(7, 11, 18, .55) 82%, var(--bg) 100%);
}

.band-content { position: relative; z-index: 1; max-width: 860px; }

.band-content blockquote {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 500;
    line-height: 1.4;
}

.band-content cite { display: block; margin-top: 18px; color: var(--text-dim); font-style: normal; font-size: .95rem; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }

.card {
    border: 1px solid var(--line);
    background: linear-gradient(160deg, rgba(21, 32, 50, .6), rgba(13, 19, 30, .8));
    border-radius: var(--radius);
    padding: 28px;
    transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(79, 209, 255, .45);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
}

.card h3 { font-size: 1.18rem; margin-bottom: 12px; }

.card .icon {
    width: 46px; height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(79, 209, 255, .12);
    color: var(--accent);
    font-size: 1.3rem;
    margin-bottom: 18px;
}

.card p, .card li { color: var(--text-dim); font-size: .95rem; }
.card ul { list-style: none; }
.card ul li { padding: 5px 0 5px 22px; position: relative; }
.card ul li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.tag {
    font-family: var(--font-display);
    font-size: .74rem;
    letter-spacing: .04em;
    color: var(--accent);
    border: 1px solid rgba(79, 209, 255, .3);
    background: rgba(79, 209, 255, .07);
    border-radius: 999px;
    padding: 4px 12px;
    white-space: nowrap;
}

/* Project cards with image headers */
.project-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.project-card .thumb { height: 210px; overflow: hidden; position: relative; }
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.project-card:hover .thumb img { transform: scale(1.06); }
.project-card .thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(13, 19, 30, .9) 100%);
}
.project-card .body { padding: 24px 26px 28px; display: flex; flex-direction: column; flex: 1; }

/* ---------- Client marquee ---------- */
.marquee {
    overflow: hidden;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 26px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
    display: flex;
    gap: 64px;
    width: max-content;
    animation: marquee 34s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-track span {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: .06em;
    white-space: nowrap;
    transition: color .3s ease;
}

.marquee-track span:hover { color: var(--accent); }

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 34px; }

.timeline::before {
    content: "";
    position: absolute;
    left: 8px; top: 6px; bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2) 60%, transparent);
}

.tl-item { position: relative; padding-bottom: 54px; }
.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
    content: "";
    position: absolute;
    left: -34px; top: 8px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--accent);
    box-shadow: 0 0 16px rgba(79, 209, 255, .5);
}

.tl-item .when {
    font-family: var(--font-display);
    color: var(--accent);
    font-size: .84rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.tl-item h3 { font-size: 1.35rem; margin-bottom: 4px; }
.tl-item .where { color: var(--text-dim); font-size: .95rem; margin-bottom: 16px; }
.tl-item .where b { color: var(--text); font-weight: 600; }

.tl-item ul { list-style: none; }
.tl-item ul li {
    color: var(--text-dim);
    font-size: .97rem;
    padding: 5px 0 5px 24px;
    position: relative;
}

.tl-item ul li::before { content: "▹"; position: absolute; left: 2px; color: var(--accent); }

.tl-impact {
    margin-top: 16px;
    border-left: 3px solid var(--amber);
    background: rgba(255, 200, 96, .06);
    border-radius: 0 10px 10px 0;
    padding: 14px 18px;
    color: var(--text-dim);
    font-size: .95rem;
}

.tl-impact b { color: var(--amber); }

/* ---------- Contact ---------- */
.contact-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        radial-gradient(120% 160% at 85% 0%, rgba(124, 108, 255, .16) 0%, transparent 55%),
        radial-gradient(120% 160% at 10% 100%, rgba(79, 209, 255, .14) 0%, transparent 55%),
        var(--surface);
    padding: clamp(36px, 6vw, 70px);
    text-align: center;
}

.contact-card h2 { font-size: clamp(1.9rem, 4.5vw, 3rem); margin-bottom: 14px; }
.contact-card p { color: var(--text-dim); max-width: 560px; margin: 0 auto 34px; }

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

/* ---------- Gallery ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }

.filter-btn {
    font-family: var(--font-display);
    font-size: .88rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--text-dim);
    background: rgba(16, 24, 38, .6);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 20px;
    cursor: pointer;
    transition: all .25s ease;
}

.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.active { color: #06121c; background: var(--accent); border-color: var(--accent); }

.gallery {
    columns: 3 300px;
    column-gap: 18px;
}

.g-item {
    break-inside: avoid;
    margin-bottom: 18px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
    border: 1px solid var(--line);
    transition: transform .3s ease, box-shadow .3s ease, opacity .35s ease;
}

.g-item:hover { transform: translateY(-4px); box-shadow: 0 14px 38px rgba(0, 0, 0, .5); }
.g-item img { width: 100%; transition: transform .6s ease; }
.g-item:hover img { transform: scale(1.04); }

.g-item .cap {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 34px 16px 12px;
    background: linear-gradient(180deg, transparent, rgba(7, 11, 18, .88));
    font-size: .86rem;
    color: var(--text);
    opacity: 0;
    transition: opacity .3s ease;
}

.g-item:hover .cap { opacity: 1; }
.g-item.hidden { display: none; }

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 10, .94);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
}

.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 10px; box-shadow: 0 30px 90px rgba(0, 0, 0, .8); }

.lightbox .lb-cap {
    position: absolute;
    bottom: 3vh; left: 0; right: 0;
    text-align: center;
    color: var(--text-dim);
    font-size: .95rem;
}

.lightbox button {
    position: absolute;
    background: rgba(16, 24, 38, .8);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 1.5rem;
    width: 48px; height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}

.lightbox button:hover { border-color: var(--accent); color: var(--accent); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- Footer ---------- */
.footer {
    border-top: 1px solid var(--line);
    padding: 48px clamp(20px, 5vw, 48px) 40px;
    background: var(--bg-2);
}

.footer-inner {
    max-width: 1150px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
}

.footer-social { display: flex; gap: 12px; }

.footer-social a {
    width: 42px; height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text-dim);
    transition: all .25s ease;
}

.footer-social a:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-3px);
}

.footer-social svg { width: 18px; height: 18px; fill: currentColor; }

.footer small { color: var(--text-dim); font-size: .84rem; }
.footer small a { color: var(--text-dim); }
.footer small a:hover { color: var(--accent); }

/* ---------- Reveal animations ---------- */
.reveal {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity .7s cubic-bezier(.2, .65, .3, 1), transform .7s cubic-bezier(.2, .65, .3, 1);
    transition-delay: var(--d, 0s);
}

.reveal.in { opacity: 1; transform: none; }

.reveal-l { transform: translateX(-40px); }
.reveal-r { transform: translateX(40px); }
.reveal-l.in, .reveal-r.in { transform: none; }

/* ---------- Page hero (subpages) ---------- */
.page-hero {
    position: relative;
    padding: calc(var(--nav-h) + clamp(60px, 10vw, 110px)) clamp(20px, 5vw, 48px) clamp(50px, 7vw, 90px);
    overflow: hidden;
}

.page-hero .hero-bg { inset: -10% 0; }

.page-hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); margin-bottom: 14px; position: relative; z-index: 1; }
.page-hero .section-kicker, .page-hero p { position: relative; z-index: 1; }
.page-hero p { color: var(--text-dim); max-width: 680px; font-size: 1.05rem; }
.page-hero .section-inner { position: relative; z-index: 1; }

/* ---------- Widget shell (dashboard pages) ---------- */
.widget-block {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    margin-bottom: 26px;
}

.widget-block h3 {
    font-size: 1rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.widget-block .tradingview-widget-container { padding: 0; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal, .reveal-l, .reveal-r { opacity: 1; transform: none; transition: none; }
    .marquee-track { animation: none; flex-wrap: wrap; }
    .scroll-cue::after, .hero-kicker::before { animation: none; }
    .hero-bg, .band-bg { position: absolute; inset: 0; }
}
