/* Stage 12: final visual system pass. Loaded last on every page. */
:root{
  --ui-gutter:clamp(17px,3vw,36px);
  --ui-control:48px;
  --ui-touch:44px;
  --ui-speed:180ms;
  --ui-ease:cubic-bezier(.2,.75,.25,1);
  --ui-copy:#c4d2c6;
  --ui-soft:#9db0a0;
}
html{scroll-padding-top:24px}
body{overflow-x:clip}
.wrap{width:min(calc(100% - (var(--ui-gutter) * 2)),1520px)}
img,svg,video,canvas{max-width:100%}
button,input,select,textarea{font:inherit}
button{color:inherit}
:is(.home,.case--editorial,.about-page,.demo-catalog,.lab,.report-playground,.calc-page) :is(h1,h2,h3){text-wrap:balance}
:is(.home,.case--editorial,.about-page,.demo-catalog,.lab,.report-playground,.calc-page) p{text-wrap:pretty}
:is(a,button,summary,input,select,textarea):focus-visible{outline:2px solid var(--lime);outline-offset:4px}
.site-header,.site-footer{min-width:0}
.site-header>*{min-width:0}
.main-nav{gap:clamp(22px,2.4vw,38px);margin-right:clamp(28px,4.2vw,64px)}
.main-nav a{white-space:nowrap}
.header-contact{min-height:var(--ui-control);box-sizing:border-box}
.footer-links{display:flex;flex-wrap:wrap;gap:14px 23px}
.site-footer{row-gap:28px}
.site-footer p,.site-footer small,.footer-links a{line-height:1.5}

/* Unify interactive timing without flattening the individual page identities. */
:is(.header-contact,.main-nav a,.footer-links a,.home .action,.home .showcase-demo-link,
.case--editorial .case-button,.case--editorial .case-demo-cta,.case--editorial .case-outcome-contact,
.case--editorial .case-next a,.demo-catalog a,.about-page a,.lab a,.lab button,
.report-playground a,.report-playground button,.calc-page a,.calc-page button,.contact-button){
  transition-duration:var(--ui-speed);
  transition-timing-function:var(--ui-ease);
}
:is(.home .action,.case--editorial .case-button,.case--editorial .case-demo-cta,
.demo-catalog-launch,.demo-catalog-tool-meta a,.about-hero-links a,.about-next a,
.lab .lab-end a,.report-playground .playground-next a,.calc-page .calc-next a,.contact-button){
  min-height:var(--ui-control);
  box-sizing:border-box;
}

/* Consistent readable body copy across standalone pages. */
.about-hero-copy>p,.about-section-intro>p,.about-ai-intro>p,.about-skill-card p,.about-ai-flow p,
.demo-catalog-intro p,.demo-catalog-card>p,.demo-catalog-safety p,
.lab .lab-intro-grid>p,.lab .lab-notice span,
.report-playground .playground-heading>p,.report-playground .playground-safety p,
.calc-page .calc-hero-aside>p,.calc-page .calc-disclaimer p,
.case--editorial .case-chapter-lead,.case--editorial .case-outcome-card>p:not(.case-chapter-overline){
  line-height:1.55;
}
.case--editorial .case-summary{line-height:1.5}

/* Cards and framed blocks share one optical edge treatment. */
:is(.home .featured-card,.home .archive-card,.demo-catalog-card,.about-skill-card,
.case--editorial .detail-card,.lab .tg-flow,.lab .tg-device,.lab .onec-editor,.lab .onec-response,
.report-playground .scenario-panel,.calc-page .calc-input-group){
  box-shadow:0 0 0 1px rgba(217,250,115,.025) inset;
}

