@font-face {
  font-family: Baskervville;
  src: url('/assets/fonts/Baskervville-Regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Baskervville;
  src: url('/assets/fonts/Baskervville-Italic.woff2') format('woff2');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
:root { --final-paper:#f7f7ef; --final-green:#113b2c; --final-ink:#14251c; --final-line:#becabe; --final-serif:Baskervville,Georgia,serif; }
body .site-header,.journal-v2 .site-header { color-scheme:light; position:relative; inset:auto; background:var(--final-paper); color:var(--final-green); border-bottom:1px solid var(--final-line); }
body .site-header .brand img,.journal-v2 .site-header .brand img { content:url('/assets/brand/logo-green.svg'); width:122px; }
body .site-header .header-inner { min-height:82px; }
body .site-header #main-nav { font:400 14px/1.45 var(--mono); color:var(--final-ink); }
body .site-header #main-nav .nav-cta { background:var(--final-green); color:#f7f7ef; border:1px solid var(--final-green); gap:20px; padding:9px 18px; }
body .site-header .menu-icon i { background:var(--final-green); }
body .site-header .menu-toggle { color:var(--final-green); font-family:var(--mono); }
body .site-header :focus-visible { outline:2px solid #417051; outline-offset:3px; }
body .site-header .brand span { letter-spacing:.1em; }
body .site-footer {
  color-scheme: dark;
  background: #0c0e0c;
  color: var(--final-paper);
  border-top: 1px solid #353d35;
  padding-top: clamp(28px, 4vw, 48px);
}
.site-footer .footer-top { align-items: center; padding-bottom: 24px; }
.site-footer .footer-top p { margin: 0; color: #bfc6bc; }
.site-footer .footer-email { gap: 10px; border-color: #505b50; font-size: 15px; }
.site-footer .footer-bottom {
  flex-wrap: wrap;
  gap: 8px 28px;
  padding-block: 8px 14px;
  border-color: #353d35;
  color: #bfc6bc;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 clamp(14px, 2.4vw, 34px); }
.footer-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--final-paper);
  font: 13px/1.4 var(--mono);
}
.site-footer :is(.footer-nav a, .footer-email):focus-visible,
.site-footer .brand:focus-visible {
  outline: 2px solid #c7e4ab;
  outline-offset: 3px;
}
@media (hover: hover) and (pointer: fine) {
  .site-footer :is(.footer-nav a, .footer-email):hover {
    color: #c7e4ab;
    text-decoration: underline;
    text-underline-offset: 4px;
  }
}
@media (max-width: 640px) {
  .site-footer .footer-top { grid-template-columns: 1fr; gap: 12px; padding-bottom: 18px; }
  .site-footer .footer-email { grid-column: auto; }
  .footer-nav { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer .footer-bottom { padding-bottom: 22px; }
}
body .skip-link:not(:focus) { clip-path:inset(50%); }
@media (max-width:900px) {
  body .site-header .header-inner { min-height:74px; }
  body .site-header #main-nav { background:var(--final-paper); border-color:var(--final-line); font-size:16px; }
}

/* Shared editorial and analytical roles for all thirteen routes. */
:root {
  --final-night:#0d2119;
  --final-moss:#173b2b;
  --final-mark:#c7e4ab;
  --final-comparison:#adc2ae;
  --final-muted:#455c4c;
  --final-motion-time:420ms;
  --final-motion-ease:cubic-bezier(.2,.72,.22,1);
}
body { --green:var(--final-green); --black:var(--final-night); --panel:var(--final-moss); --paper:var(--final-paper); }
body :is(button,summary,.interior-link,.rule-action,.solid-action,.quiet-action,.entry-contact,.button,.footer-email) {
  font-family:var(--mono); font-weight:400;
}
body :is(.entry-metrics dd,.metric-strip strong,.scenario-result strong,.loss-value) {
  font-family:var(--mono); font-weight:400; font-variant-numeric:tabular-nums;
}
body .editorial-plate,body .case-picture { background:var(--final-moss); }
body .editorial-plate img,body .case-picture img { display:block; width:100%; object-fit:cover; }
@media(prefers-reduced-motion:no-preference) {
  .home-case .case-picture img,.work-card .editorial-plate img { transition:transform var(--final-motion-time) var(--final-motion-ease); }
  .work-card:is(:hover,:focus-visible) .editorial-plate img { transform:scale(1.025); }
}
/* Entrances only run after a section reaches the viewport. */
@media (prefers-reduced-motion: no-preference) {
  [data-scroll-entrance].is-entering {
    --scroll-travel: clamp(8px, 1.2vw, 18px);
    animation: var(--scroll-entrance) var(--scroll-duration, 540ms) cubic-bezier(.24,.44,.25,1)
               var(--scroll-delay, 0ms) both;
  }
  [data-scroll-entrance="rise"] { --scroll-entrance: scroll-rise; }
  [data-scroll-entrance="left"] { --scroll-entrance: scroll-left; }
  [data-scroll-entrance="right"] { --scroll-entrance: scroll-right; }
  [data-scroll-entrance="fade"] { --scroll-entrance: scroll-fade; --scroll-duration: 460ms; }
  [data-scroll-entrance="settle"] { --scroll-entrance: scroll-settle; --scroll-duration: 580ms; }
  [data-scroll-entrance="row"] { --scroll-entrance: scroll-row; --scroll-duration: 540ms; }
  [data-scroll-entrance="uncover-left"] { --scroll-entrance: scroll-uncover-left; --scroll-duration: 650ms; }
  [data-scroll-entrance="uncover-right"] { --scroll-entrance: scroll-uncover-right; --scroll-duration: 650ms; }
  [data-scroll-entrance="open-down"] { --scroll-entrance: scroll-open-down; --scroll-duration: 640ms; }
  [data-scroll-entrance="chart"] { --scroll-entrance: scroll-right; --scroll-duration: 560ms; }
  [data-scroll-entrance="bars"] { --scroll-entrance: scroll-fade; }

  .entry-figure.is-entering .entry-series {
    animation: scroll-draw 650ms cubic-bezier(.24,.44,.25,1) 55ms both;
  }
  .loss-chart.is-entering .loss-bar {
    transform-origin: right center;
    animation: scroll-grow-bar 560ms cubic-bezier(.24,.44,.25,1) both;
  }
  .loss-chart.is-entering .loss-row:nth-child(2) .loss-bar { animation-delay: 45ms; }
  .loss-chart.is-entering .loss-row:nth-child(3) .loss-bar { animation-delay: 90ms; }
  .loss-chart.is-entering .loss-row:nth-child(4) .loss-bar { animation-delay: 135ms; }

  @keyframes scroll-rise {
    from { opacity: .82; translate: 0 9px; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes scroll-left {
    from { opacity: .82; translate: calc(-1 * var(--scroll-travel)) 0; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes scroll-right {
    from { opacity: .82; translate: var(--scroll-travel) 0; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes scroll-fade {
    from { opacity: .82; }
    to { opacity: 1; }
  }
  @keyframes scroll-settle {
    from { opacity: .82; scale: .985; }
    to { opacity: 1; scale: 1; }
  }
  @keyframes scroll-row {
    from { opacity: .82; translate: calc(-.45 * var(--scroll-travel)) 6px; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes scroll-uncover-left {
    from { opacity: .82; clip-path: inset(0 11% 0 0); }
    to { opacity: 1; clip-path: inset(0); }
  }
  @keyframes scroll-uncover-right {
    from { opacity: .82; clip-path: inset(0 0 0 11%); }
    to { opacity: 1; clip-path: inset(0); }
  }
  @keyframes scroll-open-down {
    from { opacity: .82; clip-path: inset(0 0 10% 0); }
    to { opacity: 1; clip-path: inset(0); }
  }
  @keyframes scroll-draw {
    from { clip-path: inset(-5px 100% -5px -5px); }
    to { clip-path: inset(-5px); }
  }
  @keyframes scroll-grow-bar {
    from { scale: .15 1; }
    to { scale: 1 1; }
  }

  @media (max-width: 700px) {
    [data-scroll-entrance].is-entering { --scroll-travel: 6px; }
  }
}

/* Controls share interaction states. Their base colours and selected states come from each surface. */
:is(.relief-hero, .home-invitation, .closing, .case-mast, .case-explorer,
    .model-section, .scenario-layout, .service-laboratory, .contact-form) {
  --button-focus: var(--final-mark);
}

body :is(button, summary,
         a:is(.button, .nav-cta, .solid-action, .quiet-action, .rule-action, .interior-link,
              .entry-contact, .back-link, .text-link, .practice-questions a, .lens-bottom > a,
              .home-case, .work-card)) {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  --button-arrow-progress: 0;

  &:focus-visible:where(:not(.home-case, .work-card)) {
    outline: 2px solid var(--button-focus, #315f42);
    outline-offset: var(--button-focus-offset, 3px);
  }

  &:where(:enabled, :any-link, summary) {
    &:focus-visible {
      --button-wash: .09;
      --button-sweep: 0%;
      --button-rule: 1;
      --button-arrow-progress: 1;
    }

    @media (hover: hover) and (pointer: fine) {
      &:hover:not([data-touch-state]) {
        --button-wash: .09;
        --button-sweep: 0%;
        --button-rule: 1;
        --button-arrow-progress: 1;
      }
    }

    &:is(:active:not([data-touch-state]), [data-touch-state="pressed"], [data-key-pressed]) {
      --button-response: var(--button-press-duration, 65ms);
      --button-wash: .19;
      --button-sweep: 0%;
      --button-rule: .68;
      --button-arrow-progress: .25;
      --button-travel: 2px;
      --button-depth: 0px;
      --button-recess: #071a1245;

      @media (forced-colors: active) {
        outline: 2px solid Highlight;
        outline-offset: -2px;
      }
    }

    &[data-touch-state="pressed"] {
      --button-press-duration: 0ms;
    }
  }
}

/* A linked study card shares its interaction state with the action it contains. */
:is(button, summary, a:is(.button, .nav-cta, .solid-action, .quiet-action, .rule-action,
                         .interior-link, .entry-contact, .back-link, .text-link,
                         .practice-questions a, .lens-bottom > a),
    .work-card .interior-link, .home-case .case-picture > span) {
  &:where(:not(.case-picture > span)) {
    position: relative;
  }
  isolation: isolate;

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    background-color: currentColor;
    opacity: var(--button-wash, 0);
  }

  @media (prefers-reduced-motion: no-preference) {
    &::before {
      transition: opacity var(--button-response, 220ms) ease-out,
                  background-position 440ms var(--final-motion-ease);
    }

    & > :is(.arrow-icon, span[aria-hidden="true"]) {
      translate: calc(var(--button-arrow-progress) * var(--button-arrow-x, 4px))
                 calc(var(--button-arrow-progress) * var(--button-arrow-y, -2px));
      transition: translate var(--button-response, 260ms) var(--final-motion-ease);
    }
  }
}

/* The main actions have a shallow edge and a sweep across the face. */
:is(.button, .nav-cta, .solid-action, .home-case .case-picture > span) {
  --button-glint: #dcf4c8;
  --button-edge: #081b14;
  box-shadow: inset 0 1px #ffffff35, inset 0 2px var(--button-recess, transparent),
              0 var(--button-depth, 2px) var(--button-edge);

  &::before {
    background-image: linear-gradient(110deg, transparent 22%, var(--button-glint) 50%, transparent 76%);
    background-size: 230% 100%;
    background-position: var(--button-sweep, 100%) 0;
  }

  &:disabled {
    --button-depth: 0px;
  }

  @media (prefers-reduced-motion: no-preference) {
    translate: 0 var(--button-travel, 0px);
    transition: translate var(--button-response, 220ms) var(--final-motion-ease),
                box-shadow var(--button-response, 220ms) var(--final-motion-ease);
  }
}

:is(.solid-action, .button-light, .home-case .case-picture > span) {
  --button-glint: #9ebd7a;
  --button-edge: #718565;
}

/* Text actions keep their lighter weight and put the feedback along the reading edge. */
:is(a:is(.quiet-action, .rule-action, .interior-link, .entry-contact, .back-link,
         .text-link, .practice-questions a, .lens-bottom > a), .work-card .interior-link)::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: currentColor;
  pointer-events: none;
  scale: var(--button-rule, 0) 1;
  transform-origin: left;

  @media (prefers-reduced-motion: no-preference) {
    transition: scale var(--button-response, 260ms) var(--final-motion-ease);
  }
}

.quiet-action { --button-arrow-x: 0px; --button-arrow-y: 4px; }
:is(.back-link, [data-stage-prev]) { --button-arrow-x: -4px; --button-arrow-y: 0px; }
:is(.lens-tab, [data-stage-next]) { --button-arrow-y: 0px; }
:is(.lens-tab, .stage-tabs button, .segmented button, .lens-scenarios button) {
  --button-focus-offset: -4px;
}
body.journal-v2 .site-header :is(.nav-cta, .menu-toggle):focus-visible {
  outline-color: #315f42;
}
body.journal-v2 .filter[aria-pressed="true"]:focus-visible {
  outline: 2px solid #315f42;
  outline-offset: 3px;
}

@media(prefers-reduced-motion:reduce) {
  .home-case:hover img,.work-card:hover img { transform:none; }
  .menu-toggle .menu-icon i { transition:none; }
  html {scroll-behavior:auto;}
}
body .skip-link:focus { background:var(--final-paper); color:var(--final-green); outline:2px solid var(--final-green); }

.site-icon {
  display:inline-block; width:1em; height:1em; flex:none; vertical-align:-.14em;
  fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round;
}
.menu-icon .site-icon { width:23px; height:23px }
.menu-toggle .menu-close-icon, .menu-toggle[aria-expanded="true"] .menu-open-icon { display:none }
.menu-toggle[aria-expanded="true"] .menu-close-icon { display:inline-block }
