:root{
    color-scheme: dark;
    --bg: #020203;
    --bg-2: #070708;
    --panel: rgba(255,255,255,0.035);
    --panel-solid: #141416;
    --line: rgba(232,232,236,0.10);
    --accent: #E9A23D;
    --accent-soft: rgba(233,162,61,0.14);
    --mint: #B9BAC2;
    --amber: #F4C877;
    --red: #86828C;
    --ink: #EDEDEF;
    --muted: #9C9CA3;
    --font-display: 'Bricolage Grotesque', sans-serif;
    --font-body: 'IBM Plex Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 14px;

    /* theme helpers: channel triplets let every tint flip with the theme */
    --bg-rgb: 2,2,3;
    --bg2-rgb: 7,7,8;
    --fg-rgb: 255,255,255;
    --ink-rgb: 237,237,239;
    --accent-rgb: 233,162,61;
    --amber-rgb: 244,200,119;
    --mint-rgb: 185,186,194;
    --red-rgb: 134,130,140;
    --muted-2: #7C7C84;
    --knock: #0b0a09;
    --knock-on: #241a0b;
    --card-solid: #0b0a09;
    --thumb: #0b0b0d;
    --code-bg: rgba(0,0,0,0.28);
    --vignette: rgba(0,0,0,0.7);
    --shadow-card: 0 30px 60px -30px rgba(0,0,0,0.55);
    --shadow-card-2: 0 30px 60px -30px rgba(0,0,0,0.6);
    --grain-opacity: 0.5;
  }

  /* LIGHT THEME: */
  :root[data-theme="light"]{
    color-scheme: light;
    --bg: #E7E0CE;
    --bg-2: #DDD6C5;
    --panel: rgba(42,38,32,0.03);
    --panel-solid: #EFE9D9;
    --line: rgba(42,38,32,0.15);
    --accent: #8E4E08;
    --accent-soft: rgba(142,78,8,0.11);
    --mint: #6B675C;
    --amber: #A85A0A;
    --red: #8C8678;
    --ink: #2A2620;
    --muted: #5D5649;

    --bg-rgb: 231,224,206;
    --bg2-rgb: 221,214,197;
    --fg-rgb: 42,38,32;
    --ink-rgb: 42,38,32;
    --accent-rgb: 142,78,8;
    --amber-rgb: 168,90,10;
    --mint-rgb: 107,103,92;
    --red-rgb: 140,134,120;
    --muted-2: #675F52;
    --knock: #E1DAC9;
    --knock-on: #EBD9B8;
    --card-solid: #EFE9D9;
    --thumb: #EFE9D9;
    --code-bg: rgba(42,38,32,0.06);
    --vignette: rgba(110,84,36,0.17);
    --shadow-card: 0 30px 60px -34px rgba(70,50,16,0.32);
    --shadow-card-2: 0 30px 60px -34px rgba(70,50,16,0.34);
    --grain-opacity: 0.35;
  }

  *{box-sizing:border-box; margin:0; padding:0;}
  html{scroll-behavior:smooth; scrollbar-color: var(--accent) var(--bg-2); scrollbar-width:thin;}
  body{
    background: var(--bg);
    color:var(--ink);
    font-family:var(--font-body);
    line-height:1.65;
    overflow-x:hidden;
    -webkit-font-smoothing:antialiased;
  }
  body::before{
    content:"";
    position:fixed; inset:0; z-index:0; pointer-events:none;
    background:
      radial-gradient(ellipse 560px 420px at 4% 80%, rgba(var(--ink-rgb),0.03), transparent 65%),
      radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, var(--vignette) 100%);
  }
  body::after{
    content:"";
    position:fixed; inset:0; z-index:0; pointer-events:none; opacity:var(--grain-opacity);
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  }
  ::-webkit-scrollbar{width:9px;}
  ::-webkit-scrollbar-track{background:var(--bg-2);}
  ::-webkit-scrollbar-thumb{background:var(--accent); border-radius:10px;}

  a{color:inherit; text-decoration:none;}
  ul{list-style:none;}
  img,svg{display:block; max-width:100%;}
  button{font-family:inherit; cursor:pointer;}

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

  .container{max-width:1180px; margin:0 auto; padding:0 24px; position:relative; z-index:1;}

  h1,h2,h3,h4{font-family:var(--font-display); font-weight:700; color:var(--ink); letter-spacing:-0.01em;}
  .accent-text{color:var(--amber);}

  .section-tag{
    display:inline-flex; align-items:center; gap:9px;
    font-family:var(--font-body); font-weight:600; font-size:0.95rem;
    color:var(--muted); margin-bottom:14px;
  }
  .section-tag .tag-phase{
    position:relative; width:13px; height:13px; border-radius:50%;
    background:var(--amber); flex:none; --p:50%;
  }
  .section-tag .tag-phase::before{
    content:""; position:absolute; inset:0; border-radius:50%;
    background:var(--bg); clip-path:inset(0 0 0 var(--p));
  }
  .section-tag .tag-phase::after{
    content:""; position:absolute; inset:0; border-radius:50%;
    box-shadow:0 0 7px 1px rgba(var(--amber-rgb),0.45);
  }
  .section-title{font-size:clamp(1.9rem, 3.6vw, 3rem); letter-spacing:-0.015em; line-height:1.14; margin-bottom:8px;}

  section{scroll-margin-top:88px; position:relative; z-index:1;}

  /* BUTTONS */
  .btn{
    display:inline-flex; align-items:center; justify-content:center; gap:8px;
    font-family:var(--font-body); font-weight:600; font-size:0.95rem;
    padding:14px 28px; border-radius:999px; border:1px solid transparent;
    transition:transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    white-space:nowrap;
  }
  .btn-primary{background:transparent; border-color:var(--accent); color:var(--accent);}
  .btn-primary:hover{background:var(--accent-soft); box-shadow:0 0 28px rgba(var(--accent-rgb),0.28); transform:translateY(-2px);}
  .btn-ghost{background:transparent; border-color:var(--line); color:var(--ink);}
  .btn-ghost:hover{border-color:var(--accent); background:var(--accent-soft); transform:translateY(-3px);}

  .btn-link{
    display:inline-flex; align-items:center; gap:8px;
    padding:14px 4px; font-weight:600; color:var(--ink);
    border-bottom:1px solid var(--accent); border-radius:0;
    transition:border-color 0.2s ease, gap 0.2s ease, color 0.2s ease;
  }
  .btn-link::after{content:"↗"; font-size:0.85em; color:var(--muted); transition:transform 0.2s ease, color 0.2s ease;}
  .btn-link:hover{border-color:var(--amber); color:var(--amber); gap:11px;}
  .btn-link:hover::after{color:var(--amber); transform:translate(1px,-1px);}
  .btn-small{padding:9px 18px; font-size:0.82rem;}
  .btn-large{padding:17px 34px; font-size:1.02rem;}
  .btn-outline-dashed{
    border:1px dashed var(--line); color:var(--muted);
    font-family:var(--font-mono); font-size:0.78rem; padding:10px 16px; border-radius:8px;
    transition:transform 0.3s cubic-bezier(0.16,1,0.3,1), border-color 0.2s ease, color 0.2s ease;
  }
  .btn-outline-dashed:hover{border-color:var(--amber); color:var(--amber); border-style:solid;}

  .chip{
    font-family:var(--font-mono); font-size:0.76rem; color:var(--muted);
    border:1px solid var(--line); padding:6px 12px; border-radius:7px;
    background:rgba(var(--fg-rgb),0.02); white-space:nowrap;
  }
  .chip-row{display:flex; flex-wrap:wrap; gap:8px; margin-top:14px;}

  /* PRELOADER */
  #preloader{
    position:fixed; inset:0; z-index:999; background:var(--bg);
    display:flex; align-items:center; justify-content:center;
    animation:preloaderHide 0.6s ease forwards; animation-delay:1.6s;
  }
  #preloader.done{animation-duration:0.5s; animation-delay:0s;}
  @keyframes preloaderHide{ to{opacity:0; visibility:hidden; pointer-events:none;} }
  @media (prefers-reduced-motion:reduce){ #preloader{animation-duration:0.01s; animation-delay:0s;} }
  .preloader-inner{text-align:center;}
  .preloader-moon{
    position:relative; width:54px; height:54px; border-radius:50%;
    background:var(--ink); margin:0 auto 16px; overflow:hidden;
    box-shadow:0 0 24px rgba(var(--accent-rgb),0.35);
  }
  .preloader-moon::before{
    content:""; position:absolute; inset:0; border-radius:50%;
    background:var(--bg); transform:translateX(0%);
    animation:moonFill 1.3s cubic-bezier(.65,0,.35,1) infinite;
  }
  @keyframes moonFill{
    0%{transform:translateX(0%);}
    45%,55%{transform:translateX(100%);}
    100%{transform:translateX(0%);}
  }
  .preloader-word{font-family:var(--font-mono); font-size:0.72rem; letter-spacing:0.1em; color:var(--muted);}

  /* CURSOR */
  .has-custom-cursor, .has-custom-cursor *{cursor:none;}
  #cursor{display:none; opacity:1; transition:opacity 0.25s ease;}
  #cursor.is-hidden{opacity:0;}
  .cursor-dot, .cursor-ring, .cursor-label{
    position:fixed; top:0; left:0; pointer-events:none; z-index:200; will-change:transform;
  }

  .cursor-dot{
    width:5px; height:5px; border-radius:50%; background:var(--accent); opacity:0.9;
    transition:opacity 0.2s ease, width 0.2s ease, height 0.2s ease, background 0.2s ease;
  }

  .cursor-ring{
    width:16px; height:16px; border-radius:50%;
    border:1px solid var(--accent-soft); background:transparent;
    transition:
      width 0.25s cubic-bezier(0.2,0.8,0.2,1),
      height 0.25s cubic-bezier(0.2,0.8,0.2,1),
      border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease;
  }

  .cursor-label{
    font-family:var(--font-mono); font-size:0.62rem; font-weight:600; letter-spacing:0.04em;
    color:var(--bg); background:var(--accent); padding:7px 13px; border-radius:999px;
    white-space:nowrap; opacity:0;
    box-shadow:0 8px 20px rgba(var(--amber-rgb),0.08);
    transition:opacity 0.18s ease;
  }

  .cursor-dot[data-state="lock"]{width:6px; height:6px;}
  .cursor-ring[data-state="lock"]{
    width:11px; height:11px; border-color:var(--amber); background:var(--accent-soft);
    box-shadow:0 0 10px 1px rgba(var(--amber-rgb),0.08);
  }

  .cursor-dot[data-state="focus"]{opacity:0.5;}
  .cursor-ring[data-state="focus"]{
    width:30px; height:30px; border-color:var(--amber); background:var(--accent-soft);
    box-shadow:0 0 16px 2px rgba(var(--amber-rgb),0.08);
  }

  .cursor-dot[data-state="hero"]{opacity:0;}
  .cursor-ring[data-state="hero"]{
    width:26px; height:26px; border-color:transparent; border-radius:50%;
    background:var(--ink); box-shadow:0 0 18px 3px rgba(var(--amber-rgb),0.08);
    opacity:0.6; overflow:hidden;
  }
  .cursor-ring[data-state="hero"]::before{
    content:""; position:absolute; top:-15%; left:-32%; width:100%; height:100%;
    border-radius:50%; background:var(--bg);
  }

  .cursor-dot[data-state="pill"], .cursor-ring[data-state="pill"]{opacity:0;}
  .cursor-label[data-state="pill"]{opacity:1;}

  /* NAV */
  #site-nav{
    position:fixed; top:0; left:0; right:0; z-index:100;
    background:transparent; border-bottom:1px solid transparent;
    transition:background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
  }
  #site-nav.scrolled{background:rgba(var(--bg-rgb),0.75); backdrop-filter:blur(14px); border-color:var(--line);}
  .nav-inner{display:flex; align-items:center; justify-content:space-between; max-width:1600px; padding:20px clamp(24px,5.5vw,96px);}
  .logo{display:flex; align-items:center; gap:13px; font-size:1.02rem; font-weight:700; letter-spacing:0.28em; text-transform:none;}
  
  .nav-links{display:flex; gap:30px;}
  .nav-link{font-size:0.9rem; color:var(--muted); font-weight:500; position:relative; padding:4px 0; transition:color 0.2s ease;}
  .nav-link:hover, .nav-link.active{color:var(--ink);}
  .nav-link.active::after{
    content:""; position:absolute; bottom:-4px; left:0; right:0; height:2px;
    background:var(--accent); border-radius:2px;
  }
  .nav-cta{display:inline-flex;}
  .hamburger{display:none; flex-direction:column; gap:5px; background:none; border:none; padding:6px; z-index:110;}
  .hamburger span{width:22px; height:2px; background:var(--ink); border-radius:2px; transition:transform 0.3s ease, opacity 0.3s ease;}
  .hamburger.active span:nth-child(1){transform:translateY(7px) rotate(45deg);}
  .hamburger.active span:nth-child(2){opacity:0;}
  .hamburger.active span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}
  .mobile-menu{
    display:none; flex-direction:column; gap:2px; background:rgba(var(--bg-rgb),0.98); backdrop-filter:blur(14px);
    padding:0 24px; max-height:0; overflow:hidden; visibility:hidden;
    transition:max-height 0.35s ease, padding 0.35s ease, visibility 0s linear 0.35s;
  }
  .mobile-menu.open{
    max-height:min(400px, calc(100vh - 70px)); max-height:min(400px, calc(100svh - 70px));
    padding:10px 24px 20px; overflow-y:auto; visibility:visible;
    box-shadow:inset 0 1px 0 var(--line);
    transition:max-height 0.35s ease, padding 0.35s ease, visibility 0s;
  }
  .mobile-menu .nav-link{padding:13px 0; border-bottom:1px solid var(--line); font-size:1rem;}

  @media (max-width:860px){
    .nav-links, .nav-cta{display:none;}
    .hamburger{display:flex; padding:13px; margin-right:-13px;}
    .mobile-menu{display:flex;}
    .nav-inner{padding-top:12px; padding-bottom:12px;}
  }

  /* HERO */
  .hero{position:relative; min-height:100vh; min-height:100svh; display:flex; align-items:center; overflow:hidden;}
  .hero::before{
    content:""; position:absolute; inset:0; z-index:0; pointer-events:none;
    background:radial-gradient(ellipse 1000px 760px at 66% -4%, rgba(var(--accent-rgb),0.09), transparent 58%);
    -webkit-mask-image:linear-gradient(to bottom, #000 55%, transparent 100%);
    mask-image:linear-gradient(to bottom, #000 55%, transparent 100%);
  }
  #hero-canvas{position:absolute; inset:0; width:100%; height:100%; z-index:1;}
  .hero-content{position:relative; z-index:2; width:100%; padding:130px clamp(24px,5.5vw,96px) 110px;}
  .hero-content > *{max-width:min(38rem,100%);}
  .hero-role{display:flex; align-items:center; gap:11px; font-size:0.92rem; color:var(--accent); margin-bottom:24px;}
  .role-crescent{width:11px; height:11px; border-radius:50%; box-shadow:inset -3.5px -1px 0 0 var(--accent);}
  .hero-title{font-size:clamp(2.3rem,4.4vw,4.2rem); line-height:1.1; letter-spacing:-0.015em; margin-bottom:26px;}
  .hero-sub{font-size:1.2rem; line-height:1.6; color:var(--muted); max-width:30em; margin-bottom:38px;}
  .hero-actions{display:flex; gap:22px; align-items:center; flex-wrap:wrap;}
  .hero-rail, .hero-place{position:absolute; right:clamp(24px,5.5vw,96px); z-index:2; padding-left:22px; border-left:1px solid var(--line);}
  .hero-rail{top:30%; display:flex; flex-direction:column; gap:13px;}
  .hero-rail a{font-size:0.82rem; letter-spacing:0.14em; color:var(--muted); transition:color 0.2s ease;}
  .hero-rail a:hover{color:var(--accent);}
  .hero-place{top:60%; display:flex; flex-direction:column; gap:7px; font-size:0.8rem; color:var(--muted);}
  .place-row{display:flex; align-items:center; gap:9px;}
  .place-time{font-family:var(--font-mono); font-size:0.76rem; letter-spacing:0.04em; color:var(--ink);}
  .pulse-dot{width:7px; height:7px; border-radius:50%; background:var(--mint); box-shadow:0 0 8px var(--mint); animation:pulse 2s infinite;}
  @keyframes pulse{0%,100%{opacity:1;} 50%{opacity:0.3;}}
  .scroll-indicator{
    position:absolute; bottom:34px; left:clamp(24px,5.5vw,96px); z-index:2;
    display:flex; align-items:flex-end; gap:14px; font-size:0.74rem; letter-spacing:0.16em; color:var(--muted);
  }
  .scroll-indicator span{width:1px; height:46px; background:linear-gradient(var(--accent), transparent); animation:scrollLine 1.8s ease-in-out infinite;}
  @keyframes scrollLine{0%{opacity:0.2;} 50%{opacity:1;} 100%{opacity:0.2;}}
  @media (max-width:900px){
    .hero-rail, .hero-place{display:none;}
    .hero{align-items:flex-end;}
    .hero-content{padding-bottom:96px;}
  }

  /* STATS */
  .stats-bar{padding:70px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); background:rgba(var(--fg-rgb),0.015);}
  .stats-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:30px; text-align:center;}
  .stat-num, .stat-num-static{font-family:var(--font-display); font-size:2.4rem; color:var(--ink); font-weight:700;}
  .stat-label{font-size:0.88rem; color:var(--muted); margin-top:8px;}
  @media (max-width:700px){ .stats-grid{grid-template-columns:1fr; gap:36px;} }

  /* ABOUT */
  .about-section{padding:120px 0;}
  .about-grid{display:grid; grid-template-columns:0.9fr 1.1fr; gap:60px; align-items:start;}
  .about-text{color:var(--muted); font-size:1.03rem; margin-bottom:16px;}
  @media (max-width:820px){ .about-grid{grid-template-columns:1fr; gap:24px;} }

  /* CONSTELLATION */
  .portfolio-constellation{
    position:absolute; top:0; right:0; width:42%; height:100%;
    pointer-events:none; z-index:1; opacity:0.9; transition:opacity 0.6s ease;
  }
  .portfolio-constellation.is-empty{display:none;}
  .constellation-label{
    position:absolute; top:30px; right:35px; display:flex; align-items:center; gap:8px;
    font-family:var(--font-mono); font-size:9px; letter-spacing:0.16em;
    color:rgba(var(--fg-rgb),0.28); white-space:nowrap;
  }
  .constellation-label-dot{
    width:4px; height:4px; border-radius:50%;
    background:rgba(var(--amber-rgb),0.75); box-shadow:0 0 8px rgba(var(--amber-rgb),0.35);
  }
  .constellation-canvas{position:absolute; top:70px; right:0; width:100%; height:calc(100% - 130px);}


  .constellation-layer{position:absolute; inset:0; transition:transform 0.2s ease-out;}
  .constellation-layer--far{
    -webkit-mask-image:linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
    mask-image:linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
  }

  /* lines */
  .constellation-lines{position:absolute; inset:0; width:100%; height:100%; overflow:visible;}
  .pc-stop-a{stop-color:var(--accent); stop-opacity:0.55;}
  .pc-stop-b{stop-color:var(--accent); stop-opacity:0.05;}
  .constellation-line{
    fill:none; stroke:url(#pc-line-grad); stroke-width:1;
    vector-effect:non-scaling-stroke; opacity:0.7;
  }

  .constellation-line.is-drawing{transition:stroke-dashoffset 1.4s cubic-bezier(.65,0,.35,1);}
  .constellation-line.is-flowing{stroke-dasharray:3 9 !important; animation:constellation-dash 18s linear infinite;}


  .constellation-glow-svg{will-change:transform;}
  .constellation-glow{
    fill:none; stroke:url(#pc-line-grad); stroke-width:1;
    vector-effect:non-scaling-stroke; opacity:0.7; filter:url(#pc-glow-only);
  }
  .constellation-glow.is-drawing{transition:stroke-dashoffset 1.4s cubic-bezier(.65,0,.35,1);}
  .constellation-glow.is-flowing{stroke-dasharray:none !important; opacity:0.175;}

  .portfolio-constellation.is-offscreen .constellation-line,
  .portfolio-constellation.is-offscreen .constellation-star,
  .portfolio-constellation.is-offscreen .node-ring,
  .portfolio-constellation.is-offscreen .node-halo{animation-play-state:paused;}

  .constellation-line-secondary{stroke:rgba(var(--fg-rgb),0.07); stroke-dasharray:2 12; animation-duration:25s;}
  @keyframes constellation-dash{from{stroke-dashoffset:0;} to{stroke-dashoffset:-120;}}

  /* nodes */
  .constellation-node{
    position:absolute; width:12px; height:12px; pointer-events:auto;
    transform:translate(-50%,-50%);
    transition:transform 0.5s cubic-bezier(.2,.8,.2,1), opacity 0.5s ease;
  }

  .node-core{
    position:absolute; left:50%; top:50%; width:5px; height:5px;
    transform:translate(-50%,-50%); border-radius:50%;
    background:var(--amber); box-shadow:0 0 8px rgba(var(--amber-rgb),0.08);
    transition:width 0.35s ease, height 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
  }
  .node-ring{
    position:absolute; left:50%; top:50%; width:14px; height:14px;
    transform:translate(-50%,-50%); border:1px solid var(--amber); border-radius:50%;
    transition:width 0.4s ease, height 0.4s ease, border-color 0.4s ease;
  }
  .node-halo{
    position:absolute; left:50%; top:50%; width:30px; height:30px;
    transform:translate(-50%,-50%); border-radius:50%;
    background:radial-gradient(circle, var(--accent-soft) 0%, transparent 72%);
    filter:blur(2px); opacity:0; transition:opacity 0.4s ease;
  }
  .node-number{
    position:absolute; left:16px; top:-4px;
    font-family:var(--font-mono); font-size:8px; letter-spacing:0.1em;
    color:rgba(var(--fg-rgb),0.16); transition:color 0.4s ease;
  }

  .constellation-node.is-active .node-halo{opacity:0.5; animation:node-pulse 2.4s ease-in-out infinite;}
  .constellation-node.is-active .node-core{
    width:7px; height:7px; background:var(--amber);
    box-shadow:0 0 7px rgba(var(--amber-rgb),0.65), 0 0 18px rgba(var(--amber-rgb),0.2);
  }
  .constellation-node.is-active .node-ring{
    width:22px; height:22px; border-color:rgba(var(--amber-rgb),0.38);
    animation:node-pulse 2.4s ease-in-out infinite;
  }
  .constellation-node.is-active .node-number{color:rgba(var(--amber-rgb),0.7);}
  @keyframes node-pulse{
    0%, 100%{opacity:0.35; transform:translate(-50%,-50%) scale(0.9);}
    50%{opacity:1; transform:translate(-50%,-50%) scale(1.15);}
  }

  .constellation-node.is-hovered{transform:translate(-50%,-50%) scale(1.25);}
  .constellation-node.is-hovered .node-core{background:rgba(var(--amber-rgb),0.75); box-shadow:0 0 10px rgba(var(--amber-rgb),0.65), 0 0 25px rgba(var(--amber-rgb),0.2);}

  /* ambient stars */
  .constellation-star{
    position:absolute; width:2px; height:2px; border-radius:50%;
    background:rgba(var(--fg-rgb),0.3); opacity:0.35;
    animation:star-flicker 4s ease-in-out infinite;
  }
  @keyframes star-flicker{
    0%, 100%{opacity:0.15; transform:scale(0.8);}
    50%{opacity:0.55; transform:scale(1.4);}
  }

  /* status readout */
  .constellation-status{
    position:absolute; right:35px; bottom:25px; display:flex; align-items:center; gap:8px;
    font-family:var(--font-mono); font-size:8px; letter-spacing:0.12em;
    color:rgba(var(--fg-rgb),0.2);
  }
  .status-line{width:18px; height:1px; background:rgba(var(--amber-rgb),0.35);}
  #constellation-status-text.is-online{color:var(--accent);}

  @media (max-width:900px){ .portfolio-constellation{display:none;} }

  @media (prefers-reduced-motion:reduce){
    .constellation-line,
    .constellation-node.is-active .node-ring,
    .constellation-node.is-active .node-halo,
    .constellation-star{animation:none;}
    .constellation-layer{transition:none;}
  }

  /* INDEX LIST (skills, services, work) */
  .index-list{position:relative; margin-top:40px;}
  .index-line{position:absolute; left:14px; top:0; bottom:0; width:1px; background:var(--line);}

  .index-row{position:relative; display:flex; gap:26px; padding:28px 0;}
  .index-row:not(:first-child){border-top:1px solid rgba(var(--fg-rgb),0.05);}

  .index-node{flex:0 0 30px; display:flex; justify-content:center; padding-top:9px;}
  .index-node::before{
    content:""; width:8px; height:8px; border-radius:50%;
    background:var(--bg); border:1.5px solid var(--line);
    transition:background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  }
  .index-row:hover .index-node::before{
    background:var(--accent); border-color:var(--accent); box-shadow:0 0 0 4px rgba(var(--accent-rgb),0.14);
  }

  .index-body{flex:1; min-width:0;}
  .index-head{display:flex; align-items:baseline; flex-wrap:wrap; gap:12px; margin-bottom:6px;}
  .index-num{display:none;}
  .index-title{font-family:var(--font-display); font-size:1.05rem; font-weight:700; color:var(--ink);}

  /* SKILLS */
  .skills-section{padding:0 0 100px;}

  /* SERVICES */
  .services-section{padding:0 0 100px;}
  .service-icon-inline{
    width:17px; height:17px; color:var(--accent); flex-shrink:0; display:flex; align-items:center;
  }
  .service-icon-inline svg{width:100%; height:100%; stroke:currentColor; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;}
  .service-desc{color:var(--muted); font-size:0.93rem; max-width:64ch;}

  /* WORK */
  .work-section{position:relative; padding:0 0 100px;}
  .work-status{
    display:inline-block; font-family:var(--font-mono); font-size:0.66rem; letter-spacing:0.07em;
    color:var(--mint); border:1px solid rgba(var(--mint-rgb),0.35); padding:2px 9px; border-radius:999px;
  }
  .work-status-discontinued{
    display:inline-block; font-family:var(--font-mono); font-size:0.66rem; letter-spacing:0.07em;
    color:var(--red); border:1px solid rgba(var(--red-rgb),0.35); padding:2px 9px; border-radius:999px;
    text-decoration:line-through; text-decoration-color:rgba(var(--red-rgb),0.5);
  }
  .work-desc{color:var(--muted); font-size:0.93rem; margin:2px 0 4px; max-width:64ch;}
  .tech-row{
    display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin:10px 0 16px;
    font-family:var(--font-mono); font-size:0.78rem; color:var(--muted); letter-spacing:0.01em;
  }
  .tech-row span:not(:last-child)::after{content:"/"; margin-left:7px; color:var(--line);}

  /* SLOPSCAN REPORT */
  .slop-report{
    margin:14px 0 4px; max-width:520px; padding:14px 16px 12px;
    background:var(--panel); border:1px solid var(--line); border-radius:10px;
    font-family:var(--font-mono); font-size:0.76rem; color:var(--muted);
  }
  .slop-report-head{display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:12px;}
  .slop-report-head code{font-family:inherit; color:var(--ink); overflow-wrap:anywhere;}
  .slop-report-tag{
    font-size:0.62rem; letter-spacing:0.07em; text-transform:uppercase;
    border:1px dashed var(--line); padding:1px 8px; border-radius:999px;
  }
  .slop-score{display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 12px; margin-bottom:10px; letter-spacing:0.05em;}
  .slop-score strong{font-family:var(--font-display); font-size:1.5rem; line-height:1; color:var(--amber); letter-spacing:-0.01em;}
  .slop-conf{margin-left:auto;}
  .slop-bars{display:grid; gap:7px;}
  .slop-bars li{display:grid; grid-template-columns:78px 1fr 38px; align-items:center; gap:10px;}
  .slop-bars i{
    display:block; height:5px; border-radius:99px; position:relative; overflow:hidden;
    background:rgba(var(--fg-rgb),0.06);
  }
  .slop-bars i::after{
    content:""; position:absolute; inset:0; width:var(--v); border-radius:inherit;
    background:linear-gradient(90deg, var(--accent), var(--amber));
    transform-origin:left center; transition:transform 0.9s cubic-bezier(0.16,1,0.3,1) 0.25s;
  }
  .slop-bars em{font-style:normal; text-align:right; color:var(--ink);}
  .slop-note{margin-top:10px; font-size:0.68rem; opacity:0.8;}
  @media (prefers-reduced-motion:reduce){
    .slop-bars i::after{transition:none; transform:none !important;}
  }
  @media (max-width:600px){
    .slop-bars li{grid-template-columns:68px 1fr 34px;}
    .slop-conf{margin-left:0; flex-basis:100%;}
  }

  /* SAMPLE WIDGETS */
  .slop-report ol, .slop-report ul{list-style:none; margin:0; padding:0;}
  .sr-seg{display:flex; flex-wrap:wrap; gap:6px; margin:0 0 12px;}
  .sr-btn{
    font-family:inherit; font-size:0.72rem; color:var(--muted); background:transparent;
    border:1px dashed var(--line); border-radius:999px; padding:4px 12px; cursor:pointer;
    transition:border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  }
  .sr-btn:hover{border-color:var(--amber); color:var(--amber);}
  .sr-btn[aria-pressed="true"]{color:var(--amber); border:1px solid var(--accent); background:var(--accent-soft);}
  .sr-btn[disabled]{opacity:0.4; pointer-events:none;}
  .sr-btn-end{margin-left:auto;}
  .sr-kv{display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:7px 0; border-top:1px solid rgba(var(--fg-rgb),0.05);}
  .sr-kv em{font-style:normal; color:var(--ink); text-align:right;}
  .sr-kv-col{flex-direction:column; align-items:flex-start; gap:8px;}
  .sr-chips{display:flex; flex-wrap:wrap; gap:6px;}
  .sr-chips li{
    color:var(--ink); border:1px solid var(--line); border-radius:6px; padding:2px 9px;
    animation:sr-pop 0.35s cubic-bezier(0.16,1,0.3,1) both;
  }
  .sr-fa-head.is-placeholder{color:var(--muted); font-style:italic;}
  @keyframes sr-pop{from{opacity:0; transform:translateY(5px);}to{opacity:1; transform:none;}}

  /* Recurly */
  .sr-rows{display:grid; gap:8px; margin-bottom:12px;}
  .sr-rows li{display:grid; grid-template-columns:116px 48px 1fr 56px; align-items:center; gap:10px;}
  .sr-name{color:var(--ink);}
  .sr-due{color:var(--muted);}
  .sr-due.is-soon{color:var(--amber);}
  .sr-rows i{display:block; height:5px; border-radius:99px; background:rgba(var(--fg-rgb),0.06); position:relative; overflow:hidden;}
  .sr-rows i::after{content:""; position:absolute; inset:0; width:var(--v); border-radius:inherit; background:linear-gradient(90deg,var(--accent),var(--amber));}
  .sr-rows em{font-style:normal; text-align:right; color:var(--ink);}

  /* Aven */
  .sr-av-body{display:flex; align-items:center; gap:18px; margin-bottom:12px;}
  .sr-moon{
    position:relative; flex:none; width:52px; height:52px; border-radius:50%; overflow:hidden;
    background:radial-gradient(circle at 36% 30%, var(--amber), var(--accent) 72%);
    box-shadow:0 0 14px rgba(var(--accent-rgb),0.28);
    animation:sr-breathe 7s ease-in-out infinite;
  }
  .sr-moon::before{
    content:""; position:absolute; inset:0; border-radius:50%; background:var(--knock);
    animation:sr-wax 7s ease-in-out infinite;
  }
  @keyframes sr-breathe{0%,100%{transform:scale(0.82); box-shadow:0 0 8px rgba(var(--accent-rgb),0.18);}50%{transform:scale(1); box-shadow:0 0 26px rgba(var(--accent-rgb),0.4);}}
  @keyframes sr-wax{0%,100%{transform:translateX(58%);}50%{transform:translateX(14%);}}
  .sr-av-q{color:var(--ink); font-size:0.84rem; margin-bottom:2px;}
  .sr-av-q b{color:var(--amber); font-weight:600;}
  .sr-av-sub{min-height:1.4em; margin-bottom:10px;}
  .sr-av-copy .sr-seg{margin:0;}

  /* ThePurge */
  .sr-curve{width:100%; height:auto; margin-bottom:8px; overflow:visible;}
  .sr-curve-fill{fill:rgba(var(--accent-rgb),0.1);}
  .sr-curve-line{fill:none; stroke:var(--accent); stroke-width:1.5;}
  .sr-curve-base{stroke:var(--line); stroke-width:1;}
  .sr-mark{transition:transform 0.6s cubic-bezier(0.16,1,0.3,1);}
  .sr-mark line{stroke:var(--amber); stroke-width:1; stroke-dasharray:3 3;}
  .sr-mark circle{fill:var(--amber); filter:drop-shadow(0 0 4px rgba(var(--amber-rgb),0.7)); transition:cy 0.6s cubic-bezier(0.16,1,0.3,1);}
  .sr-log{display:grid; gap:3px; margin-top:2px; line-height:1.5;}
  .sr-tag{color:var(--accent);}
  .sr-log b{color:var(--ink); font-weight:500;}

  /* LwkMoon */
  .sr-lm-log{min-height:4.6em; margin-bottom:10px;}
  .sr-lm-moonrow{display:inline-flex; align-items:center; gap:8px;}
  .sr-kv:has(.sr-lm-moonrow){align-items:center;}
  .sr-lm-pm{width:14px; height:14px; flex:none;}
  .sr-lm-pm.is-waxing{transform:scaleX(-1);}
  .sr-lm-actions{margin:10px 0 0;}

  /* FrndlyMoon */
  .sr-phases{display:grid; grid-template-columns:repeat(5,1fr); gap:4px; margin-bottom:10px;}
  .sr-phase{
    width:100%; display:flex; flex-direction:column; align-items:center; gap:7px; padding:8px 2px;
    font-family:inherit; font-size:0.66rem; color:var(--muted); background:transparent;
    border:1px solid transparent; border-radius:8px; cursor:pointer;
    transition:border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  }
  .sr-phase b{font-weight:400;}
  .sr-phase:hover{color:var(--amber);}
  .sr-phase[aria-pressed="true"]{color:var(--amber); border-color:var(--accent); background:var(--accent-soft);}
  .sr-pm{position:relative; width:20px; height:20px; border-radius:50%; background:var(--amber); box-shadow:0 0 0 1px rgba(var(--accent-rgb),0.35);}
  .sr-pm::before{content:""; position:absolute; inset:0; border-radius:50%; background:var(--knock); clip-path:inset(0 0 0 var(--p));}
  .sr-fm-line{color:var(--muted); min-height:1.4em;}
  .sr-fm-line b{color:var(--ink); font-weight:500;}

  /* ProjectXRay */
  .sr-graph{width:100%; height:auto; margin-bottom:8px; overflow:visible;}
  .sr-edges line{stroke:rgba(var(--ink-rgb),0.22); stroke-width:1.2; transition:opacity 0.2s ease, stroke 0.2s ease;}
  .sr-node{cursor:pointer; outline:none; transition:opacity 0.2s ease;}
  .sr-node rect{fill:var(--knock); stroke:var(--line); stroke-width:1; transition:stroke 0.2s ease, fill 0.2s ease;}
  .sr-node text{fill:var(--muted); font-family:var(--font-mono); font-size:9px; transition:fill 0.2s ease;}
  .sr-graph.has-focus .sr-edges line{opacity:0.15;}
  .sr-graph.has-focus .sr-edges line.is-on{opacity:1; stroke:var(--amber);}
  .sr-graph.has-focus .sr-node{opacity:0.35;}
  .sr-graph.has-focus .sr-node.is-on{opacity:1;}
  .sr-node.is-on rect, .sr-node:focus-visible rect{stroke:var(--amber); fill:var(--knock-on);}
  .sr-node.is-on text, .sr-node:focus-visible text{fill:var(--amber);}

  /* Shanaiya */
  .sr-track{display:grid; grid-template-columns:repeat(5,1fr); margin:2px 0 12px;}
  .sr-track li{position:relative; text-align:center; font-size:0.62rem; color:var(--muted); padding-top:20px;}
  .sr-track li::before{
    content:""; position:absolute; top:5px; left:50%; width:9px; height:9px; margin-left:-4.5px; z-index:1;
    border-radius:50%; border:1.5px solid var(--line); background:var(--knock); transition:background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  }
  .sr-track li::after{content:""; position:absolute; top:9px; left:-50%; width:100%; height:1.5px; background:var(--line); transition:background 0.3s ease;}
  .sr-track li:first-child::after{display:none;}
  .sr-track li.is-done::before{background:var(--accent); border-color:var(--accent);}
  .sr-track li.is-done::after, .sr-track li.is-now::after{background:var(--accent);}
  .sr-track li.is-now{color:var(--ink);}
  .sr-track li.is-now::before{background:var(--amber); border-color:var(--amber); box-shadow:0 0 0 4px rgba(var(--accent-rgb),0.16);}
  .sr-sh .sr-seg{margin-top:10px;}

  /* Al-Madina */
  .sr-am-grid{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px;}
  .sr-am-cart{display:grid; gap:5px; align-content:start;}
  .sr-am-cart li{display:flex; justify-content:space-between; gap:8px;}
  .sr-am-cart em{font-style:normal; color:var(--ink); white-space:nowrap;}
  .sr-am-total{border-top:1px solid rgba(var(--fg-rgb),0.08); padding-top:5px; margin-top:2px; color:var(--ink);}
  .sr-json{
    margin:0; padding:9px 11px; font-family:inherit; font-size:0.7rem; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere;
    color:var(--muted); background:var(--code-bg); border:1px solid rgba(var(--fg-rgb),0.05); border-radius:8px;
  }
  .sr-json .s{color:var(--amber);}
  .sr-json .n{color:var(--ink);}

  /* Lwkfall */
  .sr-lf-stage{
    position:relative; height:112px; margin:0 0 4px; overflow:hidden;
    border:1px solid var(--line); border-radius:8px;
    background:linear-gradient(180deg, rgba(var(--fg-rgb),0.02), rgba(var(--accent-rgb),0.05));
  }
  .sr-lf-canvas{position:absolute; inset:0; width:100%; height:100%; display:block;}

  /* Lwkripple */
  .sr-lr-stage{
    position:relative; height:112px; margin:0 0 4px; overflow:hidden;
    border:1px solid var(--line); border-radius:8px;
    background:linear-gradient(180deg, rgba(120,170,230,0.07), rgba(40,90,160,0.17));
  }
  .sr-lr-canvas{position:absolute; inset:0; width:100%; height:100%; display:block;}

  @media (prefers-reduced-motion:reduce){
    .sr-moon, .sr-moon::before, .sr-chips li{animation:none;}
    .sr-moon::before{transform:translateX(30%);}
    .sr-mark, .sr-mark circle{transition:none;}
  }
  @media (max-width:600px){
    .sr-rows li{grid-template-columns:1fr auto 52px;}
    .sr-rows i{display:none;}
    .sr-am-grid{grid-template-columns:1fr;}
    .sr-btn-end{margin-left:0;}
  }

  @media (max-width:600px){
    .index-row{gap:16px; padding:22px 0;}
    .index-node{flex-basis:20px; padding-top:8px;}
    .index-line, .index-line-fill{left:9px;}
  }

  /* PROCESS */
  .process-section{padding:0 0 120px;}
  .process-steps{
    display:grid; grid-template-columns:repeat(4,1fr); gap:24px; margin-top:54px; position:relative;
  }
  .process-steps::before{
    content:""; position:absolute; top:23px; left:0; right:0; height:1px; background:var(--line); z-index:0;
  }
  .process-step{position:relative; z-index:1;}
  .process-num{
    width:46px; height:46px; border-radius:50%; background:var(--bg); border:1px solid var(--accent);
    display:flex; align-items:center; justify-content:center;
    font-family:var(--font-mono); font-size:0.85rem; color:var(--accent); margin-bottom:18px;
  }
  .process-step h3{font-size:1rem; margin-bottom:8px;}
  .process-step p{color:var(--muted); font-size:0.9rem;}
  @media (max-width:820px){
    .process-steps{grid-template-columns:1fr; gap:34px;}
    .process-steps::before{display:none;}
  }

  /* CONTACT */
  .contact-section{padding:0 0 130px;}
  .contact-grid{display:grid; grid-template-columns:0.9fr 1.1fr; gap:60px; align-items:start; margin-top:44px;}
  .contact-sub{color:var(--muted); font-size:1rem; max-width:46ch;}
  .contact-sub + .contact-sub{margin-top:14px;}

  .contact-direct{display:flex; flex-direction:column; gap:2px; margin-top:32px;}
  .contact-direct .contact-link{
    display:flex; align-items:center; justify-content:space-between; gap:14px;
    width:100%; padding:14px 2px; border-left:none; border-bottom:1px solid var(--line);
  }
  .contact-direct .contact-link:last-child{border-bottom:none;}
  .contact-direct .contact-link:hover{padding-left:8px;}
  .contact-k{font-family:var(--font-mono); font-size:0.82rem; letter-spacing:0.02em; color:var(--accent);}
  .contact-v{font-family:var(--font-mono); font-size:0.92rem; color:var(--ink); transition:color 0.2s ease;}
  .contact-link:hover .contact-v{color:var(--accent);}

  /* brief builder card */
  .brief-card{
    background:var(--panel-solid); border:1px solid var(--line); border-radius:22px;
    padding:clamp(22px,3vw,32px); box-shadow:var(--shadow-card);
  }
  .brief-field + .brief-field{margin-top:25px;}
  .brief-label{
    display:block; margin-bottom:12px; font-family:var(--font-mono); font-size:0.82rem;
    letter-spacing:0.02em; color:var(--accent);
  }
  .brief-opts{display:flex; flex-wrap:wrap; gap:8px;}
  .brief-opt{
    font-family:var(--font-mono); font-size:0.8rem; color:var(--muted);
    border:1px solid var(--line); background:rgba(var(--fg-rgb),0.02);
    padding:9px 15px; border-radius:9px;
    transition:border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  }
  .brief-opt:hover{border-color:rgba(var(--fg-rgb),0.22); color:var(--ink); transform:translateY(-1px);}
  .brief-opt[aria-pressed="true"]{
    border-color:var(--accent); color:var(--accent); background:var(--accent-soft);
  }
  .brief-textarea{
    width:100%; background:var(--bg-2); border:1px solid var(--line); border-radius:10px;
    padding:13px 15px; color:var(--ink); font-family:var(--font-body); font-size:0.93rem;
    resize:vertical; min-height:96px; transition:border-color 0.2s ease;
  }
  .brief-textarea::placeholder{color:var(--muted);}
  .brief-textarea:focus{outline:none; border-color:var(--accent);}
  .brief-preview{
    margin-top:25px; border:1px dashed var(--line); border-radius:10px;
    padding:15px; background:var(--bg-2);
  }
  .brief-preview pre{
    margin:0; font-family:var(--font-mono); font-size:0.74rem; line-height:1.8;
    color:var(--muted); white-space:pre-wrap; word-break:break-word;
  }
  .brief-actions{display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:22px;}
  .brief-said{font-family:var(--font-mono); font-size:0.78rem; color:var(--mint); opacity:0; transition:opacity 0.25s ease;}
  .brief-said.on{opacity:1;}

  @media (max-width:860px){
    .contact-grid{grid-template-columns:1fr; gap:40px;}
  }
  @media (max-width:560px){
    .brief-actions{flex-direction:column; align-items:stretch;}
    .brief-actions .btn{width:100%;}
  }

  /* FOOTER */
  .site-footer{border-top:1px solid var(--line); padding:44px 0; text-align:center;}
  .footer-brand{font-family:var(--font-display); font-size:1.1rem; font-weight:700;}
  .footer-brand span{color:var(--accent);}
  .footer-tagline{color:var(--muted); font-size:0.88rem; margin:10px 0 14px;}
  .footer-copy{color:var(--line); font-family:var(--font-mono); font-size:0.75rem;}

  /* BACK TO TOP */
  #back-to-top{
    position:fixed; bottom:26px; right:26px; z-index:60;
    width:46px; height:46px; border-radius:50%; border:1px solid var(--line);
    background:rgba(var(--bg2-rgb),0.85); backdrop-filter:blur(8px); color:var(--ink);
    font-size:1.1rem; display:flex; align-items:center; justify-content:center;
    opacity:0; pointer-events:none; transform:translateY(10px);
    transition:opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  }
  #back-to-top.show{opacity:1; pointer-events:auto; transform:translateY(0);}
  #back-to-top:hover{border-color:var(--accent); color:var(--accent);}

  @media (prefers-reduced-motion:reduce){
    #cursor{display:none !important;}
  }

/* GITHUB STATS */
.gh-section{padding:0 0 100px;}
.gh-section[hidden]{display:none;}
.gh-stats{display:flex; flex-wrap:wrap; gap:18px 64px; margin:36px 0 34px;}
.gh-stat-num{font-family:var(--font-display); font-weight:700; font-size:clamp(1.8rem,3vw,2.4rem); line-height:1.1; color:var(--ink);}
.gh-stat-label{font-family:var(--font-mono); font-size:0.76rem; color:var(--muted); margin-top:4px;}
.gh-heat{overflow-x:auto; padding:26px 0 8px; border-top:1px solid var(--line);}
.gh-heat svg{display:block; max-width:none; width:100%; min-width:640px; height:auto;}
.gh-heat text{fill:var(--muted); font:10px var(--font-mono);}
.gh-heat .l0{fill:rgba(var(--fg-rgb),0.05);}
.gh-heat .l1{fill:rgba(var(--accent-rgb),0.25);}
.gh-heat .l2{fill:rgba(var(--accent-rgb),0.45);}
.gh-heat .l3{fill:rgba(var(--accent-rgb),0.7);}
.gh-heat .l4{fill:var(--accent);}
.gh-langbar{display:flex; gap:2px; height:8px; margin-top:34px; border-radius:999px; overflow:hidden;}
.gh-langbar span{display:block; min-width:3px; background:var(--c);}
.gh-legend{display:flex; flex-wrap:wrap; gap:8px 22px; margin-top:14px; font-family:var(--font-mono); font-size:0.78rem; color:var(--muted);}
.gh-legend i{display:inline-block; width:8px; height:8px; margin-right:7px; border-radius:50%; background:var(--c);}
.gh-repos{display:grid; grid-template-columns:repeat(2,1fr); gap:0 56px; margin-top:34px;}
.gh-repo{display:block; padding:20px 0; border-top:1px solid rgba(var(--fg-rgb),0.05);}
.gh-repo-name{font-family:var(--font-display); font-weight:700; font-size:1.05rem; color:var(--ink); transition:color 0.2s ease;}
.gh-repo:hover .gh-repo-name{color:var(--amber);}
.gh-repo-desc{color:var(--muted); font-size:0.93rem; margin:4px 0 8px; max-width:56ch;}
.gh-repo-meta{font-family:var(--font-mono); font-size:0.76rem; color:var(--muted);}
.gh-foot{margin-top:22px; font-family:var(--font-mono); font-size:0.72rem; color:var(--muted);}
@media (max-width:700px){ .gh-repos{grid-template-columns:1fr;} .gh-section{padding-bottom:80px;} }

/* MOBILE / TOUCH */

html{-webkit-text-size-adjust:100%; text-size-adjust:100%;}
a, button, .brief-opt{-webkit-tap-highlight-color:transparent;}

#site-nav.menu-open{background:rgba(var(--bg-rgb),0.92); backdrop-filter:blur(14px); border-color:var(--line);}
.mobile-menu .nav-link.active{color:var(--accent);}
.mobile-menu .nav-link.active::after{display:none;}

@media (max-width:699px), (max-width:900px) and (orientation:portrait){
  .hero-content{padding-top:clamp(250px, 34svh, 360px); padding-bottom:56px;}
  .scroll-indicator{display:none;}
}

@media (max-width:600px){
  .hero-title{font-size:clamp(1.85rem, 8.2vw, 2.3rem); margin-bottom:20px;}
  .hero-sub{font-size:1.02rem; margin-bottom:28px;}
  .hero-role{margin-bottom:18px;}

  .about-section{padding-top:72px; padding-bottom:64px;}
  .skills-section, .services-section, .work-section, .process-section, .gh-section{padding-bottom:72px;}
  .contact-section{padding-bottom:96px;}
  .stats-bar{padding:44px 0;}
  .index-list{margin-top:30px;}
  .process-steps{margin-top:36px;}
  .btn-outline-dashed{display:inline-block; margin:0 8px 8px 0; padding:12px 16px;}

  /* contact + brief builder */
  .contact-direct{margin-top:24px;}
  .contact-direct .contact-link{padding:16px 2px;}
  .contact-k{flex:none;}
  .contact-v{min-width:0; overflow-wrap:anywhere; text-align:right;}
  .brief-card{padding:20px; border-radius:18px;}
  .brief-opt{padding:11px 14px;}
  .brief-textarea{font-size:16px;} /* stops browsers zooming in when the field is focused */

  #back-to-top{bottom:18px; right:18px;}
  .footer-inner{padding-left:24px; padding-right:24px;}
}


@media (hover:none){
  .btn:hover{transform:none;}
  .btn-primary:hover{background:transparent; box-shadow:none;}
  .btn-ghost:hover{background:transparent; border-color:var(--line);}
  .btn-link:hover{border-color:var(--accent); color:var(--ink); gap:8px;}
  .btn-link:hover::after{color:var(--muted); transform:none;}
  .btn-outline-dashed:hover{border-color:var(--line); border-style:dashed; color:var(--muted);}
  .brief-opt:not([aria-pressed="true"]):hover{border-color:var(--line); color:var(--muted); transform:none;}
  .contact-direct .contact-link:hover{padding-left:2px;}
  .contact-link:hover .contact-v{color:var(--ink);}
  .index-row:hover .index-node::before{background:var(--bg); border-color:var(--line); box-shadow:none;}
  .gh-repo:hover .gh-repo-name{color:var(--ink);}
  #back-to-top:hover{border-color:var(--line); color:var(--ink);}

  .btn:active{transform:scale(0.97);}
  .btn-outline-dashed:active{border-color:var(--amber); color:var(--amber);}
  .brief-opt:active{border-color:var(--accent); color:var(--accent);}
  .contact-link:active .contact-v{color:var(--accent);}


  body::after{display:none;}
}

/* BRIEF BUILDER */
.bb-top{display:flex; align-items:center; justify-content:space-between; margin-bottom:22px;}
.brief-moon .tag-phase{width:30px; height:30px;}
.brief-moon .tag-phase::before{background:var(--panel-solid); transition:clip-path 0.55s cubic-bezier(.22,1,.36,1);}
.bb-step{font-family:var(--font-mono); font-size:0.78rem; color:var(--muted);}
.bb-q{font-size:clamp(1.3rem,2.4vw,1.7rem); margin-bottom:6px; outline:none;}
.bb-hint{color:var(--muted); font-size:0.9rem; margin-bottom:4px;}
.bb-stage .brief-opts{margin-top:16px;}
.bb-input{min-height:0; margin:16px 0 12px; resize:none;}
.bb-nav{display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:26px;}
.bb-nav .btn[disabled]{opacity:0.35; pointer-events:none;}
.bb-ticket{border:1px dashed var(--line); border-radius:14px; padding:18px 20px; background:var(--bg-2); margin-top:16px;}
.bb-ticket-h{display:flex; justify-content:space-between; font-family:var(--font-mono); font-size:0.8rem; color:var(--accent); padding-bottom:12px; margin-bottom:10px; border-bottom:1px dashed var(--line);}
.bb-row{display:flex; gap:14px; padding:5px 0; font-size:0.92rem;}
.bb-row span:first-child{flex:0 0 78px; font-family:var(--font-mono); font-size:0.76rem; color:var(--muted); padding-top:3px;}
.bb-row span:last-child{min-width:0; color:var(--ink); overflow-wrap:anywhere; white-space:pre-wrap;}

.bb-price{margin-top:22px; padding:12px 14px; border:1px dashed var(--line); border-radius:10px; display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 10px;}
.bb-price[hidden]{display:none;}
.bb-price-k{font-size:0.84rem; color:var(--muted);}
.bb-price-v{font-family:var(--font-display); font-size:1.3rem; color:var(--amber); display:inline-block;}
.bb-price-v.bump{animation:bbBump 0.35s ease;}
.bb-price-n{flex-basis:100%; font-family:var(--font-mono); font-size:0.7rem; color:var(--muted);}
@keyframes bbBump{40%{transform:scale(1.12);}}
@media (prefers-reduced-motion:reduce){ .bb-price-v.bump{animation:none;} .brief-moon .tag-phase::before{transition:none;} }

/* BRIEF CARD COLOURS */
.brief-card{
  background-color:var(--card-solid);
  background-image:radial-gradient(ellipse 85% 55% at 50% -12%, rgba(var(--accent-rgb),0.09), transparent 70%);
  border-color:rgba(var(--accent-rgb),0.17);
  box-shadow:var(--shadow-card-2), inset 0 1px 0 rgba(var(--amber-rgb),0.06);
}
.brief-moon .tag-phase::before{background:var(--card-solid);}
.brief-moon .tag-phase{box-shadow:0 0 0 1px rgba(var(--accent-rgb),0.28);}
.bb-ticket{background:rgba(var(--fg-rgb),0.025); border-color:rgba(var(--accent-rgb),0.22);}
.bb-ticket-h{border-bottom-color:rgba(var(--accent-rgb),0.22);}

/* ticket: */
.bb-sub{margin-top:20px;}
.bb-row span:first-child{flex-basis:104px;}
.bb-ticket.is-sent{border-style:solid;}
.bb-ticket.is-sent .bb-ticket-h span:last-child{color:var(--mint);}
.bb-done{margin-top:18px;}
.bb-done-t{font-family:var(--font-display); font-size:1.15rem; font-weight:700; color:var(--ink); margin-bottom:4px;}
.bb-note{margin-top:14px; font-size:0.85rem; color:var(--muted); overflow-wrap:anywhere;}
.bb-note[hidden]{display:none;}


/* Accessibility helpers */
.sr-only{
  position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
.skip-link{
  position:fixed; left:16px; top:-64px; z-index:400;
  background:var(--bg-2); color:var(--ink); border:1px solid var(--accent);
  padding:10px 16px; border-radius:8px; font-size:0.88rem; font-weight:600;
  transition:top 0.2s ease;
}
.skip-link:focus{top:14px;}


.footer-copy{color:var(--muted-2);}

.index-title .case-link{
  color:var(--ink); padding:7px 0;
  text-decoration:underline; text-decoration-color:transparent; text-decoration-thickness:1px; text-underline-offset:5px;
  transition:color 0.2s ease, text-decoration-color 0.2s ease;
}
.case-arrow{
  display:inline-block; width:0.82em; height:0.82em; margin-left:0.45em; vertical-align:-0.08em; color:var(--muted);
  transition:transform 0.28s cubic-bezier(0.16,1,0.3,1), color 0.2s ease;
}
.case-arrow path{fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;}
.index-title .case-link:hover,
.index-title .case-link:focus-visible{color:var(--amber); text-decoration-color:rgba(var(--accent-rgb),0.55);}
.case-link:hover .case-arrow,
.case-link:focus-visible .case-arrow{color:var(--amber); transform:translateX(4px);}
@media (hover:none){
  .index-title .case-link:hover{color:var(--ink); text-decoration-color:transparent;}
  .case-link:hover .case-arrow{color:var(--muted); transform:none;}
  .sr-btn{padding:9px 14px; min-height:38px;}
  .sr-phase{min-height:44px;}
}
@media (prefers-reduced-motion:reduce){
  .case-arrow, .index-title .case-link{transition:none;}
  .case-link:hover .case-arrow, .case-link:focus-visible .case-arrow{transform:none;}
}

/* Sample widgets */
.sr-node:focus{outline:none;}
.sr-node:focus-visible rect{stroke:var(--amber); stroke-width:2;}
.sr-seg .sr-btn:focus-visible, .sr-phase:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}

/* Case study page */
.case-page main{padding-bottom:20px;}
.case-hero{position:relative; padding:132px 0 40px; overflow:hidden;}
.case-orb{
  position:absolute; right:max(24px, calc((100vw - 1180px) / 2 + 24px)); top:120px;
  width:clamp(120px, 20vw, 230px); aspect-ratio:1; border-radius:50%; pointer-events:none;
  background:radial-gradient(circle at 30% 26%, #5a5a62 0%, #232327 40%, #08080a 74%);
  box-shadow:inset -18px -14px 46px rgba(0,0,0,0.88), inset 8px 6px 20px rgba(var(--amber-rgb),0.26), 0 0 80px rgba(var(--amber-rgb),0.07);
  opacity:0.9;
}
@media (max-width:760px){ .case-orb{display:none;} .case-hero{padding-top:108px;} }

.case-crumb{
  display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:34px;
  font-family:var(--font-mono); font-size:0.78rem; color:var(--muted);
}
.case-crumb a{display:inline-flex; align-items:center; gap:8px; color:var(--muted); padding:4px 0; transition:color 0.2s ease;}
.case-crumb a:hover{color:var(--amber);}
.case-crumb svg{width:13px; height:13px; transition:transform 0.25s ease;}
.case-crumb svg path{fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;}
.case-crumb a:hover svg{transform:translateX(-3px);}
.case-crumb [aria-current]{color:var(--ink);}

.case-title{
  font-size:clamp(2.7rem, 7.5vw, 5.2rem); font-weight:800;
  letter-spacing:-0.03em; line-height:1.02; margin:4px 0 20px;
}
.case-lede{font-size:clamp(1.05rem, 1.6vw, 1.26rem); color:rgba(var(--ink-rgb),0.82); max-width:56ch; line-height:1.6;}

.case-facts{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:18px 28px;
  margin:38px 0 28px; padding:20px 0; max-width:880px;
  border-top:1px solid var(--line); border-bottom:1px solid var(--line);
}
.case-facts dt{font-family:var(--font-mono); font-size:0.68rem; letter-spacing:0.08em; text-transform:uppercase; color:var(--muted);}
.case-facts dd{margin-top:4px; color:var(--ink); font-size:0.95rem; line-height:1.45;}
.case-actions{display:flex; flex-wrap:wrap; gap:10px;}
.case-actions .btn-outline-dashed{margin:0; display:inline-flex; align-items:center; gap:8px;}
.case-actions .btn-outline-dashed.is-primary{border-style:solid; border-color:var(--accent); color:var(--amber);}
.case-actions .btn-outline-dashed.is-primary:hover{background:var(--accent-soft);}
.case-note{font-family:var(--font-mono); font-size:0.72rem; color:var(--muted); margin-top:14px; max-width:70ch;}

/* The spine */
.case-flow{position:relative; margin-top:18px;}
.case-line{position:absolute; left:14px; top:0; bottom:0; width:1px; background:var(--line);}
.case-row{position:relative; display:flex; gap:26px; padding:38px 0;}
.case-row + .case-row{border-top:1px solid rgba(var(--fg-rgb),0.05);}
.case-node{flex:0 0 30px; display:flex; justify-content:center; padding-top:13px;}
.case-node::before{
  content:""; width:8px; height:8px; border-radius:50%;
  background:var(--bg); border:1.5px solid var(--line);
  transition:background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.case-row:hover .case-node::before{background:var(--accent); border-color:var(--accent); box-shadow:0 0 0 4px rgba(var(--accent-rgb),0.14);}
.case-body{flex:1; min-width:0;}
.case-h{font-size:clamp(1.4rem, 2.5vw, 1.9rem); letter-spacing:-0.015em; line-height:1.2; margin-bottom:14px;}
.case-body > p{color:rgba(var(--ink-rgb),0.78); max-width:66ch; margin:0 0 14px;}
.case-body strong{color:var(--ink); font-weight:600;}
.case-body p a, .case-body li a, .case-body dd a{color:var(--amber); border-bottom:1px solid rgba(var(--accent-rgb),0.35); transition:border-color 0.2s ease;}
.case-body p a:hover, .case-body li a:hover, .case-body dd a:hover{border-color:var(--amber);}
.case-body code{font-family:var(--font-mono); font-size:0.86em; color:var(--amber); background:rgba(var(--fg-rgb),0.05); padding:1px 6px; border-radius:5px;}
.case-pull{
  margin:6px 0 18px; padding-left:18px; border-left:2px solid var(--accent);
  font-family:var(--font-display); font-size:clamp(1.15rem, 2vw, 1.5rem); line-height:1.35;
  color:var(--ink); max-width:44ch; letter-spacing:-0.01em;
}

/* Definition rows instead of tiles */
.case-dl{display:grid; grid-template-columns:minmax(150px, 230px) 1fr; margin:8px 0 6px; max-width:860px;}
.case-dl dt, .case-dl dd{padding:13px 0; border-top:1px solid rgba(var(--fg-rgb),0.06);}
.case-dl dt{font-family:var(--font-display); font-weight:700; color:var(--ink); padding-right:24px;}
.case-dl dd{color:rgba(var(--ink-rgb),0.74); font-size:0.95rem;}
.case-dl dt:last-of-type, .case-dl dd:last-of-type{border-bottom:1px solid rgba(var(--fg-rgb),0.06);}
@media (max-width:640px){
  .case-dl{grid-template-columns:1fr;}
  .case-dl dt{padding-bottom:2px; border-bottom:0;}
  .case-dl dd{padding-top:0; border-top:0;}
  .case-dl dt{border-top:1px solid rgba(var(--fg-rgb),0.06);}
}

/* Pipeline diagram */
.cs-pipe{display:flex; flex-wrap:wrap; align-items:stretch; margin:14px 0 8px; max-width:900px; font-family:var(--font-mono);}
.cs-step{
  position:relative; flex:1 1 130px; min-width:120px; padding:12px 14px;
  border:1px dashed var(--line); border-radius:8px; background:var(--panel);
  margin:0 22px 10px 0;
}
.cs-step b{display:block; font-family:var(--font-display); font-size:0.95rem; color:var(--ink); margin-bottom:3px;}
.cs-step span{font-size:0.7rem; color:var(--muted); line-height:1.45; display:block;}
.cs-step:not(:last-child)::after{
  content:""; position:absolute; right:-20px; top:50%; width:16px; height:1px; background:var(--accent); opacity:0.7;
}
.cs-step:not(:last-child)::before{
  content:""; position:absolute; right:-21px; top:calc(50% - 3px); width:6px; height:6px;
  border-top:1px solid var(--accent); border-right:1px solid var(--accent); transform:rotate(45deg); opacity:0.7;
}
.cs-step.is-hot{border-style:solid; border-color:rgba(var(--accent-rgb),0.55); background:var(--accent-soft);}
@media (max-width:700px){
  .cs-pipe{flex-direction:column;}
  .cs-step{margin:0 0 22px 0; flex-basis:auto;}
  .cs-step:not(:last-child)::after{right:auto; left:24px; top:auto; bottom:-17px; width:1px; height:14px;}
  .cs-step:not(:last-child)::before{right:auto; left:21px; top:auto; bottom:-17px; transform:rotate(135deg);}
}

/* Report panels on case pages are allowed to be wider */
.case-body .slop-report{max-width:560px;}
.case-body .slop-report.is-wide{max-width:none;}
.cs-pair{display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:16px 0 6px; max-width:900px;}
.cs-pair .slop-report{margin:0; max-width:none;}
@media (max-width:760px){ .cs-pair{grid-template-columns:1fr;} }
.cs-range{display:grid; grid-template-columns:1fr 46px; gap:4px 12px; align-items:center; margin-bottom:12px;}
.cs-range label{font-size:0.74rem; color:var(--ink); grid-column:1 / -1;}
.cs-range label small{color:var(--muted); font-size:0.68rem; margin-left:6px;}
.cs-range input[type="range"]{
  -webkit-appearance:none; appearance:none; width:100%; height:28px; margin:0;
  background:transparent; cursor:pointer; --p:50%;
}
.cs-range input[type="range"]::-webkit-slider-runnable-track{
  height:4px; border-radius:999px;
  background:linear-gradient(to right, var(--amber) var(--p), rgba(var(--fg-rgb),0.14) var(--p));
}
.cs-range input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none; box-sizing:border-box;
  width:16px; height:16px; margin-top:-6px; border-radius:50%;
  background:var(--amber); border:2px solid var(--thumb); box-shadow:0 0 0 1px var(--amber);
}
.cs-range input[type="range"]::-moz-range-track{height:4px; border-radius:999px; background:rgba(var(--fg-rgb),0.14);}
.cs-range input[type="range"]::-moz-range-progress{height:4px; border-radius:999px; background:var(--amber);}
.cs-range input[type="range"]::-moz-range-thumb{
  box-sizing:border-box; width:16px; height:16px; border-radius:50%;
  background:var(--amber); border:2px solid var(--thumb); box-shadow:0 0 0 1px var(--amber);
}
.cs-range input[type="range"]:focus-visible{outline:2px solid var(--amber); outline-offset:4px; border-radius:6px;}
.cs-range output{text-align:right; color:var(--ink); font-size:0.76rem;}
.cs-out{display:grid; grid-template-columns:1fr auto; gap:6px 14px; padding-top:10px; border-top:1px solid rgba(var(--fg-rgb),0.06);}
.cs-out span{color:var(--muted);}
.cs-out strong{font-family:var(--font-display); font-size:1.25rem; color:var(--amber); line-height:1; text-align:right;}
.cs-out .is-naive strong{color:var(--muted);}

/* Code */
.case-code{
  font-family:var(--font-mono); font-size:0.78rem; line-height:1.7; color:var(--ink);
  background:var(--panel); border:1px solid var(--line); border-radius:10px;
  padding:14px 16px; margin:10px 0 14px; overflow-x:auto; white-space:pre; max-width:760px;
}
.case-code .c{color:var(--muted);}
.case-code .k{color:var(--amber);}

/* Screenshots */
.case-fig{margin:22px 0 10px; max-width:980px;}
.case-shot{border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--panel-solid);}
.case-shot img{width:100%; height:auto; display:block;}
.case-fig figcaption{margin-top:9px; font-family:var(--font-mono); font-size:0.72rem; color:var(--muted); line-height:1.55; max-width:80ch;}
.cs-shots{display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; max-width:980px;}
.cs-shots .case-fig{margin:10px 0;}
@media (max-width:760px){ .cs-shots{grid-template-columns:1fr;} }

/* Aven growth ladder */
.cs-stages{display:grid; grid-template-columns:repeat(5, 1fr); gap:6px; margin:6px 0 14px; font-family:var(--font-mono);}
.cs-stages li{padding:8px 4px 0; border-top:2px solid rgba(var(--fg-rgb),0.08); font-size:0.66rem; color:var(--muted); text-align:left; transition:border-color 0.3s ease, color 0.3s ease;}
.cs-stages li b{display:block; font-family:var(--font-display); font-size:0.82rem; color:inherit; margin-bottom:1px;}
.cs-stages li.is-reached{border-color:rgba(var(--accent-rgb),0.5); color:var(--ink);}
.cs-stages li.is-now{border-color:var(--amber); color:var(--amber);}
@media (max-width:520px){ .cs-stages li{font-size:0.6rem;} .cs-stages li b{font-size:0.72rem;} }
.cs-meter{height:6px; border-radius:99px; background:rgba(var(--fg-rgb),0.06); overflow:hidden; margin:2px 0 12px;}
.cs-meter i{display:block; height:100%; width:0; background:linear-gradient(90deg, var(--accent), var(--amber)); border-radius:inherit; transition:width 0.5s cubic-bezier(0.16,1,0.3,1);}
@media (prefers-reduced-motion:reduce){ .cs-meter i, .cs-stages li{transition:none;} }
.cs-table{width:100%; border-collapse:collapse; font-family:var(--font-mono); font-size:0.74rem; margin:6px 0 4px;}
.cs-table th, .cs-table td{text-align:left; padding:6px 8px 6px 0; border-top:1px solid rgba(var(--fg-rgb),0.06); font-weight:400; vertical-align:top;}
.cs-table th{color:var(--muted); font-size:0.66rem; letter-spacing:0.06em; text-transform:uppercase; border-top:0;}
.cs-table td:first-child{color:var(--ink);}
.cs-table td.is-bad{color:var(--muted);}
.cs-table td.is-good{color:var(--amber);}
.cs-scroll{overflow-x:auto;}

.case-more{margin-top:20px; padding:56px 0 26px; border-top:1px solid var(--line);}
.case-more .section-title{font-size:clamp(1.5rem, 3vw, 2.2rem);}
.case-more-list{margin-top:18px; max-width:860px;}
.case-more-list a{
  display:flex; align-items:baseline; gap:16px; justify-content:space-between; flex-wrap:wrap;
  padding:18px 0; border-top:1px solid rgba(var(--fg-rgb),0.06); transition:color 0.2s ease;
}
.case-more-list li:last-child a{border-bottom:1px solid rgba(var(--fg-rgb),0.06);}
.case-more-list .t{font-family:var(--font-display); font-weight:700; font-size:1.1rem; color:var(--ink); display:inline-flex; align-items:center; gap:0.5em;}
.case-more-list .d{color:var(--muted); font-size:0.88rem; flex:1 1 260px;}
.case-more-list a:hover .t, .case-more-list a:focus-visible .t{color:var(--amber);}
.case-more-list a:hover .case-arrow, .case-more-list a:focus-visible .case-arrow{color:var(--amber); transform:translateX(4px);}
.case-back{margin-top:30px; display:flex; flex-wrap:wrap; gap:18px; align-items:center;}

@media (max-width:600px){
  .case-row{gap:16px; padding:30px 0;}
  .case-node{flex-basis:20px;}
  .case-line, .case-line-fill{left:9px;}
  .case-facts{margin-top:30px;}
}


.cs-lab select.sr-btn{min-height:32px; cursor:pointer;}

.cs-pipe{list-style:none; padding:0;}
code, pre, .slop-report, .case-facts dt, .tech-row{font-variant-ligatures:none;}
.cs-scroll{max-width:760px; margin:6px 0 16px;}
.cs-table{font-size:0.78rem;}
.cs-table th:first-child, .cs-table td:first-child{padding-right:28px;}
.case-body .slop-report, .cs-pair{margin-bottom:18px;}
.case-body .slop-report.cs-lab{margin-bottom:16px;}

.constellation-label{color:rgba(var(--fg-rgb),0.6); font-size:10px;}
.constellation-status{color:rgba(var(--fg-rgb),0.6); font-size:9.5px;}
.case-more-list .case-arrow{margin-left:0;}
.case-link .nw{white-space:nowrap;}

@media (prefers-reduced-motion:reduce){
  .pulse-dot, .scroll-indicator span{animation:none;}
}

/* Light theme: a warmer gold wash behind the hero, to sit with the moon's glow */
:root[data-theme="light"] .hero::before{
  background:radial-gradient(ellipse 1000px 760px at 66% -4%, rgba(214,150,52,0.20), transparent 58%);
}

/* Demo "screens" (Lwkfall / Lwkripple) stay dark in light theme, like device displays */
:root[data-theme="light"] .sr-lf-stage{
  background:linear-gradient(180deg, rgba(255,255,255,0.03), rgba(233,162,61,0.07)), #0b0a09;
  border-color:rgba(42,38,32,0.25);
}
:root[data-theme="light"] .sr-lr-stage{
  background:linear-gradient(180deg, rgba(120,170,230,0.07), rgba(40,90,160,0.17)), #0b0a09;
  border-color:rgba(42,38,32,0.25);
}

/* THEME TOGGLE + INK TRANSITION */
.nav-actions{display:flex; align-items:center; gap:14px;}
.theme-toggle{
  position:relative; width:40px; height:40px; flex:none; padding:0;
  display:inline-grid; place-items:center; border-radius:50%;
  border:1px solid var(--line); background:transparent; color:var(--ink);
  transition:border-color 0.25s ease, background 0.25s ease, transform 0.35s cubic-bezier(0.16,1,0.3,1);
}
.theme-toggle:hover{border-color:var(--accent); background:var(--accent-soft); transform:rotate(-14deg);}
.theme-toggle:active{transform:scale(0.92);}
.theme-toggle svg{width:18px; height:18px; grid-area:1/1; transition:transform 0.5s cubic-bezier(0.16,1,0.3,1), opacity 0.3s ease;}
/* dark theme shows the sun (go light); light theme shows the crescent (go dark) */
.theme-toggle .ico-moon{opacity:0; transform:rotate(-70deg) scale(0.6);}
:root[data-theme="light"] .theme-toggle .ico-sun{opacity:0; transform:rotate(70deg) scale(0.6);}
:root[data-theme="light"] .theme-toggle .ico-moon{opacity:1; transform:none;}
@media (max-width:860px){
  .nav-actions{margin-left:auto; margin-right:6px;}
  .theme-toggle{width:38px; height:38px;}
}

/* Ink bleed: the new theme is revealed through an animated ink mask (see theme.js) */
::view-transition-group(root){animation-duration:0s;}
html.theme-ink::view-transition-old(root),
html.theme-ink::view-transition-new(root){animation:none; mix-blend-mode:normal;}
html.theme-ink::view-transition-old(root){z-index:1;}
html.theme-ink::view-transition-new(root){
  z-index:2;
  -webkit-mask-image:var(--ink-sheet); mask-image:var(--ink-sheet);
  -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
  -webkit-mask-size:100% var(--ink-sheet-h); mask-size:100% var(--ink-sheet-h);
  -webkit-mask-position:0 0; mask-position:0 0;
  animation:inkReveal var(--ink-dur,1300ms) steps(var(--ink-steps,39)) both;
}
@keyframes inkReveal{
  from{-webkit-mask-position:0 0%; mask-position:0 0%;}
  to{-webkit-mask-position:0 100%; mask-position:0 100%;}
}
/* Plain fade for browsers/situations without the ink mask */
html.theme-fade::view-transition-group(root){animation-duration:0.45s;}
/* Browsers without View Transitions: gentle colour fade */
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after{
  transition:background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, fill 0.4s ease, stroke 0.4s ease !important;
}
/* While the ink is running, don't let CSS transitions fight the snapshot */
html.theme-ink *, html.theme-ink *::before, html.theme-ink *::after{transition:none !important;}
@media (prefers-reduced-motion:reduce){
  html.theme-ink::view-transition-new(root){animation:none; -webkit-mask-image:none; mask-image:none;}
}

/* SCROLL MOTION */

@property --lit  {syntax:'<number>';     inherits:true; initial-value:1;}
@property --f    {syntax:'<number>';     inherits:true; initial-value:1;}
@property --wp   {syntax:'<number>';     inherits:true; initial-value:1;}
@property --draw {syntax:'<number>';     inherits:true; initial-value:1;}
@property --scan {syntax:'<percentage>'; inherits:true; initial-value:100%;}
@property --so   {syntax:'<number>';     inherits:true; initial-value:0;}

:root{
  --mo-ease:cubic-bezier(.22,1,.36,1);
  --mo-ease-io:cubic-bezier(.65,0,.25,1);
}

/* split text (built by motion.js) */
.wm{
  display:inline-block; overflow:hidden; vertical-align:top;
  padding:.08em .06em .16em; margin:-.08em -.06em -.16em;
}
.wm-in{display:inline-block;}
html.mo [data-anim="head"] .wm-in,
html.mo [data-anim="lines"] .wm-in{transform:translateY(112%);}
html.mo [data-anim="head"].in-view .wm-in{
  transform:none;
  transition:transform 1s var(--mo-ease) calc(var(--l,0) * 90ms + 60ms);
}
html.mo [data-anim="lines"].in-view .wm-in{
  transform:none;
  transition:transform .9s var(--mo-ease) calc(var(--l,0) * 80ms + var(--s,0) * 70ms);
}

/* focus: soft to sharp, no travel */
html.mo [data-anim="focus"]{opacity:0; filter:blur(6px);}
html.mo [data-anim="focus"].in-view{
  opacity:1; filter:none;
  animation:mo-focus .9s var(--mo-ease) calc(var(--s,0) * 70ms) backwards;
}
@keyframes mo-focus{from{opacity:0; filter:blur(6px);}}

/* head: tag + title */
/* the tag's moon is lit left to right up to its own phase, scaled by --f */
.section-tag .tag-phase::before{clip-path:inset(0 0 0 calc(var(--p) * var(--f)));}
html.mo [data-anim="head"] .section-tag{opacity:calc(.35 + .65 * var(--f));}

/* stats */
.stat{position:relative;}
html.mo [data-anim="stats"] .stat-mask{overflow:hidden; padding-bottom:.18em; margin-bottom:-.18em;}
html.mo [data-anim="stats"] .stat-mask > *{display:block; transform:translateY(112%);}
html.mo [data-anim="stats"].in-view .stat-mask > *{
  transform:none;
  transition:transform 1s var(--mo-ease) calc(var(--s,0) * 120ms + 80ms);
}
html.mo [data-anim="stats"] .stat-label{opacity:0;}
html.mo [data-anim="stats"].in-view .stat-label{
  opacity:1; animation:mo-focus .9s var(--mo-ease) calc(var(--s,0) * 120ms + 300ms) backwards;
}
.stat:nth-child(2){--s:1;}
.stat:nth-child(3){--s:2;}
html.mo [data-anim="stats"] .stat + .stat::before{
  content:""; position:absolute; left:-15px; top:10%; bottom:10%; width:1px;
  background:rgba(var(--fg-rgb),.12); transform:scaleY(0); transform-origin:top;
}
html.mo [data-anim="stats"].in-view .stat + .stat::before{
  transform:none;
  animation:mo-divider 1s var(--mo-ease) calc(var(--s,0) * 120ms) backwards;
}
@keyframes mo-divider{from{transform:scaleY(0);}}
@media (max-width:700px){
  html.mo [data-anim="stats"] .stat + .stat::before{
    left:30%; right:30%; top:-18px; bottom:auto; width:auto; height:1px;
    transform:scaleX(0); transform-origin:left;
  }
  html.mo [data-anim="stats"].in-view .stat + .stat::before{transform:none; animation-name:mo-divider-x;}
  @keyframes mo-divider-x{from{transform:scaleX(0);}}
}

/* words: scrubbed lighting */
html.mo [data-anim="words"] .w{
  opacity:calc(.2 + .8 * clamp(0, var(--wp) * (var(--n) + 8) - var(--i), 1));
}
@keyframes mo-words{from{--wp:0;} to{--wp:1;}}

/* ignite / node: scrubbed row lighting */
html.mo [data-anim="ignite"],
html.mo [data-anim="node"]{--lit:0;}
html.mo [data-anim="ignite"] > .index-body{opacity:calc(.3 + .7 * var(--lit));}
@keyframes mo-lit{from{--lit:0;} to{--lit:1;}}

/* node dot: an accent core + ring that grow with --lit (sits over the existing dot) */
.index-node, .case-node{position:relative;}
.case-node{--nt:13px;}
html.mo .index-node::after,
html.mo .case-node::after{
  content:""; position:absolute; left:50%; top:var(--nt,9px);
  width:11px; height:11px; margin-left:-5.5px; border-radius:50%;
  background:var(--accent); pointer-events:none;
  opacity:var(--lit);
  transform:scale(calc(.35 + .65 * var(--lit)));
  box-shadow:0 0 0 calc(var(--lit) * 5px) rgba(var(--accent-rgb), calc(var(--lit) * .14));
}
@media (max-width:600px){ .index-node{--nt:8px;} }

/* hair: a line traces across, then the content focuses in */
html.mo [data-anim="hair"]{--lit:0;}
html.mo [data-anim="hair"].in-view{
  --lit:1;
  animation:mo-lit-in .9s var(--mo-ease) .15s backwards;
}
@keyframes mo-lit-in{from{--lit:0;}}
html.mo [data-anim="hair"] > :not(.index-node){opacity:0; filter:blur(5px);}
html.mo [data-anim="hair"].in-view > :not(.index-node){
  opacity:1; filter:none;
  animation:mo-focus .9s var(--mo-ease) calc(.22s + var(--s,0) * 70ms) backwards;
}
/* the line itself: services rows (top), contact links (bottom), case list (top) */
html.mo .index-row[data-anim="hair"]:not(:first-child){border-top-color:transparent;}
html.mo .contact-direct .contact-link[data-anim="hair"]{border-bottom-color:transparent;}
html.mo .case-more-list li[data-anim="hair"] > a{border-top-color:transparent;}
html.mo .case-more-list li[data-anim="hair"]:last-child > a{border-bottom-color:transparent;}
html.mo .case-more-list li[data-anim="hair"]{position:relative;}
html.mo .contact-link[data-anim="hair"]{position:relative;}

html.mo .index-row[data-anim="hair"]:not(:first-child)::before,
html.mo .contact-direct .contact-link[data-anim="hair"]:not(:last-child)::after,
html.mo .case-more-list li[data-anim="hair"]::before,
html.mo .case-more-list li[data-anim="hair"]:last-child::after{
  content:""; position:absolute; left:0; right:0; height:1px; pointer-events:none;
  background:rgba(var(--fg-rgb),.07);
  transform:scaleX(0); transform-origin:left;
}
html.mo .index-row[data-anim="hair"]:not(:first-child)::before{top:-1px;}
html.mo .contact-direct .contact-link[data-anim="hair"]:not(:last-child)::after{bottom:-1px; background:var(--line);}
html.mo .case-more-list li[data-anim="hair"]::before{top:0;}
html.mo .case-more-list li[data-anim="hair"]:last-child::after{bottom:0;}
html.mo .index-row[data-anim="hair"].in-view:not(:first-child)::before,
html.mo .contact-direct .contact-link[data-anim="hair"].in-view:not(:last-child)::after,
html.mo .case-more-list li[data-anim="hair"].in-view::before,
html.mo .case-more-list li[data-anim="hair"].in-view:last-child::after{
  transform:none;
  animation:mo-hair 1.1s var(--mo-ease) calc(var(--s,0) * 70ms) backwards;
}
@keyframes mo-hair{
  0%  {transform:scaleX(0); background:rgba(var(--accent-rgb),.65);}
  55% {transform:scaleX(1); background:rgba(var(--accent-rgb),.4);}
  100%{transform:scaleX(1);}
}

/* scan: an amber line uncovers the block */
html.mo [data-anim="scan"]{
  position:relative; --scan:0%;
  clip-path:inset(0 -24px 100% -24px);
}
html.mo [data-anim="scan"]::after{
  content:""; position:absolute; left:0; right:0; top:calc(var(--scan) - 1px); height:1px;
  pointer-events:none; z-index:2; opacity:var(--so);
  background:linear-gradient(90deg, transparent, rgba(var(--accent-rgb),.9) 18%, rgba(var(--amber-rgb),1) 50%, rgba(var(--accent-rgb),.9) 82%, transparent);
  box-shadow:0 0 14px 1px rgba(var(--amber-rgb),.4);
}
html.mo [data-anim="scan"].in-view{
  clip-path:none; --scan:100%;
  animation:mo-scan 1.3s cubic-bezier(.55,.05,.2,1) calc(var(--s,0) * 60ms) backwards;
}
@keyframes mo-scan{
  0%  {clip-path:inset(0 -24px 100% -24px); --scan:0%;   --so:0;}
  8%  {--so:1;}
  86% {--so:1;}
  100%{clip-path:inset(0 -24px 0 -24px);    --scan:100%; --so:0;}
}
/* bars inside a scanned report fill after the line has passed */
html.mo [data-anim="scan"]:not(.in-view) .slop-bars i::after{transform:scaleX(0);}
html.mo [data-anim="scan"].in-view .slop-bars i::after{transition-delay:.7s;}

/* wave: GitHub heatmap */
html.mo [data-anim="wave"] rect{opacity:0; transform:scale(.3); transform-box:fill-box; transform-origin:center;}
html.mo [data-anim="wave"].in-view rect{
  opacity:1; transform:none;
  animation:mo-cell .7s var(--mo-ease) calc(var(--d,0) * 12ms) backwards;
}
@keyframes mo-cell{from{opacity:0; transform:scale(.3);}}

/* grow: language bar */
html.mo [data-anim="grow"] .gh-langbar{clip-path:inset(0 100% 0 0 round 999px);}
html.mo [data-anim="grow"].in-view .gh-langbar{
  clip-path:none;
  animation:mo-grow 1.3s var(--mo-ease) .15s backwards;
}
@keyframes mo-grow{
  from{clip-path:inset(0 100% 0 0 round 999px);}
  to  {clip-path:inset(0 0 0 0 round 999px);}
}
html.mo [data-anim="grow"] .gh-legend{opacity:0;}
html.mo [data-anim="grow"].in-view .gh-legend{
  opacity:1; animation:mo-focus .9s var(--mo-ease) .8s backwards;
}

/* path: process line drawn by scroll */
.process-step{--t:.02;}
.process-step:nth-child(2){--t:.276;}
.process-step:nth-child(3){--t:.532;}
.process-step:nth-child(4){--t:.788;}
html.mo [data-anim="path"]{--draw:0;}
html.mo [data-anim="path"]::after{
  content:""; position:absolute; top:23px; left:0; right:0; height:1px; z-index:0;
  background:linear-gradient(90deg, var(--accent), var(--amber));
  transform-origin:left; transform:scaleX(clamp(0, var(--draw), 1));
}
html.mo [data-anim="path"] .process-step{
  --lit:clamp(0, calc((var(--draw) - var(--t)) * 14), 1);
}
html.mo [data-anim="path"] .process-num{
  border-color:color-mix(in srgb, var(--accent) calc(var(--lit) * 100%), rgba(var(--fg-rgb),.18));
  color:color-mix(in srgb, var(--accent) calc(var(--lit) * 100%), var(--muted));
  box-shadow:0 0 0 calc(var(--lit) * 6px) rgba(var(--accent-rgb), calc(var(--lit) * .12));
}
html.mo [data-anim="path"] .process-step h3,
html.mo [data-anim="path"] .process-step p{opacity:calc(.35 + .65 * var(--lit));}
@keyframes mo-draw{from{--draw:0;} to{--draw:1;}}
@media (max-width:820px){ html.mo [data-anim="path"]::after{display:none;} }

/* print: the brief card prints from the top */
html.mo [data-anim="print"]{clip-path:inset(0 0 100% 0 round 22px);}
html.mo [data-anim="print"].in-view{
  clip-path:none;
  animation:mo-print 1.3s cubic-bezier(.5,.05,.15,1) backwards;
}
@keyframes mo-print{
  from{clip-path:inset(0 0 100% 0 round 22px); transform:translateY(-10px);}
  to  {clip-path:inset(0 0 0 0 round 22px);    transform:none;}
}

/* spine: the vertical line is filled by scroll */
.index-line-fill, .case-line-fill{
  position:absolute; left:14px; top:0; bottom:0; width:1px;
  background:var(--accent); opacity:.55; transform-origin:top;
}
.case-line-fill{z-index:0;}
html.mo .index-line-fill, html.mo .case-line-fill{transform:scaleY(0);}
@keyframes mo-spine{to{transform:scaleY(1);}}
@media (max-width:600px){ .index-line-fill, .case-line-fill{left:9px;} }

/* Scrubbed versions: only where scroll-driven animations exist */
@supports (animation-timeline: view()){
  /* moon waxes while the heading rises */
  html.mo [data-anim="head"]{
    --f:0;
    animation:mo-moon linear both;
    animation-timeline:view(block 0px 18%);
    animation-range:entry 0% entry 100%;
  }
  /* words light as the paragraph climbs toward centre */
  html.mo [data-anim="words"]{
    --wp:0;
    animation:mo-words linear both;
    animation-timeline:view();
    animation-range:entry 10% cover 42%;
  }
  /* rows light when their top crosses ~70% of the screen */
  html.mo [data-anim="ignite"],
  html.mo [data-anim="node"]{
    animation:mo-lit linear both;
    animation-timeline:view(block 0px 30%);
    animation-range:entry 0px entry 140px;
  }
  /* process line follows the scroll */
  html.mo [data-anim="path"]{
    animation:mo-draw linear both;
    animation-timeline:view(block 0px 8%);
    animation-range:entry 15% cover 50%;
  }
  /* spine head tracks the same 70% line the rows ignite on */
  html.mo .index-list, html.mo .case-flow{
    view-timeline:--mo-list block;
    view-timeline-inset:0px 30%;
  }
  html.mo .index-line-fill, html.mo .case-line-fill{
    animation:mo-spine linear both;
    animation-timeline:--mo-list;
    animation-range:entry 0% entry 100%;
  }
}
@keyframes mo-moon{from{--f:0;} to{--f:1;}}

/* Fallback for browsers without scroll-driven animations: the same states, triggered once */
@supports not (animation-timeline: view()){
  html.mo [data-anim="ignite"].in-view,
  html.mo [data-anim="node"].in-view{--lit:1; animation:mo-lit-in 1s var(--mo-ease) backwards;}
  html.mo [data-anim="path"]{transition:--draw 1.8s var(--mo-ease-io);}
  html.mo [data-anim="path"].in-view{--draw:1;}
  html.mo .index-line-fill, html.mo .case-line-fill{transition:transform 1.3s var(--mo-ease);}
  html.mo [data-anim="spine"].in-view .index-line-fill,
  html.mo [data-anim="spine"].in-view .case-line-fill{transform:none;}
}

/* FAQ */
.faq-section{padding:0 0 120px;}
.faq-grid{display:grid; grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); gap:clamp(32px,6vw,90px); align-items:start;}
.faq-side{position:sticky; top:110px;}
.faq-note{color:var(--muted); margin:14px 0 26px; max-width:34ch;}
.faq-list{border-bottom:1px solid var(--line);}
.faq-item{border-top:1px solid var(--line);}
.faq-q{
  width:100%; display:flex; justify-content:space-between; align-items:center; gap:20px;
  padding:24px 0; background:none; border:0; color:var(--ink); cursor:pointer; text-align:left;
  font:700 1.15rem/1.3 var(--font-display); letter-spacing:-.01em; transition:color .25s;
}
.faq-q:hover, .faq-item.open .faq-q{color:var(--amber);}
.faq-q:focus-visible{outline:2px solid var(--accent); outline-offset:4px; border-radius:6px;}
.faq-ico{position:relative; flex:none; width:16px; height:16px;}
.faq-ico::before, .faq-ico::after{content:""; position:absolute; left:0; right:0; top:50%; height:1.5px; margin-top:-.75px; background:var(--accent); transition:transform .4s var(--mo-ease);}
.faq-ico::after{transform:rotate(90deg);}
.faq-item.open .faq-ico::after{transform:rotate(0deg);}
.faq-a{display:grid; grid-template-rows:0fr; transition:grid-template-rows .45s var(--mo-ease);}
.faq-item.open .faq-a{grid-template-rows:1fr;}
.faq-a > div{overflow:hidden; visibility:hidden; transition:visibility 0s .45s;}
.faq-item.open .faq-a > div{visibility:visible; transition-delay:0s;}
.faq-a p{color:var(--muted); padding:0 44px 26px 0; max-width:62ch;}
@media (max-width:820px){
  .faq-grid{grid-template-columns:1fr;}
  .faq-side{position:static;}
  .faq-section{padding-bottom:72px;}
}
@media (prefers-reduced-motion:reduce){
  .faq-a, .faq-ico::before, .faq-ico::after, .faq-a > div{transition:none;}
}