/* Very light entrance motion. Content is fully visible without animation support. */
@keyframes final-enter{
  from{opacity:.72;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}
@media (prefers-reduced-motion:no-preference){
  .home .hero-copy,.home .hero-showcase,
  .case--editorial .case-hero h1,.case--editorial .case-summary,
  .about-hero-title,.about-hero-copy,
  .demo-catalog-hero-grid,
  .lab .lab-intro-grid,
  .report-playground .playground-heading,
  .calc-page .calc-hero-grid{
    animation:final-enter .48s var(--ui-ease) both;
  }
  .home .hero-showcase,.case--editorial .case-summary,.about-hero-copy{animation-delay:70ms}

  /* The browser transition already animates navigation. Avoid a second reveal. */
  @supports selector(:active-view-transition) {
    :root:active-view-transition :is(.home .hero-copy,.home .hero-showcase,
      .home .hero-person,.case--editorial .case-hero h1,.case--editorial .case-summary,
      .about-hero-title,.about-hero-copy,.demo-catalog-hero-grid,.lab .lab-intro-grid,
      .report-playground .playground-heading,.calc-page .calc-hero-grid) {
      animation: none;
    }
  }
}

/* Tablet header: five links do not need to fight the logo for pixels. */
@media (max-width:960px){
  .site-header .main-nav{display:none}
  .site-header .mobile-menu{
    display:block;
    margin-left:auto;
    margin-right:10px;
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
  }
  .site-header .mobile-menu summary{
    min-height:var(--ui-touch);
    display:flex;
    align-items:center;
    cursor:pointer;
    padding:10px 9px;
    list-style:none;
  }
  .site-header .mobile-menu summary::-webkit-details-marker{display:none}
  .site-header .mobile-menu[open] nav{
    position:absolute;
    top:100%;
    left:0;
    right:0;
    z-index:25;
    background:var(--paper);
    border:1px solid var(--line);
    padding:10px var(--ui-gutter);
    display:flex;
    flex-direction:column;
    gap:0;
    box-shadow:6px 6px 0 #344a3a;
    max-height:min(72svh,520px);
    max-height:min(520px,calc(100dvh - 108px));
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  .site-header .mobile-menu nav a{
    min-height:var(--ui-touch);
    display:flex;
    align-items:center;
    padding:10px 8px;
    border-bottom:1px solid var(--line);
  }
  .site-header .mobile-menu nav a:last-child{border-bottom:0}
  .site-footer{grid-template-columns:1fr 1fr;min-height:0;padding-block:46px}
  .site-footer small{text-align:left}
}

/* Mobile rhythm and readability. */
@media (max-width:740px){
  :root{--ui-control:48px}
  html{scroll-padding-top:80px}
  .site-header .mobile-menu[open] nav{max-height:min(430px,calc(100dvh - 84px))}
  .site-header>.header-contact{
    height:var(--ui-touch);
    min-height:var(--ui-touch);
    flex:0 0 auto;
    align-self:center;
  }
  .site-footer{padding-block:38px}
  :is(.contact-form,.lab,.report-playground,.calc-page) :is(input:not([type=hidden]),select,textarea){font-size:16px}
  .lab #onec-payload{font-size:16px}
  :is(.lab,.report-playground,.calc-page) button{min-height:var(--ui-touch)}
  .home .contact-section .contact-form select{font-size:16px}
  .home .contact-section .contact-form textarea{line-height:1.55}
  .home .contact-section .contact-hint,.home .contact-section .contact-privacy{line-height:1.55}
  .case--editorial .case-contents-nav a{min-height:var(--ui-touch)}
  .case--editorial .case-stack>span{line-height:1.35}
  .demo-catalog-card-title{margin-top:36px}
  .demo-catalog-card>p,.about-skill-card p,.about-ai-flow p{font-size:clamp(13px,2.2vw,15px)}
}

@media (max-width:600px){
  .site-footer{grid-template-columns:1fr;gap:18px}
  .site-footer .footer-links{flex-direction:column;align-items:flex-start;gap:10px}
  .site-footer small{margin-top:4px}
  .about-next nav,.demo-catalog-actions{gap:8px}
}

@media (max-width:390px){
  .wrap{width:min(calc(100% - 28px),1520px)}
  .site-header{gap:6px}
  .site-header .brand{font-size:clamp(16px,4.8vw,19px)}
  .site-header .header-contact{padding-inline:8px}
  .site-header .mobile-menu{margin-right:0}
  .about-principles-grid h2{font-size:clamp(39px,12vw,41px)}
  .home .section-rail,.about-section-head,.demo-catalog-rail,.lab .lab-rail,
  .report-playground .playground-sectionhead,.calc-page .calc-rail{gap:8px}
}

/* Accessibility gets the final word over decoration. */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto!important}
  *,*::before,*::after{
    animation:none!important;
    transition-duration:.01ms!important;
    transition-delay:0ms!important;
  }
}
