/* Approved artwork is unchanged. Calibrate real viewport geometry, not browser zoom.
   Reference units follow CONTENT width, not the window surrounding that content. */
@media (min-width:1101px) {
  body.v31-calibrated[data-page] .site-nav.shell,
  body.v31-calibrated[data-page="chat"] .chat-page.shell,
  body.v31-calibrated[data-page="resume"] .resume-page.shell {
    width:min(1200px,calc(100% - 96px));
  }
  body.v31-calibrated[data-page="chat"] .chat-page,
  body.v31-calibrated[data-page="resume"] .resume-page {padding-top:36px;}
  body.v31-calibrated[data-page="chat"] {
    --qa:min(.7416563659px,calc((100vw - 96px) / 1618));
  }
  body.v31-calibrated[data-page="chat"] .chat-intro {
    margin-bottom:0;
    background:linear-gradient(105deg,#fff 0%,#fff 24%,#e9faff 52%,#e1f8fe 75%,#dff8fe 100%);
  }
  body.v31-calibrated[data-page="chat"] .chat-intro::before {
    background:radial-gradient(circle,#a0e8f4 calc(1.05 * var(--qa)),transparent calc(1.6 * var(--qa))) 0 0/calc(10 * var(--qa)) calc(10 * var(--qa));
  }
  body.v31-calibrated[data-page="chat"] .chat-intro h1 {
    font-size:calc(102 * var(--qa));letter-spacing:-.055em;
  }
  body.v31-calibrated[data-page="chat"] .chat-intro > div:first-child > p:last-child {
    font-size:max(15px,calc(20 * var(--qa)));max-width:calc(1090 * var(--qa));
  }
  body.v31-calibrated[data-page="chat"] .chat-layout {
    grid-template-columns:minmax(0,29.4%) minmax(0,1fr);
  }
  body.v31-calibrated[data-page="chat"] .question-panel {
    background:linear-gradient(118deg,#ecfaff 0%,#eaf9fe 60%,#eefafe 100%);
  }
  body.v31-calibrated[data-page="chat"] .panel-heading {padding-bottom:calc(44 * var(--qa));}
  body.v31-calibrated[data-page="chat"] .question-group {margin-top:calc(44 * var(--qa));}
  body.v31-calibrated[data-page="chat"] .suggestions button {font-size:13px;}
  body.v31-calibrated[data-page="chat"] .v22-picked-hint {font-size:12px;}
  body.v31-calibrated[data-page="chat"] .message-body > p {font-size:14px;}
  /* Height rollback: use the original stretching card / chat-log rules. */
  body.v31-calibrated[data-page="chat"] .chat-form {margin:0 24px 24px;padding:14px;}
  body.v31-calibrated[data-page="chat"] .chat-form textarea {min-height:42px;font-size:14px;}

  body.v31-calibrated[data-page="resume"] {
    --ru:min(.8928571429px,calc((100vw - 96px) / 1344));
  }
  body.v31-calibrated[data-page="resume"] .resume-hero {
    min-height:calc(292 * var(--ru));padding:calc(48 * var(--ru)) calc(55 * var(--ru));
    border-radius:28px;
  }
  body.v31-calibrated[data-page="resume"] .resume-id {gap:calc(31 * var(--ru));}
  body.v31-calibrated[data-page="resume"] .resume-monogram {
    width:calc(114 * var(--ru));height:calc(130 * var(--ru));
    font-size:calc(54 * var(--ru));border-radius:24px;
  }
  body.v31-calibrated[data-page="resume"] .resume-id h1 {font-size:calc(93.5 * var(--ru));}
  body.v31-calibrated[data-page="resume"] .resume-id .eyebrow {margin-bottom:calc(17 * var(--ru));}
  body.v31-calibrated[data-page="resume"] .resume-id > div > p:last-child {
    font-size:15px;margin-top:calc(17 * var(--ru));
  }
  body.v31-calibrated[data-page="resume"] .resume-contact {transform:translateY(calc(30 * var(--ru)));font-size:12px;}
  body.v31-calibrated[data-page="resume"] .resume-layout {
    grid-template-columns:minmax(0,24.63%) minmax(0,1fr);gap:5.65%;padding-top:44px;
  }
  body.v31-calibrated[data-page="resume"] .resume-section-title {gap:22px;margin-bottom:25px;}
  body.v31-calibrated[data-page="resume"] .resume-section-title h2 {font-size:34px;}
  body.v31-calibrated[data-page="resume"] .resume-section-title .eyebrow {margin-bottom:14px;}
  body.v31-calibrated[data-page="resume"] .resume-skill-list article {min-height:148px;padding:22px 19px 22px 79px;}
  body.v31-calibrated[data-page="resume"] .resume-skill-list article::before {width:46px;height:46px;left:17px;top:24px;}
  body.v31-calibrated[data-page="resume"] .resume-aside {gap:34px;}
  body.v31-calibrated[data-page="resume"] .resume-aside section {padding-bottom:28px;}
}

/* Restore the reference's layered status light rather than the inherited glow animation. */
body.v31-calibrated[data-page="chat"] .knowledge-status .live-dot {
  animation:none;filter:none;background:#4faa62;
  box-shadow:0 0 0 calc(8 * var(--qa)) #c1e6b5,0 0 0 calc(17 * var(--qa)) #eff8e7;
}
body.v31-calibrated[data-page="chat"] .rag-badge::before {
  animation:none;filter:none;
  box-shadow:0 0 0 5px #bce5aa,0 0 0 9px #eff8e7;
}
body.v31-calibrated[data-page="chat"] .thinking-status[hidden] {display:none;}
body.v31-calibrated[data-page="chat"] .message-assistant .message-body > p {
  background:#f8fcfd;border-color:#e0ecee;
}
body.v31-calibrated[data-page="chat"] .v28-leaf-fall i:nth-child(n) {
  background:#a8d79a;filter:none;box-shadow:inset 1px 0 0 #8bbc7c55;
}
body.v31-calibrated[data-page="chat"] .v28-leaf-fall {opacity:1;}
body.v31-calibrated[data-page="chat"] .chat-log:has(.message-user) .v28-leaf-fall {opacity:0;}
@media(max-width:720px) {
  /* No changes to the approved mobile hero illustration or its placement. */
  body.v31-calibrated[data-page="resume"] .resume-aside {
    width:100%;margin-left:0;gap:12px;
  }
  body.v31-calibrated[data-page="resume"] .resume-aside section:nth-child(n) {
    position:relative;padding:19px 16px 21px;min-height:0;
    border:1px solid #d8e5cf;border-radius:19px;
    background:#fff;box-shadow:0 8px 22px #21463805;
  }
  body.v31-calibrated[data-page="resume"] .resume-aside section:nth-child(even) {
    border-color:#dce0ef;background:linear-gradient(125deg,#fbfcff,#fff);
  }
  body.v31-calibrated[data-page="resume"] .resume-aside section::before {
    content:"";display:block;position:absolute;left:0;bottom:-2px;width:34px;height:3px;
    background:#80b65c;border-radius:3px;transform:none;
  }
  body.v31-calibrated[data-page="resume"] .resume-aside .eyebrow {font-size:12px;letter-spacing:.19em;}
  body.v31-calibrated[data-page="resume"] .resume-aside h2 {font-size:19px;line-height:1.4;margin:14px 0 13px;}
  body.v31-calibrated[data-page="resume"] .resume-aside h3 {font-size:15px;}
  body.v31-calibrated[data-page="resume"] .resume-aside p:not(.eyebrow) {font-size:12px;line-height:1.9;color:#69716e;}
  body.v31-calibrated[data-page="chat"] .knowledge-status .live-dot {
    box-shadow:0 0 0 7px #c1e6b4;
  }
  body.v31-calibrated[data-page="chat"] .message-assistant .message-body > p {
    background:#f8fcfd;border-color:#e0ecee;
  }
}

@media(min-width:1121px) {
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .hero {
    --hs:calc((min(1440px,92vw) - clamp(96px,10vw,200px) - 45px) / 1162.4);
    width:min(1440px,92vw);max-width:1440px;min-height:min(820px,calc(100svh - 86px));
    margin:16px auto 0;padding:55px clamp(48px,5vw,100px);
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:45px;
    border-radius:0;
  }
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .hero h1 {
    font-size:clamp(48px,4.8vw,70px);line-height:1.17;
  }
  body.v31-calibrated.v20-home .hero .identity-row {margin-bottom:16px;}
  body.v31-calibrated.v20-home .hero-copy > .eyebrow {margin-bottom:14px;}
  body.v31-calibrated.v20-home .hero-lead {margin-top:18px;font-size:15px;}
  body.v31-calibrated.v20-home .hero-actions {margin-top:22px;}
  body.v31-calibrated.v20-home .contact-line {margin-top:22px;}
  body.v31-calibrated .v20-scroll-cue {margin-top:17px;}
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .hero-stage {
    min-height:calc(560 * var(--hs));aspect-ratio:auto;border-width:7px;border-radius:30px;
  }
  body.v31-calibrated.v20-home .stage-viewport {min-height:calc(440 * var(--hs));}
  body.v31-calibrated.v20-home .stage-state {inset:calc(62 * var(--hs)) calc(45 * var(--hs)) calc(54 * var(--hs));}
  body.v31-calibrated.v20-home .stage-slide h2 {font-size:clamp(30px,2.65vw,39px);}
  body.v31-calibrated.v20-home .stage-state > p:not(.slide-kicker) {font-size:14px;line-height:1.8;}
  body.v31-calibrated .v21-hero-second {font-size:clamp(44px,4.15vw,62px);}
  body.v31-calibrated .v21-scroll-meter {
    z-index:4;height:5px;background:#163e32a6;box-shadow:0 -1px 0 #faffeb66;
  }
  body.v31-calibrated .v21-scroll-meter b {background:#fffbe4;box-shadow:0 0 0 1px #12372d66;}
}
@media(prefers-reduced-motion:reduce) {
  body.v31-calibrated .v21-scroll-meter b {transform:scaleX(1);}
}

/* Clean neutral surfaces; keep the cyan dots and small green accents intact. */
/* Exact v23 timing and viewport entry behavior; no scroll scrubbing. */
body.v31-calibrated[data-page="resume"] .v30-resume-path path {
  stroke-dasharray:520;stroke-dashoffset:520;animation:none;
}
body.v31-calibrated[data-page="resume"] .v30-resume-path circle {opacity:0;animation:none;}
body.v31-calibrated[data-page="resume"] .v30-resume-path.v23-decor-visible path {animation:v23-line-draw 2.8s ease-out forwards;}
body.v31-calibrated[data-page="resume"] .v30-resume-path.v23-decor-visible circle {animation:v23-node-pop .5s ease-out 1.4s forwards;}
body.v31-calibrated[data-page="resume"] .v30-resume-path.v23-decor-visible circle:nth-of-type(2) {animation-delay:2s;}
body.v31-calibrated[data-page="resume"] .v30-resume-path.v23-decor-visible circle:nth-of-type(3) {animation-delay:2.7s;}

/* Illustration-only corrections: project-copy, tags and evidence panels are untouched. */
body.v31-calibrated.v30-preview .project-visual.visual-agent {
  background:radial-gradient(circle at 50% 47%,#e9fac4 0%,#c9ef94 43%,#9cda69 100%);
}
body.v31-calibrated.v30-preview .project-visual.visual-kb {
  background:radial-gradient(circle at 75% 20%,#e1faff 0%,#b3eaf4 47%,#83d5e5 100%);
}
body.v31-calibrated.v30-preview .kb-console {
  background:#fff;border-color:#b4d9df;box-shadow:0 12px 25px #21465118;
  transition:transform .35s ease,box-shadow .35s ease,border-color .35s ease;
}
body.v31-calibrated.v30-preview .kb-console p {color:#4c626a;}
body.v31-calibrated.v30-preview .kb-console strong {color:#287350;}
body.v31-calibrated.v30-preview .kb-console > div {border-color:#e3eef0;}
body.v31-calibrated.v30-preview .kb-console::after {
  background:radial-gradient(circle at 28% 25%,#86e1ed,#b9f0f4 62%,#dcfaff);
  box-shadow:0 7px 16px #235b6812;transition:transform .45s ease;
}
body.v31-calibrated.v30-preview .agent-orbit b {
  box-shadow:0 10px 20px #203c291c;transition:transform .35s ease,box-shadow .35s ease;
}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  body.v31-calibrated.v30-preview .project-card:hover .kb-console,
  body.v31-calibrated.v30-preview .project-card:focus-within .kb-console {
    transform:translate(-50%,calc(-50% - 9px)) rotate(-1deg) scale(1.025);
    border-color:#86c5d0;box-shadow:0 18px 30px #21465122;
  }
  body.v31-calibrated.v30-preview .project-card:hover .kb-console::after,
  body.v31-calibrated.v30-preview .project-card:focus-within .kb-console::after {transform:translate(5px,-4px);}
  body.v31-calibrated.v30-preview .project-card:hover .agent-orbit b,
  body.v31-calibrated.v30-preview .project-card:focus-within .agent-orbit b {
    transform:translateY(-6px) scale(1.06);box-shadow:0 16px 26px #203c2930;
  }
}
@media(prefers-reduced-motion:reduce) {
  body.v31-calibrated[data-page="resume"] .v30-resume-path path {stroke-dashoffset:0;animation:none!important;}
  body.v31-calibrated[data-page="resume"] .v30-resume-path circle {opacity:1;animation:none!important;}
}
body.v31-calibrated[data-page="chat"] .knowledge-status {background:#fff;border-color:#dce9e7;}
@media(max-width:1100px) and (min-width:721px) {
 body.v31-calibrated[data-page="chat"] .chat-intro h1 {font-size:76px;}
}
@media(max-width:720px) {
 body.v31-calibrated[data-page="chat"] .chat-intro h1 {font-size:clamp(30px,7.8vw,42px);}
}

/* Five agreed refinements only. Keep the approved hero/card dimensions and fills. */
body.v31-calibrated.v30-preview.v20-home[data-page="home"] .hero {border-radius:0;}
@media(min-width:721px) {
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .hero::before {
    inset:0;background-position:left top;transform-origin:left top;
    /* Anchor the original blue sky at the top; overscan only to the right/bottom. */
    transform:translate3d(min(0px,var(--v29-bg-x,0px)),min(0px,var(--v29-bg-y,0px)),0) scale(1.015);
  }
}
body.v31-calibrated .project-card::after,
body.v31-calibrated .cap-card::after {
  background:radial-gradient(380px circle at var(--x,50%) var(--y,50%),#f4fcff38,transparent 56%);
}
@media(max-width:720px) {
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .hero-stage {
    border-width:3px;border-radius:24px;box-shadow:0 8px 20px #173b4614;
  }
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .mobile-quick {
    margin-top:16px;padding:0 6px 12px;gap:6px;
    border:0;border-radius:0;background:transparent;box-shadow:none;
  }
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .mobile-quick a {
    background:#fff;border:1px solid #dce6e3;border-radius:12px;
    box-shadow:0 3px 9px #183e3610;min-height:72px;
    display:flex;flex-direction:column;
  }
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .mobile-quick a.dark {
    background:#14372b;border-color:#14372b;
  }
  body.v31-calibrated.v20-home .mobile-quick small {min-height:19px;line-height:1.35;}
  body.v31-calibrated.v20-home .mobile-quick strong {margin-top:5px;}
}
@media(prefers-reduced-motion:reduce) {
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .hero::before {transform:none!important;}
}

/* Light-frame revision: reuse the established cyan; no dark-theme conversion. */
body.v31-calibrated {--text:#111;--muted:#626262;background:#fff;color:#111;}
body.v31-calibrated :is(h1,h2,h3,h4) {color:#111;}
body.v31-calibrated[data-page="resume"] .resume-id h1,
body.v31-calibrated[data-page="chat"] .chat-intro h1,
body.v31-calibrated.v20-home .hero h1,
body.v31-calibrated.v20-home .stage-slide h2 {color:#111;}
body.v31-calibrated :is(.hero-lead,.detail-lead,.detail-grid p,.resume-aside p:not(.eyebrow),.project-copy > p) {color:#626262;}
body.v31-calibrated :is(.project-dialog,.chat-card,.site-nav) {background-color:#fff;}
@media(min-width:1121px) {
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .hero {
    /* Halve the old side gutters, without scaling up either content column. */
    width:calc(min(1440px,92vw) + (100vw - min(1440px,92vw)) / 2);
    max-width:none;margin-top:-60px;
    padding-top:131px;
    padding-inline:calc(clamp(48px,5vw,100px) + (100vw - min(1440px,92vw)) / 4);
    min-height:calc(min(820px,100svh - 86px) + 76px);
    border-radius:30px;
  }
  body.v31-calibrated[data-page="home"] .site-header {top:0;background:transparent;}
  body.v31-calibrated[data-page="home"] .site-nav.shell {
    width:min(1120px,calc(100% - 180px));height:80px;
    border:0;border-radius:0 0 30px 30px;background:#fff;
    box-shadow:0 10px 22px #00000008;backdrop-filter:none;position:relative;
  }
  /* Inverse corners visually join the navigation to the white page frame. */
  body.v31-calibrated[data-page="home"] .site-nav::before,
  body.v31-calibrated[data-page="home"] .site-nav::after {
    content:"";position:absolute;top:10px;width:26px;height:26px;pointer-events:none;
  }
  body.v31-calibrated[data-page="home"] .site-nav::before {left:-26px;border-top-right-radius:26px;box-shadow:8px -8px 0 8px #fff;}
  body.v31-calibrated[data-page="home"] .site-nav::after {right:-26px;border-top-left-radius:26px;box-shadow:-8px -8px 0 8px #fff;}
  body.v31-calibrated[data-page="home"] .nav-links {border:0;box-shadow:none;background:transparent;}
}
@media(min-width:721px) and (max-width:1120px) {
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .hero {border-radius:26px;}
}
body.v31-calibrated .tech-evidence {background:#eaf8fa;border-color:#d2e9ed;color:#111;box-shadow:0 12px 28px #00000007;}
body.v31-calibrated .tech-evidence::after {display:none;}
body.v31-calibrated .tech-evidence-grid article {background:#fff;border-color:#d2e9ed;box-shadow:none;}
body.v31-calibrated .tech-evidence :is(h3,b,.eyebrow) {color:#111;}
body.v31-calibrated .tech-evidence :is(p,small),
body.v31-calibrated .tech-evidence-heading span {color:#626262;}

/* Only reduce the detail heading; original gallery presentation is retained. */
body.v31-calibrated .detail-content > h2 {font-size:clamp(30px,3.4vw,46px);line-height:1.15;}
/* Visible neutral pointer light, not a green tint across the entire card. */
body.v31-calibrated .project-card::after,
body.v31-calibrated .cap-card::after {background:radial-gradient(300px circle at var(--x,50%) var(--y,50%),#ffffff8c,transparent 64%);}
@media(hover:hover) and (pointer:fine) {
  body.v31-calibrated .project-card:hover {border-color:#9ccbd4;box-shadow:0 14px 30px #00000012;}
}
@media(max-width:720px) {
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .mobile-quick {
    margin-top:0;padding:24px 6px 14px;background:#fff;position:relative;isolation:isolate;
  }
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .mobile-quick::before {
    content:"";position:absolute;inset:0 0 auto;height:20px;z-index:-1;
    background:none;
  }
  body.v31-calibrated .detail-content > h2 {font-size:29px;padding-right:0;}
}

/* A viewport mask, not a hero decoration: content scrolls behind every edge. */
.v31-viewport-frame {
  position:fixed;inset:6px;z-index:49;border-radius:20px;
  box-shadow:0 0 0 100px #fff;pointer-events:none;
}
@media(min-width:1121px) {
  .v31-viewport-frame {
    inset:10px calc((100vw - min(1440px,92vw))/4);
    border-radius:30px;
  }
  body.v31-calibrated .site-header {
    top:0;background:transparent;border:0;backdrop-filter:none;
  }
  body.v31-calibrated .site-nav.shell {
    width:min(1120px,calc(100% - 180px));height:80px;
    border:0;border-radius:0 0 30px 30px;background:#fff;
    box-shadow:0 10px 22px #00000008;backdrop-filter:none;position:relative;
  }
  body.v31-calibrated .site-nav::before,
  body.v31-calibrated .site-nav::after {
    content:"";position:absolute;top:10px;width:26px;height:26px;pointer-events:none;
  }
  body.v31-calibrated .site-nav::before {left:-26px;border-top-right-radius:26px;box-shadow:8px -8px 0 8px #fff;}
  body.v31-calibrated .site-nav::after {right:-26px;border-top-left-radius:26px;box-shadow:-8px -8px 0 8px #fff;}
  body.v31-calibrated .nav-links {border:0;box-shadow:none;background:transparent;}
}
body.v31-calibrated .cap-card .tech-chip {display:inline-flex;}
@media(max-width:720px) {
  /* One green ink, fading dot density. No compressed landscape or tinted blur. */
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .mobile-quick {
    padding:30px 6px 20px;background:#fff;
  }
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .mobile-quick::before {
    height:100%;inset:0;z-index:-1;pointer-events:none;
    background:radial-gradient(circle,#7bc544 1.6px,transparent 1.9px) 0 0/6px 6px;
    mask-image:linear-gradient(#000 0%,#000b 35%,transparent 100%);
    -webkit-mask-image:linear-gradient(#000 0%,#000b 35%,transparent 100%);
  }
  body.v31-calibrated.v30-preview.v20-home[data-page="home"] .mobile-quick a.dark {
    background:#111;border-color:#111;
  }
}
@media print {.v31-viewport-frame {display:none;}}

/* Restore click affordance; keep the independent evidence panel removed. */
body.v31-calibrated .cap-card button.tech-chip {cursor:pointer;}
@media(max-width:720px) {
 body.v31-calibrated.v30-preview.v20-home[data-page="home"] .mobile-quick::before {
  /* Crop the screenshot's left text fragment; preserve source dot shapes and spacing. */
  background:#fff url('assets/mobile-approved-cyan-texture.png') right top / 135% auto no-repeat;
  filter:hue-rotate(-70deg) saturate(.8);
  mask-image:linear-gradient(#000 60%,transparent 100%);
  -webkit-mask-image:linear-gradient(#000 60%,transparent 100%);
 }
}

/* Restore original artwork, not an enlarged screenshot fragment. */
@media(max-width:720px) {
 body.v31-calibrated.v30-preview.v20-home[data-page="home"] .mobile-quick::before {
  background:#fff url('assets/v28-halftone-landscape.png') 8% top / 1100px auto no-repeat;
  filter:hue-rotate(-65deg);
  mask-image:linear-gradient(#000,transparent);
  -webkit-mask-image:linear-gradient(#000,transparent);
 }
}

/* Original pointer-following overlay: only its colour changes. */
body.v31-calibrated .project-card::after,
body.v31-calibrated .cap-card::after {
 display:block!important;
 background:radial-gradient(420px circle at var(--x,50%) var(--y,50%),rgba(76,167,65,.09),transparent 48%);
}
@media(min-width:1121px) {
 /* Keep the existing scroll-linked meter inside the fixed viewport frame. */
 body.v31-calibrated .v21-scroll-meter {bottom:0;left:0;right:0;width:auto;}
}

@media(min-width:1121px) {
 body.v31-calibrated[data-page="home"] .v31-viewport-frame {bottom:0;}
}
