/* ==========================================================================
   AE Vision — viewfinder theme
   ========================================================================== */

:root {
    --bg: #0c0d0b;
    --bg-raised: #131411;
    --surface: #181915;
    --line: rgba(236, 234, 226, 0.10);
    --line-strong: rgba(236, 234, 226, 0.22);
    --text: #ecebe4;
    --muted: #a3a298;
    --dim: #6e6d65;
    --accent: #c6f36b;
    --accent-ink: #11160a;
    --track: #8ec5ff;

    --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', monospace;

    --container: 1200px;
    --gutter: clamp(16px, 4vw, 32px);
    --radius: 4px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
}

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

/* Faint sensor grain over everything */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a {
    color: inherit;
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

p {
    margin: 0;
}

/* Emphasis = a quieter tone of the same face, not a font switch */
em {
    font-style: normal;
    color: var(--muted);
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.mono {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 8px 12px;
    z-index: 200;
}

.skip-link:focus {
    left: 8px;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    cursor: pointer;
    background: none;
    color: inherit;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 500;
}

.btn-primary:hover {
    background: #d6fa8f;
}

.btn-ghost {
    border-color: var(--line-strong);
}

.btn-ghost:hover {
    border-color: var(--text);
}

.btn .arrow {
    transition: transform 0.2s var(--ease);
}

.btn:hover .arrow {
    transform: translateX(3px);
}

/* ---------- Nav ---------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(12, 13, 11, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

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

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand img {
    width: 30px;
    height: 30px;
}

.brand-name {
    font-weight: 500;
    letter-spacing: -0.01em;
}

.brand-tag {
    color: var(--dim);
    margin-left: 4px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a:not(.btn) {
    color: var(--muted);
    transition: color 0.2s;
}

.nav-links a:not(.btn):hover {
    color: var(--text);
}

.nav-links .btn {
    padding: 10px 16px;
}

@media (max-width: 760px) {

    .nav-links a:not(.btn),
    .brand-tag {
        display: none;
    }
}

/* ---------- Hero ---------- */

.hero {
    padding: clamp(40px, 8vw, 96px) 0 clamp(56px, 8vw, 96px);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: center;
}

@media (min-width: 980px) {
    .hero-grid {
        grid-template-columns: 1.05fr 1fr;
        gap: 56px;
    }
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    margin-bottom: 28px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(198, 243, 107, 0.6);
    animation: ping 2.4s infinite;
}

@keyframes ping {
    0% {
        box-shadow: 0 0 0 0 rgba(205, 244, 106, 0.5);
    }

    70%,
    100% {
        box-shadow: 0 0 0 10px rgba(205, 244, 106, 0);
    }
}

.hero h1 {
    font-size: clamp(40px, 5.4vw, 66px);
}

.hero-lede {
    margin-top: 28px;
    max-width: 34em;
    font-size: clamp(17px, 1.6vw, 19px);
    color: var(--muted);
}

.hero-lede strong {
    color: var(--text);
    font-weight: 500;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin-top: 44px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--dim);
}

.hero-facts span b {
    color: var(--text);
    font-weight: 500;
}

/* ---------- Viewfinder (hero visual) ---------- */

.viewfinder {
    position: relative;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0f100d;
    overflow: hidden;
}

.viewfinder canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.vf-hud {
    position: absolute;
    inset: 14px;
    pointer-events: none;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(236, 234, 226, 0.7);
}

.vf-hud>* {
    position: absolute;
}

.vf-tl {
    top: 0;
    left: 0;
}

.vf-tr {
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vf-bl {
    bottom: 0;
    left: 0;
}

.vf-br {
    bottom: 0;
    right: 0;
}

.rec-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: blink 1.6s steps(2, start) infinite;
}

@keyframes blink {
    to {
        visibility: hidden;
    }
}

.vf-prompt {
    color: var(--track);
}

/* Corner brackets, reused on media frames */
.brackets {
    position: absolute;
    inset: 0;
    pointer-events: none;
    --b: 18px;
    --c: rgba(236, 234, 226, 0.55);
    background:
        linear-gradient(var(--c), var(--c)) top left / var(--b) 1px no-repeat,
        linear-gradient(var(--c), var(--c)) top left / 1px var(--b) no-repeat,
        linear-gradient(var(--c), var(--c)) top right / var(--b) 1px no-repeat,
        linear-gradient(var(--c), var(--c)) top right / 1px var(--b) no-repeat,
        linear-gradient(var(--c), var(--c)) bottom left / var(--b) 1px no-repeat,
        linear-gradient(var(--c), var(--c)) bottom left / 1px var(--b) no-repeat,
        linear-gradient(var(--c), var(--c)) bottom right / var(--b) 1px no-repeat,
        linear-gradient(var(--c), var(--c)) bottom right / 1px var(--b) no-repeat;
}

/* ---------- Capability ticker ---------- */

.ticker {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    color: var(--muted);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: ticker 48s linear infinite;
}

.ticker-track span {
    padding: 18px 28px;
    white-space: nowrap;
}

.ticker-track span::before {
    content: '+';
    color: var(--accent);
    margin-right: 28px;
}

@keyframes ticker {
    to {
        transform: translateX(-50%);
    }
}

/* ---------- Sections ---------- */

.section {
    padding: clamp(72px, 10vw, 128px) 0;
}

.section-head {
    display: grid;
    gap: 16px;
    margin-bottom: clamp(40px, 6vw, 72px);
}

@media (min-width: 900px) {
    .section-head {
        grid-template-columns: 1fr 1fr;
        align-items: end;
    }
}

.section-label {
    color: var(--accent);
    margin-bottom: 18px;
}

.section-head h2 {
    font-size: clamp(36px, 5vw, 60px);
}

.section-head p {
    color: var(--muted);
    max-width: 30em;
}

/* ---------- Work ---------- */

.work-list {
    display: grid;
    gap: clamp(56px, 8vw, 104px);
}

.case {
    display: grid;
    gap: 28px;
    align-items: center;
}

@media (min-width: 900px) {
    .case {
        grid-template-columns: 1.1fr 1fr;
        gap: 64px;
    }

    .case:nth-child(even) .case-media {
        order: 2;
    }
}

.case-media {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.case-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.8s var(--ease), filter 0.4s;
    filter: saturate(0.85);
}

.case-media:hover img {
    transform: scale(1.03);
    filter: saturate(1);
}

.case-media .brackets {
    inset: 10px;
    opacity: 0;
    transition: opacity 0.3s, inset 0.3s var(--ease);
}

.case-media:hover .brackets,
.case-media:focus-visible .brackets {
    opacity: 1;
    inset: 16px;
}

.play-badge {
    position: absolute;
    left: 16px;
    bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(12, 13, 11, 0.82);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
}

.play-badge::before {
    content: '';
    border-left: 8px solid var(--accent);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.case-index {
    color: var(--dim);
    margin-bottom: 14px;
}

.case h3 {
    font-size: clamp(30px, 3.4vw, 42px);
}

.case-tagline {
    margin-top: 12px;
    font-size: clamp(18px, 1.7vw, 20px);
    line-height: 1.4;
    color: var(--text);
}

.case-body {
    margin-top: 18px;
    color: var(--muted);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.tags li {
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
}

.case-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-top: 28px;
}

.case-note {
    color: var(--dim);
    font-size: 11px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    border-bottom: 1px solid var(--line-strong);
    padding-bottom: 2px;
    transition: border-color 0.2s, color 0.2s;
}

.text-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.building {
    display: grid;
    gap: 12px;
    margin-top: clamp(56px, 8vw, 96px);
    padding: 24px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}

@media (min-width: 760px) {
    .building {
        grid-template-columns: auto 1fr;
        gap: 32px;
        align-items: center;
    }
}

.building .mono {
    color: var(--track);
}

.building p {
    color: var(--muted);
}

.building strong {
    color: var(--text);
    font-weight: 500;
}

/* ---------- Services ---------- */

.services {
    background: var(--bg-raised);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.steps {
    display: grid;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

@media (min-width: 900px) {
    .steps {
        grid-template-columns: repeat(3, 1fr);
    }
}

.step {
    padding: clamp(28px, 3vw, 40px);
    background: var(--bg-raised);
    transition: background-color 0.3s;
}

.step:hover {
    background: var(--surface);
}

.step-num {
    display: flex;
    justify-content: space-between;
    color: var(--dim);
    margin-bottom: clamp(28px, 4vw, 48px);
}

.step-num span:first-child {
    color: var(--accent);
}

.step h3 {
    font-size: 26px;
}

.step p {
    margin-top: 14px;
    color: var(--muted);
}

.pricing-note {
    display: grid;
    gap: 16px;
    margin-top: 40px;
}

@media (min-width: 900px) {
    .pricing-note {
        grid-template-columns: 1fr 2fr;
        align-items: baseline;
    }
}

.pricing-note p:first-child {
    color: var(--track);
}

.pricing-note p:last-child {
    font-size: clamp(20px, 2.2vw, 26px);
    line-height: 1.35;
    letter-spacing: -0.01em;
}

/* ---------- About ---------- */

.about-grid {
    display: grid;
    gap: 48px;
    align-items: start;
}

@media (min-width: 900px) {
    .about-grid {
        grid-template-columns: 0.8fr 1.2fr;
        gap: 80px;
    }
}

.portrait {
    position: relative;
    max-width: 440px;
}

.portrait img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 45% center;
    border-radius: var(--radius);
    filter: contrast(1.05) saturate(0.9);
}

.portrait-box {
    position: absolute;
    top: 10%;
    left: 22%;
    width: 50%;
    height: 82%;
    border: 1.5px solid var(--accent);
    pointer-events: none;
}

.portrait-box span {
    position: absolute;
    left: -1.5px;
    bottom: 100%;
    padding: 3px 7px;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: var(--font-mono);
    font-size: 11px;
    white-space: nowrap;
}

.about-copy h2 {
    font-size: clamp(36px, 5vw, 60px);
    margin-bottom: 28px;
}

.about-copy>p {
    color: var(--muted);
    max-width: 36em;
}

.about-copy>p+p {
    margin-top: 18px;
}

.about-copy>p strong {
    color: var(--text);
    font-weight: 500;
}

.facts {
    display: grid;
    margin: 40px 0 0;
    border-top: 1px solid var(--line);
}

.facts div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.facts dt {
    color: var(--dim);
}

.facts dd {
    margin: 0;
}

.facts a {
    border-bottom: 1px solid var(--line-strong);
    transition: color 0.2s, border-color 0.2s;
}

.facts a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ---------- Contact ---------- */

.contact {
    position: relative;
    border-top: 1px solid var(--line);
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    right: -20%;
    bottom: -60%;
    width: 80vw;
    height: 80vw;
    max-width: 900px;
    max-height: 900px;
    background: radial-gradient(circle, rgba(198, 243, 107, 0.07), transparent 60%);
    pointer-events: none;
}

.contact .container {
    position: relative;
}

.contact h2 {
    font-size: clamp(36px, 5vw, 60px);
    max-width: 14em;
}

.contact-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 32px;
    margin: 36px 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
}

.contact-points li::before {
    content: '✓';
    color: var(--track);
    margin-right: 10px;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 44px;
}

/* ---------- Footer ---------- */

.footer {
    border-top: 1px solid var(--line);
    padding: 28px 0;
    color: var(--dim);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
}

.footer nav {
    display: flex;
    gap: 24px;
}

.footer a:hover {
    color: var(--text);
}

/* ---------- Video dialog ---------- */

.video-dialog {
    width: min(1100px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #000;
    color: var(--text);
}

.video-dialog::backdrop {
    background: rgba(5, 5, 4, 0.88);
    backdrop-filter: blur(4px);
}

.video-dialog video {
    width: 100%;
    max-height: 80vh;
}

.video-dialog-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

.video-dialog-bar button {
    background: none;
    border: 0;
    color: var(--text);
    cursor: pointer;
    padding: 4px 8px;
}

/* ---------- Reveal on scroll (only when JS is on) ---------- */

.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: var(--d, 0s);
}

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

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

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