@layer reset, base, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body, h1, h2, h3, p, figure, blockquote, ul, ol { margin: 0; }
  ul, ol { padding: 0; }
  img, svg { display: block; max-width: 100%; }
  button, input, textarea, select { font: inherit; }
}

@layer base {
  :root {
    color-scheme: dark;
    --bg: #0b0d0f;
    --surface: #14171a;
    --surface-strong: #1b2024;
    --surface-soft: #20262a;
    --line: #343a3f;
    --line-soft: #252a2e;
    --text: #f4f2ec;
    --muted: #b8b5ad;
    --faint: #858984;
    --gold: #d5ad4b;
    --gold-soft: #f0d58d;
    --cyan: #55abb2;
    --success: #65c18c;
    --error: #ff817c;
    --max: 1180px;
    --narrow: 780px;
    --header: 72px;
    --radius: 6px;
    --shadow: 0 18px 50px rgba(0, 0, 0, .24);
    --font-sans: Inter, Aptos, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono: "Cascadia Code", Consolas, "Courier New", monospace;
  }

  html { background: var(--bg); }
  body {
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    letter-spacing: 0;
    text-rendering: optimizeLegibility;
  }

  a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: .24em; }
  a:hover { color: var(--gold-soft); }
  button, a { -webkit-tap-highlight-color: transparent; }
  :focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
  ::selection { background: var(--gold); color: #111; }
  h1, h2, h3 { line-height: 1.12; letter-spacing: 0; text-wrap: balance; }
  h1 { font-size: 4.5rem; }
  h2 { font-size: 2.7rem; }
  h3 { font-size: 1.4rem; }
  p { max-width: 72ch; }
  code, .mono { font-family: var(--font-mono); }
}

