/* =========================================================
   JDC Tech & Design — main stylesheet
   Modern CSS: custom props, oklch/color-mix, nesting, :has(),
   container queries, scroll-driven animations, view transitions
   ========================================================= */

@layer reset, tokens, base, layout, components, sections, utilities;

/* ---------- reset ---------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
  img, svg, canvas { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; cursor: pointer; }
  ul, ol { list-style: none; }
  a { color: inherit; text-decoration: none; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  }
}

/* ---------- tokens ---------- */
@layer tokens {
  :root {
    --c-violet: #7c5cff;
    --c-cyan: #22d3ee;
    --c-pink: #f472b6;
    --c-green: #34d399;
    --c-amber: #fbbf24;

    --bg: #07080f;
    --bg-2: #0d0f1c;
    --surface: color-mix(in oklab, white 4%, transparent);
    --surface-2: color-mix(in oklab, white 7%, transparent);
    --border: color-mix(in oklab, white 10%, transparent);
    --border-strong: color-mix(in oklab, white 18%, transparent);
    --text: #eef0ff;
    --text-2: #a3a8c3;
    --text-3: #6c7194;

    --grad: linear-gradient(120deg, var(--c-violet), var(--c-cyan));
    --grad-ai: linear-gradient(120deg, var(--c-pink), var(--c-violet) 45%, var(--c-cyan));

    --f-display: "Space Grotesk", system-ui, sans-serif;
    --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --f-mono: "JetBrains Mono", ui-monospace, monospace;

    --r-sm: 10px; --r: 18px; --r-lg: 28px;
    --shadow: 0 30px 80px -20px rgb(0 0 0 / .6);
    --ease: cubic-bezier(.2, .8, .2, 1);
    --container: 1200px;
    color-scheme: dark;
  }

  [data-theme="light"] {
    --bg: #f6f7fb;
    --bg-2: #ffffff;
    --surface: color-mix(in oklab, #1a1d3a 4%, white);
    --surface-2: color-mix(in oklab, #1a1d3a 7%, white);
    --border: color-mix(in oklab, #1a1d3a 10%, transparent);
    --border-strong: color-mix(in oklab, #1a1d3a 18%, transparent);
    --text: #0c0e1f;
    --text-2: #4a4f6e;
    --text-3: #7d82a3;
    --shadow: 0 30px 70px -25px rgb(30 35 90 / .25);
    color-scheme: light;
  }
}

/* ---------- base ---------- */
@layer base {
  body {
    font-family: var(--f-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: clamp(15px, 0.95rem + 0.1vw, 17px);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    transition: background-color .4s var(--ease), color .4s var(--ease);
  }
  h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; text-wrap: balance; }
  p { text-wrap: pretty; }
  ::selection { background: var(--c-violet); color: white; }
  :focus-visible { outline: 2px solid var(--c-cyan); outline-offset: 3px; border-radius: 6px; }
  svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

  .skip-link {
    position: fixed; left: 1rem; top: -100px; z-index: 1000;
    background: var(--c-violet); color: #fff; padding: .6rem 1rem; border-radius: 8px;
    &:focus { top: 1rem; }
  }
}

/* ---------- layout ---------- */
@layer layout {
  .container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
  .section { padding-block: clamp(5rem, 10vw, 9rem); position: relative; }
  .section__head {
    max-width: 760px; margin-bottom: clamp(2.5rem, 5vw, 4rem);
    &.section__head--row {
      max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap;
      .section__lead { max-width: 420px; }
    }
  }
  .section__title { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.6rem); margin-block: .6rem 1rem; }
  .section__lead { color: var(--text-2); font-size: 1.1em; max-width: 620px; }
  .section__lead a { color: var(--c-cyan); text-decoration: underline; text-underline-offset: 3px; }
}

/* ---------- components ---------- */
@layer components {
  /* background */
  .bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
  .bg__orb {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45;
    animation: drift 22s ease-in-out infinite alternate;
  }
  .bg__orb--1 { width: 620px; height: 620px; background: var(--c-violet); top: -200px; left: -150px; }
  .bg__orb--2 { width: 520px; height: 520px; background: var(--c-cyan); top: 30%; right: -220px; opacity: .25; animation-delay: -6s; }
  .bg__orb--3 { width: 480px; height: 480px; background: var(--c-pink); bottom: -220px; left: 30%; opacity: .18; animation-delay: -12s; }
  [data-theme="light"] .bg__orb { opacity: .18; }
  .bg__grid {
    position: absolute; inset: 0;
    background-image:
      linear-gradient(var(--border) 1px, transparent 1px),
      linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
    opacity: .55;
  }
  .bg__noise {
    position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
  @keyframes drift { to { transform: translate3d(80px, 60px, 0) scale(1.15); } }

  .cursor-glow {
    position: fixed; width: 500px; height: 500px; border-radius: 50%; pointer-events: none; z-index: -1;
    background: radial-gradient(circle, color-mix(in oklab, var(--c-violet) 18%, transparent), transparent 65%);
    translate: calc(var(--mx, -999px) - 50%) calc(var(--my, -999px) - 50%);
    transition: opacity .3s;
  }
  @media (hover: none) { .cursor-glow { display: none; } }

  .scroll-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200;
    background: var(--grad); transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  }
  @supports (animation-timeline: scroll()) {
    .scroll-progress { animation: grow linear both; animation-timeline: scroll(root); }
    @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  }

  /* buttons */
  .btn {
    --pad: .85rem 1.4rem;
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    padding: var(--pad); border-radius: 999px; font-weight: 600; font-size: .95rem;
    border: 1px solid transparent; position: relative; isolation: isolate;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s;
    white-space: nowrap;
    svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
    &:hover svg { transform: translateX(3px); }
  }
  .btn--sm { --pad: .55rem 1rem; font-size: .875rem; }
  .btn--lg { --pad: 1rem 1.7rem; font-size: 1rem; }
  .btn--block { width: 100%; }
  .btn--primary {
    background: var(--grad); color: #fff;
    box-shadow: 0 10px 30px -10px color-mix(in oklab, var(--c-violet) 80%, transparent), inset 0 1px 0 rgb(255 255 255 / .25);
    &:hover { box-shadow: 0 18px 40px -12px color-mix(in oklab, var(--c-violet) 90%, transparent), inset 0 1px 0 rgb(255 255 255 / .3); }
  }
  .btn--ghost {
    background: var(--surface); border-color: var(--border-strong); backdrop-filter: blur(10px);
    &:hover { background: var(--surface-2); }
  }

  .pill {
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .4rem .9rem .4rem .7rem; border-radius: 999px; font-size: .85rem; color: var(--text-2);
    background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(10px);
  }
  .pill__dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--c-green);
    box-shadow: 0 0 0 0 var(--c-green); animation: ping 2s infinite;
  }
  @keyframes ping { 70% { box-shadow: 0 0 0 8px transparent; } }

  .eyebrow {
    font-family: var(--f-mono); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--c-cyan);
    &.eyebrow--ai { background: var(--grad-ai); -webkit-background-clip: text; background-clip: text; color: transparent; }
  }
  .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .grad--ai { background: var(--grad-ai); -webkit-background-clip: text; background-clip: text; background-size: 200% auto; animation: shine 5s linear infinite; }
  @keyframes shine { to { background-position: 200% center; } }

  /* logo */
  .logo {
    display: inline-flex; align-items: center; gap: .65rem; font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; white-space: nowrap;
    .logo__mark svg { width: 36px; height: 36px; stroke: none; }
    .logo__mark svg path, .logo__mark svg circle { stroke: #fff; }
    .logo__mark svg circle { stroke: none; }
    .logo__text span { font-weight: 500; color: var(--text-2); }
  }

  /* windows (mock UI) */
  .window {
    background: color-mix(in oklab, var(--bg-2) 82%, transparent);
    border: 1px solid var(--border-strong); border-radius: var(--r);
    box-shadow: var(--shadow); backdrop-filter: blur(16px) saturate(140%);
    overflow: hidden;
  }
  .window__bar {
    display: flex; align-items: center; gap: 6px; padding: .7rem .9rem; border-bottom: 1px solid var(--border);
    font-family: var(--f-mono); font-size: .75rem; color: var(--text-3);
    i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
    i:nth-child(2) { background: #febc2e; } i:nth-child(3) { background: #28c840; }
    span { margin-left: .5rem; }
  }

  /* cards */
  .card {
    position: relative; padding: clamp(1.5rem, 3vw, 2rem); border-radius: var(--r-lg);
    background: var(--surface); border: 1px solid var(--border);
    overflow: hidden; isolation: isolate;
    transition: transform .5s var(--ease), border-color .3s;
    h3 { font-size: 1.35rem; margin-block: 1.1rem .6rem; }
    p { color: var(--text-2); }
    &:hover { border-color: var(--border-strong); transform: translateY(-4px); }
  }
  /* spotlight following cursor */
  .spot::before {
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
    background: radial-gradient(420px circle at var(--x, 50%) var(--y, 50%), color-mix(in oklab, var(--c-violet) 22%, transparent), transparent 60%);
  }
  .spot:hover::before { opacity: 1; }

  .card__icon {
    width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
    background: linear-gradient(135deg, color-mix(in oklab, var(--c-violet) 30%, transparent), color-mix(in oklab, var(--c-cyan) 20%, transparent));
    border: 1px solid var(--border-strong);
    svg { width: 24px; height: 24px; color: var(--text); }
    &.card__icon--ai { background: var(--grad-ai); border: 0; svg { color: #fff; } }
  }
  .tag {
    display: inline-block; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
    padding: .25rem .6rem; border-radius: 999px; background: var(--grad-ai); color: #fff; margin-top: 1rem;
  }
  .tick {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; margin-top: 1.25rem; color: var(--text-2); font-size: .95rem;
    li { display: flex; gap: .5rem; align-items: center; }
    li::before { content: "✓"; color: var(--c-green); font-weight: 700; }
  }
  .link-arrow {
    display: inline-flex; align-items: center; gap: .4rem; color: var(--c-cyan); font-weight: 600; white-space: nowrap;
    svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
    &:hover svg { transform: translateX(4px); }
  }

  .spark { color: var(--c-pink); }
}

/* ---------- sections ---------- */
@layer sections {
  /* NAV */
  .nav {
    position: fixed; inset: 0 0 auto; z-index: 100; padding-block: 1rem;
    transition: padding .4s var(--ease), background .4s, border-color .4s, backdrop-filter .4s;
    border-bottom: 1px solid transparent;
    &.is-scrolled {
      padding-block: .6rem;
      background: color-mix(in oklab, var(--bg) 72%, transparent);
      backdrop-filter: blur(18px) saturate(160%);
      border-color: var(--border);
    }
  }
  .nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .nav__links {
    display: flex; gap: .25rem; padding: .3rem; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(10px);
    a { padding: .45rem .9rem; border-radius: 999px; font-size: .9rem; white-space: nowrap; color: var(--text-2); transition: color .2s, background .2s; }
    a:hover, a.is-active { color: var(--text); background: var(--surface-2); }
  }
  .nav__actions { display: flex; align-items: center; gap: .6rem; }
  .theme-toggle {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--border);
    svg { width: 18px; height: 18px; grid-area: 1/1; transition: transform .5s var(--ease), opacity .3s; }
    .i-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
    [data-theme="light"] & .i-sun { opacity: 1; transform: none; }
    [data-theme="light"] & .i-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
  }
  .nav__burger {
    display: none; width: 40px; height: 40px; border-radius: 50%; place-items: center; align-content: center; gap: 5px;
    background: var(--surface); border: 1px solid var(--border);
    span { display: block; width: 16px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s var(--ease); }
    &[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
    &[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  }
  .mobile-menu {
    display: grid; gap: .25rem; padding: 1rem 1.25rem 1.5rem;
    background: color-mix(in oklab, var(--bg) 92%, transparent); backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    a:not(.btn) { padding: .8rem .5rem; font-size: 1.1rem; border-bottom: 1px solid var(--border); }
    .btn { margin-top: 1rem; }
    &[hidden] { display: none; }
  }
  @media (max-width: 1140px) {
    .nav__links { display: none; }
    .nav__burger { display: grid; }
    .nav__actions > .btn { display: none; }
  }
  @media (min-width: 1141px) { .mobile-menu { display: none !important; } }

  /* HERO */
  .hero {
    min-height: 100svh; display: grid; align-items: center; position: relative;
    padding-block: 8rem 5rem;
  }
  .hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .7; mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 70%); }
  .hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; position: relative; }
  .hero__title { font-size: clamp(2.6rem, 1.4rem + 4.8vw, 5.2rem); margin-block: 1.4rem 1.4rem; font-weight: 700; letter-spacing: -0.035em; }
  .hero__lead { color: var(--text-2); font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); max-width: 580px; }
  .hero__cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 2.2rem; }
  .hero__chips {
    display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2.2rem;
    li { font-family: var(--f-mono); font-size: .78rem; padding: .3rem .7rem; border-radius: 8px; border: 1px dashed var(--border-strong); color: var(--text-3); }
  }

  .rotator {
    display: inline-grid; vertical-align: bottom; overflow: hidden; padding-bottom: .08em;
    .rotator__word {
      grid-area: 1/1; background: var(--grad-ai); -webkit-background-clip: text; background-clip: text; color: transparent;
      background-size: 200% auto; animation: shine 6s linear infinite;
      transform: translateY(105%); opacity: 0; transition: transform .7s var(--ease), opacity .7s var(--ease);
      white-space: nowrap;
    }
    .rotator__word.is-active { transform: none; opacity: 1; }
    .rotator__word.is-leaving { transform: translateY(-105%); opacity: 0; }
  }

  .hero__visual { perspective: 1400px; }
  .tilt { position: relative; transform-style: preserve-3d; transition: transform .4s var(--ease); transform: rotateY(var(--ry, -8deg)) rotateX(var(--rx, 6deg)); }
  .window--code { position: relative; }
  .code {
    padding: 1.3rem 1.4rem 1.6rem; font-family: var(--f-mono); font-size: clamp(.72rem, .65rem + .25vw, .88rem); line-height: 1.8; overflow-x: auto;
    color: var(--text-2);
    .c-k { color: #c792ea; } .c-v { color: var(--text); } .c-f { color: #82aaff; } .c-p { color: #f78c6c; } .c-s { color: #c3e88d; } .c-c { color: var(--c-green); }
  }
  [data-theme="light"] .code { .c-k { color: #7c3aed; } .c-f { color: #2563eb; } .c-p { color: #c2410c; } .c-s { color: #15803d; } }
  .caret { display: inline-block; width: 8px; height: 1.1em; vertical-align: text-bottom; background: var(--c-cyan); margin-left: 4px; animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }

  .window--stat { position: absolute; right: -24px; bottom: -48px; width: 230px; padding: 1rem 1.1rem; transform: translateZ(60px); }
  .stat-mini {
    display: grid; gap: .35rem;
    .stat-mini__label { font-size: .75rem; color: var(--text-3); }
    .stat-mini__value { font-family: var(--f-display); font-size: 1.8rem; font-weight: 700; }
    .stat-mini__sub { font-size: .75rem; color: var(--text-2); }
  }
  .bar { height: 6px; border-radius: 9px; background: var(--surface-2); overflow: hidden;
    span { display: block; height: 100%; width: var(--w); background: var(--grad); border-radius: inherit; animation: fill 2s var(--ease) both .6s; }
  }
  @keyframes fill { from { width: 0; } }
  .window--chat { position: absolute; left: -40px; top: -44px; width: 270px; padding: .9rem; display: grid; gap: .5rem; transform: translateZ(90px); }
  .bubble { font-size: .8rem; padding: .55rem .8rem; border-radius: 14px; max-width: 90%; }
  .bubble--user { justify-self: end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
  .bubble--ai { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
  .float-1 { animation: float 7s ease-in-out infinite; }
  .float-2 { animation: float 8s ease-in-out infinite -3s; }
  @keyframes float { 50% { translate: 0 -12px; } }

  .scroll-cue {
    position: absolute; left: 50%; bottom: 2rem; translate: -50% 0; width: 26px; height: 42px; border-radius: 20px; border: 2px solid var(--border-strong);
    span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: var(--text-2); animation: cue 1.8s infinite; }
  }
  @keyframes cue { 80%, 100% { transform: translateY(14px); opacity: 0; } }

  @media (max-width: 980px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero__visual { max-width: 560px; margin: 3rem auto 0; width: 100%; }
    .window--chat { left: -8px; top: -60px; width: 240px; }
    .window--stat { right: -8px; }
    .scroll-cue { display: none; }
  }

  /* MARQUEE */
  .marquee {
    border-block: 1px solid var(--border); padding-block: 1.3rem; overflow: hidden;
    background: color-mix(in oklab, var(--bg-2) 60%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  }
  .marquee__track { display: flex; width: max-content; animation: marquee 45s linear infinite; }
  .marquee:hover .marquee__track { animation-play-state: paused; }
  .marquee ul { display: flex; gap: 3rem; padding-right: 3rem;
    li { font-family: var(--f-display); font-size: 1.15rem; font-weight: 500; color: var(--text-3); white-space: nowrap; display: flex; align-items: center; gap: 3rem; transition: color .2s; }
    li::after { content: "✦"; font-size: .7rem; color: var(--c-violet); }
    li:hover { color: var(--text); }
  }
  @keyframes marquee { to { transform: translateX(-50%); } }

  /* BENTO */
  .bento {
    display: grid; gap: 1.1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "xl xl a"
      "xl xl b"
      "ai ai c"
      "ai ai d";
    > :nth-child(1) { grid-area: xl; }
    > :nth-child(2) { grid-area: a; }
    > :nth-child(3) { grid-area: b; }
    > :nth-child(4) { grid-area: ai; }
    > :nth-child(5) { grid-area: c; }
    > :nth-child(6) { grid-area: d; }
  }
  .card--xl { display: flex; flex-direction: column; h3 { font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem); } p { max-width: 520px; } }
  .browser-art {
    margin-top: auto; padding-top: 2rem; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 24px 90px 60px; gap: 10px;
    span { border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
    span:nth-child(1) { grid-column: 1 / -1; }
    span:nth-child(2) { background: linear-gradient(135deg, color-mix(in oklab, var(--c-violet) 35%, transparent), color-mix(in oklab, var(--c-cyan) 25%, transparent)); }
    span:nth-child(4) { grid-column: 1 / -1; }
  }
  .card--ai {
    display: grid; grid-template-columns: auto 1fr; gap: 0 1.5rem; align-content: center;
    background:
      radial-gradient(600px circle at 100% 0%, color-mix(in oklab, var(--c-pink) 18%, transparent), transparent 60%),
      radial-gradient(500px circle at 0% 100%, color-mix(in oklab, var(--c-cyan) 14%, transparent), transparent 60%),
      var(--surface);
    border-color: color-mix(in oklab, var(--c-violet) 40%, transparent);
    h3 { margin-top: .6rem; font-size: 1.6rem; }
    .link-arrow { grid-column: 2; margin-top: 1rem; }
    .tag { margin-top: 0; }
  }
  @media (max-width: 980px) {
    .bento { grid-template-columns: 1fr 1fr; grid-template-areas: "xl xl" "a b" "ai ai" "c d"; }
  }
  @media (max-width: 640px) {
    .bento { grid-template-columns: 1fr; grid-template-areas: "xl" "a" "b" "ai" "c" "d"; }
    .card--ai { grid-template-columns: 1fr; .link-arrow { grid-column: 1; } h3 { margin-top: 1rem; } }
    .card--ai .card__icon { margin-bottom: 1rem; }
    .tick { grid-template-columns: 1fr; }
  }

  /* AI SECTION */
  .section--ai::before {
    content: ""; position: absolute; inset: 10% 0; z-index: -1;
    background: radial-gradient(60% 50% at 50% 50%, color-mix(in oklab, var(--c-violet) 16%, transparent), transparent 70%);
  }
  .ai-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
  .ai-list { display: grid; gap: .8rem; }
  .ai-item {
    display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; text-align: left; padding: 1.3rem 1.4rem; border-radius: var(--r);
    border: 1px solid var(--border); background: var(--surface); transition: background .3s, border-color .3s, transform .3s var(--ease);
    strong { display: block; font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; margin-bottom: .3rem; }
    small { display: block; color: var(--text-2); font-size: .92rem; line-height: 1.55; }
    &:hover { border-color: var(--border-strong); transform: translateX(4px); }
    &.is-active {
      border-color: color-mix(in oklab, var(--c-violet) 60%, transparent);
      background: linear-gradient(120deg, color-mix(in oklab, var(--c-violet) 16%, transparent), color-mix(in oklab, var(--c-cyan) 8%, transparent));
      .ai-item__num { background: var(--grad-ai); color: #fff; border-color: transparent; }
    }
  }
  .ai-item__num {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-family: var(--f-mono); font-size: .8rem;
    border: 1px solid var(--border-strong); color: var(--text-2); transition: background .3s;
  }
  .ai-demo { position: sticky; top: 100px; }
  .window--demo { display: flex; flex-direction: column; height: 520px;
    .window__bar { justify-content: flex-start; }
  }
  .live { margin-left: auto !important; display: inline-flex; align-items: center; gap: .4rem; color: var(--c-green);
    span { width: 7px; height: 7px; border-radius: 50%; background: var(--c-green); animation: ping 2s infinite; margin: 0 !important; }
  }
  .ai-demo__body { flex: 1; overflow-y: auto; padding: 1.2rem; display: flex; flex-direction: column; gap: .8rem; scroll-behavior: smooth; }
  .msg {
    max-width: 88%; padding: .75rem 1rem; border-radius: 16px; font-size: .92rem; line-height: 1.55;
    animation: pop .45s var(--ease) both;
    &.msg--user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
    &.msg--ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
    &.msg--ai::before { content: "✦ JDC AI"; display: block; font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; color: var(--c-pink); margin-bottom: .3rem; }
    code, pre { font-family: var(--f-mono); font-size: .8rem; }
    pre { margin-top: .5rem; padding: .7rem .8rem; border-radius: 10px; background: color-mix(in oklab, var(--bg) 70%, transparent); border: 1px solid var(--border); overflow-x: auto; color: var(--c-green); }
    ul { margin-top: .4rem; display: grid; gap: .2rem; }
    p + p, p + ul, ul + p { margin-top: .5rem; }
    li::before { content: "→ "; color: var(--c-cyan); }
  }
  .typing { display: inline-flex; gap: 4px; padding: .2rem 0;
    i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: bounce 1.2s infinite; }
    i:nth-child(2) { animation-delay: .15s; } i:nth-child(3) { animation-delay: .3s; }
  }
  @keyframes bounce { 30% { transform: translateY(-5px); background: var(--c-cyan); } }
  @keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
  .ai-demo__input {
    display: flex; gap: .5rem; padding: .8rem; border-top: 1px solid var(--border);
    input { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .7rem 1.1rem; outline: none; font-size: .92rem; }
    input:focus { border-color: var(--c-violet); }
    &.is-busy button { opacity: .5; pointer-events: none; }
    button { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--grad); display: grid; place-items: center; color: #fff;
      svg { width: 18px; height: 18px; }
    }
  }
  .ai-demo__note { font-size: .8rem; color: var(--text-3); margin-top: .7rem; text-align: center; }
  @media (max-width: 980px) {
    .ai-grid { grid-template-columns: 1fr; }
    .ai-demo { position: static; }
    .window--demo { height: 460px; }
  }

  /* WORK */
  .work { display: grid; gap: clamp(1.5rem, 4vw, 2.5rem); }
  .project {
    display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
    padding: clamp(1rem, 2vw, 1.4rem); border-radius: calc(var(--r-lg) + 6px); background: var(--surface); border: 1px solid var(--border);
    &.project--rev { grid-template-columns: 1fr 1.05fr; .project__media { order: 2; } }
  }
  .project__body { padding: clamp(.5rem, 2vw, 1.5rem);
    h3 { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.1rem); margin-block: .8rem .8rem; }
    > p { color: var(--text-2); }
  }
  .project__tag { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--c-cyan); }
  .feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; margin-block: 1.3rem; font-size: .93rem; color: var(--text-2);
    li { display: flex; gap: .5rem; }
    li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; margin-top: .6em; background: var(--grad); }
  }
  .stack { display: flex; flex-wrap: wrap; gap: .4rem;
    span { font-family: var(--f-mono); font-size: .75rem; padding: .3rem .65rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
  }
  .project__media {
    aspect-ratio: 4 / 3; border-radius: var(--r-lg); position: relative; overflow: hidden; display: grid; place-items: center; padding: 8%;
    &.project__media--cpms { background: radial-gradient(circle at 20% 20%, #f59e0b55, transparent 55%), radial-gradient(circle at 90% 90%, #7c5cff66, transparent 55%), var(--bg-2); }
    &.project__media--iacms { background: radial-gradient(circle at 80% 15%, #22d3ee55, transparent 55%), radial-gradient(circle at 10% 90%, #34d39955, transparent 55%), var(--bg-2); }
    &.project__media--mobile { background: radial-gradient(circle at 30% 80%, #f472b655, transparent 55%), radial-gradient(circle at 85% 20%, #7c5cff66, transparent 55%), var(--bg-2); }
  }
  .mock {
    width: 100%; height: 100%; border-radius: 14px; display: grid; grid-template-columns: 18% 1fr; overflow: hidden;
    background: color-mix(in oklab, var(--bg-2) 85%, transparent); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
    transition: transform .6s var(--ease);
    .project:hover & { transform: scale(1.03) rotate(-.6deg); }
  }
  .mock__side { border-right: 1px solid var(--border); padding: 14% 18%; display: grid; align-content: start; gap: 12px;
    i { height: 8px; border-radius: 4px; background: var(--surface-2); }
    i:first-child { height: 18px; width: 18px; border-radius: 6px; background: var(--grad); margin-bottom: 8px; }
  }
  .mock__main { padding: 6%; display: grid; align-content: start; gap: 10px; }
  .mock__kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px;
    b { height: 46px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
    b:first-child { background: linear-gradient(135deg, #f59e0b55, transparent); }
  }
  .gantt { display: grid; gap: 9px;
    span { height: 14px; border-radius: 7px; margin-left: var(--s); width: calc(var(--e) - var(--s)); background: linear-gradient(90deg, #f59e0b, #f472b6);
      transform-origin: left; animation: bar-in 1.2s var(--ease) both; }
    span:nth-child(2) { background: linear-gradient(90deg, #7c5cff, #22d3ee); animation-delay: .1s; }
    span:nth-child(3) { animation-delay: .2s; }
    span:nth-child(4) { background: linear-gradient(90deg, #22d3ee, #34d399); animation-delay: .3s; }
    span:nth-child(5) { background: linear-gradient(90deg, #7c5cff, #f472b6); animation-delay: .4s; }
  }
  @keyframes bar-in { from { transform: scaleX(0); } }
  .crm-row { display: grid; grid-template-columns: 24px 1fr 46px; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
    em { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #22d3ee, #7c5cff); }
    span { height: 8px; border-radius: 4px; background: var(--surface-2); }
    b { height: 16px; border-radius: 8px; }
    .ok { background: #34d39966; } .warn { background: #fbbf2466; } .due { background: #f4727266; }
  }
  .phones { position: relative; width: 70%; height: 100%; }
  .phone {
    position: absolute; width: 46%; aspect-ratio: 9 / 19; border-radius: 22px; padding: 6px; background: #111; border: 1px solid var(--border-strong); box-shadow: var(--shadow);
    left: 8%; top: 4%; rotate: -8deg; transition: rotate .6s var(--ease), translate .6s var(--ease);
    &.phone--front { left: auto; right: 8%; top: 12%; rotate: 6deg; }
    .project:hover & { rotate: -12deg; translate: -10px 0; }
    .project:hover &.phone--front { rotate: 10deg; translate: 10px -6px; }
  }
  .phone__screen { width: 100%; height: 100%; border-radius: 17px; background: linear-gradient(180deg, #1b1d33, #0f1022); padding: 16% 10%; display: grid; align-content: start; gap: 8px;
    i { height: 28px; border-radius: 8px; background: rgb(255 255 255 / .08); }
    b { height: 60px; border-radius: 10px; background: linear-gradient(135deg, #f472b6, #7c5cff); }
  }
  @media (max-width: 900px) {
    .project, .project.project--rev { grid-template-columns: 1fr; .project__media { order: 0; } }
  }
  @media (max-width: 520px) { .feature-list { grid-template-columns: 1fr; } }

  /* STATS */
  .stats { padding-block: 3rem; border-block: 1px solid var(--border); background: color-mix(in oklab, var(--bg-2) 55%, transparent); }
  .stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
  .stat { display: grid; gap: .3rem; text-align: center; }
  .stat__num { font-family: var(--f-display); font-size: clamp(2.4rem, 1.6rem + 3vw, 3.8rem); font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; padding-inline: .08em; }
  .stat__label { color: var(--text-2); font-size: .92rem; }
  @media (max-width: 760px) { .stats__grid { grid-template-columns: 1fr 1fr; } }

  /* GROWTH */
  .growth { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
  .g-card {
    padding: 2rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 1.2rem;
    transition: transform .5s var(--ease), border-color .3s;
    &:hover { transform: translateY(-6px); border-color: var(--border-strong); }
    ul { display: grid; gap: .55rem; color: var(--text-2); font-size: .95rem; }
    li { display: flex; gap: .6rem; }
    li::before { content: "✓"; color: var(--c-green); font-weight: 700; }
    &.g-card--ai {
      background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--grad-ai) border-box; border: 1px solid transparent;
      box-shadow: 0 30px 80px -30px color-mix(in oklab, var(--c-violet) 60%, transparent);
    }
  }
  .g-card__head { display: flex; align-items: center; gap: .9rem; h3 { font-size: 1.3rem; } }
  .g-num { font-family: var(--f-mono); font-size: .8rem; color: var(--c-cyan); padding: .3rem .55rem; border-radius: 8px; border: 1px solid var(--border-strong); }
  .serp, .ai-answer, .spark-chart { margin-top: auto; border-radius: 14px; background: color-mix(in oklab, var(--bg) 60%, transparent); border: 1px solid var(--border); padding: 1rem; }
  .serp { display: grid; gap: .6rem; }
  .serp__bar { padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--border-strong); font-size: .78rem; color: var(--text-2); }
  .serp__res { display: grid; grid-template-columns: 16px 1fr; gap: 4px 8px; padding: .5rem; border-radius: 10px;
    i { grid-row: span 2; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-2); }
    b { height: 8px; width: 70%; border-radius: 4px; background: #82aaff88; }
    span { height: 6px; border-radius: 4px; background: var(--surface-2); }
    &.serp__res--hl { background: color-mix(in oklab, var(--c-green) 10%, transparent); border: 1px solid color-mix(in oklab, var(--c-green) 35%, transparent); i { background: var(--grad); } }
  }
  .ai-answer { display: grid; gap: .45rem; font-size: .8rem;
    p { font-family: var(--f-mono); color: var(--text-2); }
    > span { height: 6px; border-radius: 4px; background: var(--surface-2); }
    > span.short { width: 60%; }
    em { font-style: normal; font-size: .75rem; color: var(--text-3); b { color: var(--c-cyan); font-weight: 500; } }
  }
  .spark-chart svg { width: 100%; height: 70px; }
  .spark-line { stroke-dasharray: 400; stroke-dashoffset: 400; transition: stroke-dashoffset 2s var(--ease); }
  .is-visible .spark-line, .spark-chart.is-visible .spark-line { stroke-dashoffset: 0; }
  @media (max-width: 980px) { .growth { grid-template-columns: 1fr; max-width: 560px; } }

  /* PROCESS */
  .process {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; position: relative; counter-reset: s;
    &::before { content: ""; position: absolute; top: 27px; left: 5%; right: 5%; height: 2px; background: linear-gradient(90deg, transparent, var(--c-violet), var(--c-cyan), transparent); opacity: .5; }
  }
  .step {
    position: relative; text-align: center; padding: 0 .5rem;
    h3 { font-size: 1.2rem; margin-block: 1.1rem .5rem; }
    p { color: var(--text-2); font-size: .92rem; }
  }
  .step__n {
    width: 56px; height: 56px; margin-inline: auto; border-radius: 50%; display: grid; place-items: center; position: relative;
    font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; background: var(--bg); border: 1px solid var(--border-strong);
    &::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px dashed color-mix(in oklab, var(--c-violet) 60%, transparent); animation: spin 14s linear infinite; }
  }
  .step:hover .step__n { background: var(--grad); color: #fff; border-color: transparent; }
  @keyframes spin { to { rotate: 360deg; } }
  @media (max-width: 900px) {
    .process { grid-template-columns: 1fr; gap: 1.8rem; &::before { top: 0; bottom: 0; left: 27px; right: auto; width: 2px; height: auto; background: linear-gradient(var(--c-violet), var(--c-cyan)); } }
    .step { display: grid; grid-template-columns: 56px 1fr; gap: 0 1.2rem; text-align: left; padding: 0;
      .step__n { grid-row: span 2; margin: 0; }
      h3 { margin: .3rem 0 .3rem; }
    }
  }

  /* FAQ */
  .faq { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 5vw, 5rem); align-items: start;
    .section__head { position: sticky; top: 110px; }
  }
  .faq__list { display: grid; gap: .8rem; }
  details {
    border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); transition: border-color .3s, background .3s;
    &[open] { border-color: color-mix(in oklab, var(--c-violet) 45%, transparent); background: var(--surface-2); }
    summary {
      list-style: none; cursor: pointer; padding: 1.2rem 1.4rem; font-weight: 600; display: flex; justify-content: space-between; gap: 1rem; align-items: center;
      &::-webkit-details-marker { display: none; }
      &::after { content: "+"; flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-strong); font-weight: 400; font-size: 1.2rem; transition: rotate .3s var(--ease), background .3s; }
    }
    &[open] summary::after { rotate: 45deg; background: var(--grad); color: #fff; border-color: transparent; }
    p { padding: 0 1.4rem 1.3rem; color: var(--text-2); }
  }
  /* smooth open/close where supported */
  @supports (interpolate-size: allow-keywords) {
    :root { interpolate-size: allow-keywords; }
    details::details-content { block-size: 0; overflow: clip; transition: block-size .4s var(--ease), content-visibility .4s allow-discrete; }
    details[open]::details-content { block-size: auto; }
  }
  @media (max-width: 900px) { .faq { grid-template-columns: 1fr; .section__head { position: static; } } }

  /* CTA / CONTACT */
  .cta {
    display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); padding: clamp(1.5rem, 5vw, 4rem);
    border-radius: calc(var(--r-lg) + 8px); position: relative; overflow: hidden; isolation: isolate;
    background:
      radial-gradient(700px circle at 0% 0%, color-mix(in oklab, var(--c-violet) 28%, transparent), transparent 55%),
      radial-gradient(600px circle at 100% 100%, color-mix(in oklab, var(--c-cyan) 18%, transparent), transparent 55%),
      var(--bg-2);
    border: 1px solid var(--border-strong);
  }
  .contact-info { display: grid; gap: .9rem; margin-top: 2rem;
    li { display: flex; align-items: center; gap: .8rem; color: var(--text-2); }
    svg { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--c-cyan); flex: none; }
    a:hover { color: var(--text); }
    address { font-style: normal; line-height: 1.5; }
  }
  .form { display: grid; gap: 1rem; align-content: start; }
  .form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .field { display: grid; gap: .4rem; border: 0;
    > span, legend { font-size: .82rem; font-weight: 500; color: var(--text-2); }
    input, textarea {
      width: 100%; padding: .85rem 1rem; border-radius: 12px; background: color-mix(in oklab, var(--bg) 55%, transparent);
      border: 1px solid var(--border-strong); outline: none; transition: border-color .2s, box-shadow .2s; resize: vertical;
    }
    input::placeholder, textarea::placeholder { color: var(--text-3); }
    input:focus, textarea:focus { border-color: var(--c-violet); box-shadow: 0 0 0 4px color-mix(in oklab, var(--c-violet) 22%, transparent); }
    input.is-invalid, textarea.is-invalid { border-color: #f47272; }
  }
  .chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .4rem;
    label { cursor: pointer; }
    input { position: absolute; opacity: 0; pointer-events: none; }
    span { display: inline-block; padding: .45rem .85rem; border-radius: 999px; font-size: .85rem; border: 1px solid var(--border-strong); color: var(--text-2); transition: all .2s; }
    label:hover span { border-color: var(--c-violet); color: var(--text); }
    input:checked + span { background: var(--grad); color: #fff; border-color: transparent; }
    input:focus-visible + span { outline: 2px solid var(--c-cyan); outline-offset: 2px; }
  }
  .hp { position: absolute; left: -9999px; }
  .form__status { font-size: .9rem; min-height: 1.4em; text-align: center;
    &.ok { color: var(--c-green); } &.err { color: #f47272; }
  }
  .form:has(:user-invalid) .btn--primary { filter: saturate(.7); }
  @media (max-width: 900px) { .cta { grid-template-columns: 1fr; } }
  @media (max-width: 520px) { .form__row { grid-template-columns: 1fr; } }

  /* FOOTER */
  .footer { border-top: 1px solid var(--border); padding-block: 4rem 2rem; margin-top: 2rem; }
  .footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem;
    h4 { font-size: .85rem; font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); margin-bottom: 1rem; font-weight: 500; }
    ul { display: grid; gap: .55rem; }
    ul a { color: var(--text-2); font-size: .95rem; transition: color .2s; }
    ul a:hover { color: var(--text); }
  }
  .footer__brand p { color: var(--text-2); margin-top: 1rem; max-width: 340px; font-size: .95rem; }
  .footer__bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--text-3); font-size: .88rem;
    .to-top:hover { color: var(--text); }
  }
  @media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr 1fr; .footer__brand { grid-column: 1 / -1; } } }
}

/* ---------- utilities: reveal on scroll ---------- */
@layer utilities {
  .reveal { opacity: 0; translate: 0 28px; transition: opacity .9s var(--ease), translate .9s var(--ease); transition-delay: var(--d, 0s); }
  .reveal.is-visible { opacity: 1; translate: 0 0; }
  .no-js .reveal { opacity: 1; translate: none; }
  @media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; translate: none; } }
}

/* view transition for theme switch */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: reveal-theme .7s var(--ease); }
@keyframes reveal-theme { from { clip-path: circle(0 at var(--vt-x, 90%) var(--vt-y, 5%)); } to { clip-path: circle(150% at var(--vt-x, 90%) var(--vt-y, 5%)); } }