@layer components {
  .skip-link {
    position: fixed;
    z-index: 1000;
    top: 12px;
    left: 12px;
    padding: .7rem 1rem;
    background: var(--gold);
    color: #111;
    transform: translateY(-160%);
  }
  .skip-link:focus { transform: translateY(0); }

  .container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
  .container--narrow { width: min(calc(100% - 40px), var(--narrow)); margin-inline: auto; }
  .section { padding-block: 6.5rem; border-top: 1px solid var(--line-soft); }
  .section--compact { padding-block: 3.5rem; }
  .section--surface { background: var(--surface); }
  .section--light { background: #eceae3; color: #17191b; }
  .section-heading { display: grid; gap: 1rem; margin-bottom: 3rem; }
  .section-heading p { color: var(--muted); font-size: 1.08rem; }
  .section--light .section-heading p { color: #4e5458; }
  .eyebrow {
    color: var(--gold);
    font-family: var(--font-mono);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
  }
  .lede { color: var(--muted); font-size: 1.25rem; }
  .accent { color: var(--gold-soft); }
  .muted { color: var(--muted); }

  .site-header {
    position: sticky;
    z-index: 100;
    top: 0;
    min-height: var(--header);
    background: rgba(11, 13, 15, .96);
    border-bottom: 1px solid var(--line-soft);
    backdrop-filter: blur(12px);
  }
  .header-inner { min-height: var(--header); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
  .brand { flex: 0 1 245px; display: block; text-decoration: none; }
  .brand img { width: 245px; height: auto; }
  .header-actions { display: flex; align-items: center; gap: 1.1rem; }
  .site-nav { display: flex; align-items: center; gap: 1.5rem; }
  .site-nav a { font-size: .94rem; font-weight: 650; text-decoration: none; }
  .site-nav a[aria-current="page"] { color: var(--gold-soft); }
  .language-link { font-family: var(--font-mono); font-size: .82rem; font-weight: 700; text-decoration: none; }
  .menu-button {
    display: none;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }
  .menu-icon, .menu-icon::before, .menu-icon::after { width: 22px; height: 2px; background: currentColor; content: ""; }
  .menu-icon { position: relative; }
  .menu-icon::before { position: absolute; top: -7px; left: 0; }
  .menu-icon::after { position: absolute; top: 7px; left: 0; }

  .button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .72rem 1rem;
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    background: var(--gold);
    color: #141516;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
  }
  .button:hover { background: var(--gold-soft); border-color: var(--gold-soft); color: #111; }
  .button--secondary { background: rgba(11, 13, 15, .72); color: var(--text); border-color: var(--line); }
  .button--secondary:hover { background: var(--surface-strong); color: var(--text); border-color: var(--gold); }
  .button--small { min-height: 40px; padding: .55rem .8rem; font-size: .9rem; }

  .hero {
    position: relative;
    isolation: isolate;
    min-height: min(760px, calc(100svh - var(--header) - 32px));
    overflow: hidden;
    border-bottom: 1px solid var(--line-soft);
  }
  .hero-media { position: absolute; z-index: -2; inset: 0; display: grid; grid-template-columns: 1.2fr .8fr; background: #121619; }
  .hero-media picture:first-child { grid-row: 1 / span 2; }
  .hero-media picture, .hero-media img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
  .hero-media picture:nth-child(2), .hero-media picture:nth-child(3) { min-height: 50%; }
  .hero::before { position: absolute; z-index: -1; inset: 0; content: ""; background: rgba(5, 7, 8, .72); }
  .hero-inner { min-height: inherit; display: flex; align-items: center; padding-block: 4rem; }
  .hero-copy { display: grid; max-width: 840px; gap: 1.35rem; }
  .hero-brand { display: inline-flex; align-items: center; gap: .8rem; color: var(--gold-soft); font-family: var(--font-mono); font-weight: 700; }
  .hero-brand img { width: 38px; height: 38px; }
  .hero h1 { max-width: 16ch; font-size: 4.5rem; }
  .hero .lede { max-width: 66ch; color: #dbd9d2; }
  .hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .4rem; }
  .hero-stack { display: flex; flex-wrap: wrap; gap: .45rem 1.2rem; color: #c7c5be; font-family: var(--font-mono); font-size: .83rem; }

  .proof { background: #eceae3; color: #17191b; }
  .proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
  .proof-item { min-height: 126px; padding: 1.7rem; border-right: 1px solid #c9c6bd; }
  .proof-item:last-child { border-right: 0; }
  .proof-item strong { display: block; margin-bottom: .45rem; font-size: 1.05rem; }
  .proof-item span { color: #565b5e; font-size: .94rem; }

  .project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
  .project-card { display: grid; min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .project-card__media { aspect-ratio: 16 / 9; overflow: hidden; background: #111417; border-bottom: 1px solid var(--line); }
  .project-card__media picture, .project-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
  .project-card__body { display: grid; align-content: start; gap: .9rem; padding: 1.6rem; }
  .project-card__body p { color: var(--muted); }
  .project-meta { display: flex; flex-wrap: wrap; gap: .45rem .9rem; color: var(--faint); font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase; }
  .project-link { justify-self: start; margin-top: .25rem; font-weight: 750; }

  .capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
  .capability { min-height: 220px; padding: 1.7rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .capability .mono { display: block; margin-bottom: 2.5rem; color: var(--gold); font-size: .8rem; }
  .capability p { margin-top: .8rem; color: var(--muted); }

  .split { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 5rem; align-items: start; }
  .split__content { display: grid; gap: 1.25rem; }
  .feature-list { display: grid; gap: 0; list-style: none; border-top: 1px solid var(--line); }
  .feature-list li { display: grid; grid-template-columns: 34px 1fr; gap: .8rem; padding-block: .95rem; border-bottom: 1px solid var(--line); }
  .feature-list .mono { color: var(--gold); }

  .stack-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
  .stack-group h3 { margin-bottom: 1rem; color: var(--gold-soft); font-family: var(--font-mono); font-size: .9rem; text-transform: uppercase; }
  .stack-group ul { display: grid; gap: .52rem; color: var(--muted); list-style: none; }

  .secondary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
  .secondary-card { overflow: hidden; background: #f3f1eb; color: #17191b; border: 1px solid #cbc8be; border-radius: var(--radius); }
  .secondary-card__media { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid #cbc8be; }
  .secondary-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
  .secondary-card__body { display: grid; gap: .65rem; padding: 1.25rem; }
  .secondary-card__body p { color: #51565a; }

  .process { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
  .process-step { padding: 1.5rem; border-right: 1px solid var(--line); }
  .process-step:last-child { border-right: 0; }
  .process-step .mono { display: block; margin-bottom: 1.8rem; color: var(--gold); }
  .process-step p { margin-top: .65rem; color: var(--muted); }

  .cta-band { padding-block: 5.5rem; background: var(--gold); color: #151616; }
  .cta-inner { display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
  .cta-inner p { margin-top: .85rem; color: #373832; }
  .cta-band .button { border-color: #17191b; background: #17191b; color: var(--text); }
  .cta-band .button:hover { background: #353638; }

  .page-hero { padding-block: 5.5rem 4rem; border-bottom: 1px solid var(--line); }
  .page-hero__inner { display: grid; gap: 1.2rem; }
  .page-hero h1 { max-width: 17ch; font-size: 4.2rem; }
  .breadcrumbs { color: var(--muted); font-size: .88rem; }
  .breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; }
  .breadcrumbs li:not(:last-child)::after { margin-left: .4rem; color: var(--faint); content: "/"; }

  .case-hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); min-height: 560px; border-bottom: 1px solid var(--line); }
  .case-hero__copy { display: grid; align-content: center; gap: 1.25rem; padding: 4rem max(24px, calc((100vw - var(--max)) / 2)); padding-right: 3rem; }
  .case-hero__copy h1 { font-size: 4.2rem; }
  .case-hero__media { min-width: 0; background: var(--surface); }
  .case-hero__media picture, .case-hero__media img, .case-hero__media svg { width: 100%; height: 100%; object-fit: cover; object-position: top; }
  .status { color: var(--gold-soft); font-family: var(--font-mono); font-size: .82rem; font-weight: 700; text-transform: uppercase; }

  .case-section { padding-block: 5rem; border-bottom: 1px solid var(--line-soft); }
  .case-section__grid { display: grid; grid-template-columns: .65fr 1.35fr; gap: 4rem; }
  .case-section__body { display: grid; gap: 1.3rem; color: var(--muted); }
  .case-section__body strong { color: var(--text); }
  .case-section__body ul { display: grid; gap: .7rem; padding-left: 1.2rem; }
  .diagram { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #111417; }
  .diagram figcaption { padding: .8rem 1rem; color: var(--muted); font-size: .86rem; border-top: 1px solid var(--line); }
  .gallery-grid { display: grid; grid-template-columns: 1.6fr .7fr; gap: 1.2rem; align-items: start; }
  .gallery-grid figure { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .gallery-grid img { width: 100%; height: auto; }
  .gallery-grid figcaption { padding: .8rem 1rem; color: var(--muted); font-size: .86rem; border-top: 1px solid var(--line); }

  .contact-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 5rem; }
  .contact-links { display: grid; gap: 1rem; list-style: none; }
  .contact-links a { display: inline-flex; min-height: 44px; align-items: center; font-weight: 700; overflow-wrap: anywhere; }
  .form { display: grid; gap: 1.1rem; }
  .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .field { display: grid; gap: .45rem; }
  .field label { font-weight: 700; }
  .field input, .field textarea {
    width: 100%;
    min-height: 48px;
    padding: .75rem .85rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #0f1214;
    color: var(--text);
  }
  .field textarea { min-height: 180px; resize: vertical; }
  .field input:focus, .field textarea:focus { border-color: var(--gold); }
  .checkbox { display: grid; grid-template-columns: 22px 1fr; gap: .7rem; align-items: start; }
  .checkbox input { width: 20px; height: 20px; margin-top: .2rem; accent-color: var(--gold); }
  .honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .form-status { min-height: 1.7rem; color: var(--muted); }
  .form-status[data-state="success"] { color: var(--success); }
  .form-status[data-state="error"] { color: var(--error); }

  .legal { display: grid; gap: 2.3rem; }
  .legal section { display: grid; gap: .85rem; }
  .legal p, .legal li { color: var(--muted); }
  .legal ul { padding-left: 1.2rem; }

  .site-footer { padding-block: 3rem; border-top: 1px solid var(--line); }
  .footer-grid { display: grid; grid-template-columns: 1.1fr .9fr .9fr; gap: 3rem; }
  .footer-brand img { width: 220px; margin-bottom: 1rem; }
  .footer-brand p { color: var(--muted); font-size: .94rem; }
  .footer-nav { display: grid; align-content: start; gap: .7rem; list-style: none; }
  .footer-nav a { text-decoration: none; }
  .footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.3rem; color: var(--faint); font-size: .86rem; border-top: 1px solid var(--line-soft); }

  .brand-board { width: min(calc(100% - 40px), 1200px); margin: 3rem auto; border: 1px solid var(--line); }
}

@layer utilities {
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
}

@media (max-width: 980px) {
  :root { --header: 66px; }
  .header-inner { gap: .8rem; }
  .brand { flex-basis: 205px; }
  .brand img { width: 205px; }
  .menu-button { display: grid; }
  .site-nav {
    position: absolute;
    top: var(--header);
    right: 20px;
    left: 20px;
    display: none;
    align-items: stretch;
    padding: .8rem;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .site-nav[data-open="true"] { display: grid; }
  .site-nav a { min-height: 44px; display: flex; align-items: center; padding-inline: .6rem; }
  .header-cta { display: none; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
  .proof-item:nth-child(2) { border-right: 0; }
  .proof-item:nth-child(-n+2) { border-bottom: 1px solid #c9c6bd; }
  .capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .secondary-grid { grid-template-columns: 1fr; }
  .secondary-card { display: grid; grid-template-columns: .9fr 1.1fr; }
  .secondary-card__media { aspect-ratio: auto; border-right: 1px solid #cbc8be; border-bottom: 0; }
  .process { grid-template-columns: repeat(2, 1fr); }
  .process-step:nth-child(2) { border-right: 0; }
  .process-step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .case-hero { grid-template-columns: 1fr; }
  .case-hero__copy { padding: 4rem 24px; }
  .case-hero__media { aspect-ratio: 16 / 9; }
}

@media (max-width: 720px) {
  .container, .container--narrow { width: min(calc(100% - 30px), var(--max)); }
  .section { padding-block: 4.5rem; }
  .header-actions { gap: .7rem; }
  .brand { flex-basis: 175px; }
  .brand img { width: 175px; }
  .hero { min-height: 650px; }
  .hero-media { grid-template-columns: 1fr; }
  .hero-media picture:first-child { grid-row: auto; }
  .hero-media picture:nth-child(n+2) { display: none; }
  .hero::before { background: rgba(5, 7, 8, .78); }
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2.15rem; }
  .hero h1 { max-width: 13ch; font-size: 3rem; }
  .hero-copy { gap: 1.05rem; }
  .proof-grid, .project-grid, .capability-grid, .stack-grid, .process, .footer-grid, .contact-grid, .case-section__grid { grid-template-columns: 1fr; }
  .proof-item, .proof-item:nth-child(2) { border-right: 0; border-bottom: 1px solid #c9c6bd; }
  .proof-item:last-child { border-bottom: 0; }
  .capability { min-height: auto; }
  .capability .mono { margin-bottom: 1.5rem; }
  .split { grid-template-columns: 1fr; gap: 2.5rem; }
  .secondary-card { grid-template-columns: 1fr; }
  .secondary-card__media { aspect-ratio: 16 / 10; border-right: 0; border-bottom: 1px solid #cbc8be; }
  .process-step, .process-step:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .process-step:last-child { border-bottom: 0; }
  .cta-inner { align-items: start; flex-direction: column; }
  .case-section__grid { gap: 2rem; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid figure:nth-child(2) { width: min(100%, 390px); }
  .form-row { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .page-hero h1, .case-hero__copy h1 { font-size: 2.75rem; }
}

@media (max-width: 390px) {
  .brand { flex-basis: 142px; }
  .brand img { width: 142px; }
  .language-link { font-size: .75rem; }
  .hero-actions .button { width: 100%; }
  .page-hero h1, .case-hero__copy h1 { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; font-size: 10.5pt; }
  .site-header, .site-footer, .cta-band, .button, .skip-link, .hero-media { display: none !important; }
  .section, .page-hero, .case-section { padding-block: 1.2rem; border-color: #bbb; }
  .section--surface { background: #fff; }
  .muted, .lede, .section-heading p, .case-section__body, .stack-group ul { color: #333; }
  a { color: #111; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; }
  .container, .container--narrow { width: 100%; }
  .page-hero h1 { font-size: 28pt; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
}
