/* base.css: reset, type, gutters, buttons, links, focus, skip link, nav, footer, toast, view transitions. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 64px); }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.62;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums lining-nums;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--copper); color: var(--pine-deep); }
p, li, dd, figcaption, summary, blockquote { text-wrap: pretty; }

/* Gutters and wrap */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--g));
  margin-inline: auto;
  padding-inline: max(var(--g), env(safe-area-inset-left, 0px)) max(var(--g), env(safe-area-inset-right, 0px));
}

/* Type: Newsreader upright, weights 300 and 400 only */
.display {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: normal;
  font-optical-sizing: auto;
  letter-spacing: -.02em;
  line-height: 1.04;
  text-wrap: balance;
}
h1, h2, h3, h4 { text-wrap: balance; }
.fs-xl, .t-mega, .t-hero { font-size: var(--fs-xl); }
.fs-l, .t-1 { font-size: var(--fs-l); }
.fs-m, .t-2 { font-size: var(--fs-m); }
.fs-stat { font-size: var(--fs-stat); }
.t-3 { font-size: var(--fs-body-l); }
.small, .fs-s { font-size: var(--fs-s); line-height: 1.5; }
.measure { max-width: 62ch; }
.lede { font-size: var(--fs-body-l); color: var(--ink-2); line-height: 1.55; }
.fig, [data-e], [data-countup] { font-variant-numeric: tabular-nums lining-nums; }
.on-night, .on-pine { color: var(--on-pine); }
.night, .pine { background: var(--pine); }

/* Old glass class names are solid now; glass lives only on the nav and the hero stats strip */
.glass-thin, .glass-regular, .glass-thick { background: var(--cream-raised); border: 1px solid var(--line); }
.glass-night { background: var(--pine-deep); color: var(--on-pine); border: 1px solid var(--line-pine); }

/* Focus: 2px copper-text on cream, copper-on-pine on pine, 3px offset */
:focus-visible { outline: 2px solid var(--copper-text); outline-offset: 3px; }
.on-night :focus-visible, .night :focus-visible, .on-pine :focus-visible, .pine :focus-visible,
[data-surface="pine"] :focus-visible { outline-color: var(--copper-on-pine); }

/* Links: underline, never an arrow glyph */
.link, .link-arrow {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
  color: var(--copper-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 5px;
  transition: text-decoration-color var(--dur-1) var(--ease-out);
}
.link:hover, .link-arrow:hover { text-decoration-color: currentColor; }
.on-night .link, .night .link, .on-pine .link, [data-surface="pine"] .link,
.on-night .link-arrow, .night .link-arrow, [data-surface="pine"] .link-arrow { color: var(--copper-on-pine); text-decoration-color: var(--line-pine); }
.text-link {
  display: inline-flex; align-items: center; min-height: 44px; font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--line-strong); text-underline-offset: 5px;
}
.text-link:hover { text-decoration-color: currentColor; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--s5);
  border: 1px solid var(--ink);
  border-radius: var(--r-1);
  background: var(--ink);
  color: var(--cream);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.btn:hover { background: var(--pine-deep); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--cream-2); border-color: var(--ink); }
.on-night .btn, .night .btn, [data-surface="pine"] .btn { background: var(--on-pine); color: var(--pine); border-color: var(--on-pine); }
.on-night .btn--ghost, .night .btn--ghost, [data-surface="pine"] .btn--ghost { background: transparent; color: var(--on-pine); border-color: var(--line-pine); }
.on-night .btn--ghost:hover, .night .btn--ghost:hover, [data-surface="pine"] .btn--ghost:hover { background: transparent; border-color: var(--copper-on-pine); color: var(--copper-on-pine); }
.btn.btn--copper, .night .btn.btn--copper, .on-night .btn.btn--copper, [data-surface="pine"] .btn.btn--copper {
  background: var(--copper); border-color: var(--copper); color: var(--on-copper);
}
.btn.btn--copper:hover, .night .btn.btn--copper:hover, .on-night .btn.btn--copper:hover, [data-surface="pine"] .btn.btn--copper:hover {
  background: var(--copper-on-pine); border-color: var(--copper-on-pine); color: var(--on-copper);
}

/* Skip link */
.skip {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 12px 20px; min-height: 44px;
  border-radius: var(--r-1);
  background: var(--ink); color: var(--cream);
  font-weight: 500; text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus, .skip:focus-visible { transform: none; outline-color: var(--copper-on-pine); }

/* Nav: fixed full-width glass bar. nav.js sets data-nav-surface="pine|cream" from the section under it. */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding-inline: max(var(--g), env(safe-area-inset-left, 0px)) max(var(--g), env(safe-area-inset-right, 0px));
  background: var(--glass-pine);
  border-bottom: 1px solid var(--line-pine);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  color: var(--on-pine);
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.nav[data-nav-surface="cream"] { background: var(--glass-cream); border-bottom-color: var(--line); color: var(--ink); }
@supports not (backdrop-filter: blur(1px)) {
  .nav { background: var(--pine-deep); }
  .nav[data-nav-surface="cream"] { background: var(--cream-raised); }
}
.nav__brand {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--font-display); font-size: var(--fs-body-l); font-weight: 400; letter-spacing: -.01em;
  text-decoration: none; white-space: nowrap;
}
.nav__links { display: flex; align-items: center; gap: var(--s1); margin-left: auto; }
.nav__links a, .nav__resume {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3);
  font-size: var(--fs-s); font-weight: 500; text-decoration: none;
}
.nav__links a { text-underline-offset: 8px; text-decoration-thickness: 2px; }
.nav__links a:hover { text-decoration: underline; text-decoration-color: var(--line-pine); }
.nav[data-nav-surface="cream"] .nav__links a:hover { text-decoration-color: var(--line-strong); }
.nav__links a[aria-current="true"], .nav__links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--copper-on-pine); }
.nav[data-nav-surface="cream"] .nav__links a[aria-current="true"],
.nav[data-nav-surface="cream"] .nav__links a[aria-current="page"] { text-decoration-color: var(--copper-text); }
.nav__resume { padding: 0 var(--s4); border: 1px solid var(--copper); border-radius: var(--r-1); background: var(--copper); color: var(--on-copper); }
.dl-i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav__resume, .btn--copper { gap: var(--s2); }
.nav__resume:hover { background: var(--copper-on-pine); border-color: var(--copper-on-pine); }
.nav__search {
  position: relative; display: inline-flex; align-items: center;
  width: 210px; min-height: 40px;
  border: 1px solid var(--line-pine); border-radius: var(--r-1);
  background: rgba(243, 238, 223, .06); color: var(--on-pine-2);
  transition: border-color var(--dur-1) var(--ease-out);
}
.nav__search:hover, .nav__search:focus-within { border-color: var(--on-pine-2); }
.nav__search .nav__search-i { position: absolute; left: var(--s3); pointer-events: none; }
.nav__search-in {
  width: 100%; min-height: 38px; padding: 0 var(--s3) 0 38px;
  border: 0; background: transparent; color: inherit;
  font: inherit; font-size: var(--fs-s); font-weight: 500;
}
.nav__search-in::placeholder { color: currentColor; opacity: 1; }
.nav__search-in:focus-visible { outline: none; }
.nav__search-in::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.nav__search:focus-within { outline: 2px solid var(--copper-on-pine); outline-offset: 3px; }
.nav__search-i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav__search-btn { display: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 1px solid var(--line-pine); border-radius: var(--r-1); background: transparent; color: inherit; cursor: pointer; }
.nav[data-nav-surface="cream"] .nav__search { border-color: var(--line-strong); background: var(--cream-raised); color: var(--ink-2); }
.nav[data-nav-surface="cream"] .nav__search:focus-within { outline-color: var(--copper-text); }
.nav[data-nav-surface="cream"] .nav__search-btn { border-color: var(--line-strong); }
.nav :focus-visible { outline-color: var(--copper-on-pine); }
.nav[data-nav-surface="cream"] :focus-visible { outline-color: var(--copper-text); }
/* In-place search results under the nav field */
.nsearch { position: absolute; top: calc(100% + 8px); right: -1px; z-index: 30; width: max(100%, 300px); padding: var(--s2); background: var(--cream-raised); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-1); box-shadow: 0 12px 32px rgba(12, 33, 28, .22); }
.nsearch[hidden], .nsearch__list[hidden], .nsearch__empty[hidden] { display: none; }
.nsearch__list { max-height: min(60vh, 400px); overflow-y: auto; }
.nsearch__opt { display: flex; align-items: center; min-height: 40px; padding: 0 var(--s3); border-radius: var(--r-1); font-size: var(--fs-s); font-weight: 500; cursor: pointer; }
.nsearch__opt[aria-selected="true"] { background: var(--pine); color: var(--on-pine); }
.nsearch__empty { padding: var(--s3); font-size: var(--fs-s); color: var(--ink-2); }
@media (max-width: 1099px) { .nav__search { width: 170px; } }
@media (max-width: 899px) {
  .nav__links { display: none; }
  .nav__search { display: none; }
  .nav__search-btn { display: inline-flex; margin-left: auto; }
}

/* Footer: link columns over a dithered mountain range traced from an Appalachian sunrise photo (js/footer-ridge.js draws it) */
.footer {
  position: relative; display: grid; width: 100%; min-height: 720px; overflow: hidden; isolation: isolate;
  background: var(--cream); color: var(--ink); border-top: 1px solid var(--line);
}
.footer__frame {
  position: relative; display: grid; grid-template-rows: auto auto minmax(340px, 1fr);
  width: 100%; max-width: var(--wrap); margin: 0 auto;
}
.footer__frame::before, .footer__frame::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 1px; z-index: 3; pointer-events: none;
  background: linear-gradient(to bottom, var(--line) calc(100% - 440px), transparent calc(100% - 360px)); transform-origin: 50% 0;
}
.footer__frame::before { left: 0; }
.footer__frame::after { right: 0; }
.footer--js .footer__frame::before, .footer--js .footer__frame::after { transform: scaleY(0); transition: transform 1.4s cubic-bezier(.2,.7,.1,1); }
.footer--js .footer__frame::after { transition-delay: .08s; }
.footer--js.is-in .footer__frame::before, .footer--js.is-in .footer__frame::after { transform: scaleY(1); }
/* Each item rises out of a soft blur, one after another (delays come from data-d) */
.footer--js .footer__r {
  opacity: 0; transform: translateY(12px); filter: blur(5px);
  transition: opacity .9s cubic-bezier(.2,.7,.1,1), transform 1s cubic-bezier(.2,.7,.1,1), filter .9s ease;
  transition-delay: calc(var(--d, 0) * 1ms);
}
.footer--js.is-in .footer__r { opacity: 1; transform: none; filter: none; }

.footer__top {
  position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(0, 1fr));
  gap: var(--s6); padding: clamp(48px, 6.4vw, 80px) var(--g) clamp(28px, 4vw, 48px);
}
.footer__brand { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.footer__logo {
  display: inline-flex; align-items: center; gap: var(--s3); min-height: 44px; color: var(--ink); text-decoration: none;
  font: 400 30px/1 var(--font-display); letter-spacing: -.01em;
}
.footer__mark { width: 34px; height: 24px; display: block; overflow: visible; }
.footer__mark path { fill: var(--pine); }
.footer__mark circle { fill: var(--copper); }
.footer__mark rect { fill: var(--cream); transition: transform .7s cubic-bezier(.2,.7,.1,1); }
.footer__logo:hover .footer__mist-a { transform: translateX(4px); }
.footer__logo:hover .footer__mist-b { transform: translateX(-5px); }
.footer__tag { margin: 0; max-width: 40ch; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.footer__social { display: flex; gap: 6px; margin: 0 0 0 -10px; padding: 0; list-style: none; }
.footer__social a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-1); color: var(--ink-2);
  transition: color .3s ease, background-color .3s ease, transform .45s cubic-bezier(.2,.7,.1,1);
}
.footer__social a:hover { color: var(--pine); background: var(--pine-tint); transform: translateY(-2px); }
.footer__social svg { width: 18px; height: 18px; display: block; }
.footer__col-t { margin: 6px 0 14px; font: 600 11px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.footer__link {
  position: relative; display: inline-flex; align-items: center; gap: var(--s2); min-height: 36px;
  color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.3;
  transition: color .3s ease, transform .5s cubic-bezier(.2,.7,.1,1);
}
.footer__link::before {
  content: ""; position: absolute; left: -12px; top: 50%; width: 7px; height: 1px; background: var(--copper);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s cubic-bezier(.2,.7,.1,1);
}
.footer__link:hover { color: var(--copper-text); transform: translateX(7px); }
.footer__link:hover::before { transform: scaleX(1); }
.footer__badge {
  font: 600 10px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px 3px; border-radius: var(--r-pill);
  color: var(--copper-text); background: var(--copper-tint);
}
.footer__bar {
  position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  padding: 0 var(--g); font-size: var(--fs-s); color: var(--ink-2);
}
.footer__bar p { margin: 0; }
.footer__up {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px;
  transition: color .3s ease, text-decoration-color .3s ease;
}
.footer__up:hover { color: var(--copper-text); text-decoration-color: currentColor; }
.footer__up svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .45s cubic-bezier(.2,.7,.1,1); }
.footer__up:hover svg { transform: translateY(-3px); }
.footer__scene { position: relative; z-index: 1; width: 100vw; margin: -64px 0 0 calc(50% - 50vw); overflow: hidden; cursor: crosshair; }
.footer__scene canvas { position: absolute; left: 0; bottom: 0; display: block; max-width: none; image-rendering: pixelated; image-rendering: crisp-edges; }
@media (max-width: 860px) {
  .footer__top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 36px; }
  .footer__brand, .footer__col--work { grid-column: 1 / -1; }
  .footer__col--work ul { grid-template-columns: repeat(2, minmax(0, max-content)); column-gap: var(--s6); }
}
@media (max-width: 560px) {
  .footer { min-height: 0; }
  .footer__frame { grid-template-rows: auto auto minmax(240px, 1fr); }
  .footer__frame::before, .footer__frame::after { display: none; }
  .footer__col--work ul { grid-template-columns: minmax(0, 1fr); }
  .footer__bar { flex-direction: column; align-items: flex-start; gap: 0; }
  .footer__scene { margin-top: -36px; }
}
@media (prefers-reduced-motion: reduce) {
  .footer--js .footer__r, .footer--js .footer__frame::before, .footer--js .footer__frame::after,
  .footer__link, .footer__link::before, .footer__social a, .footer__mark rect, .footer__up, .footer__up svg { transition: none; }
  .footer--js .footer__r { filter: none; }
  .footer__link:hover, .footer__social a:hover, .footer__up:hover svg { transform: none; }
}

/* Toast: solid, no glass */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); z-index: 90;
  padding: var(--s3) var(--s5);
  border-radius: var(--r-1);
  background: var(--pine-deep); color: var(--on-pine);
  font-size: var(--fs-body); font-weight: 500;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* View Transitions: 200ms crossfade between pages */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 200ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 120ms !important; animation: none !important; }
  .toast, .toast.is-on { transform: translate(-50%, 0); }
  @view-transition { navigation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}


/* Visually hidden */
.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; }
main:focus { outline: none; }
video:focus, video:focus-visible { outline: 2px solid var(--copper-text); outline-offset: 3px; }
@media (max-width: 719px) { html { scroll-padding-top: calc(var(--nav-h) + 16px); } }

/* Phone menu (nav.js shows the button and toggles .is-open) */
.nav__menu { display: none; align-items: center; gap: var(--s2); min-height: 44px; min-width: 44px; padding: 0 var(--s3); border: 1px solid var(--line-pine); border-radius: var(--r-1); background: transparent; color: inherit; font-size: var(--fs-s); font-weight: 600; cursor: pointer; }
.nav__menu svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav[data-nav-surface="cream"] .nav__menu { border-color: var(--line-strong); }
.nav__links-resume { display: none !important; }
@media (max-width: 899px) {
  .nav.has-menu .nav__menu { display: inline-flex; }
  .nav.has-menu.is-open .nav__links {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    padding: var(--s2) max(var(--g), env(safe-area-inset-left, 0px)) var(--s4);
    background: var(--pine-deep); color: var(--on-pine); border-bottom: 1px solid var(--line-pine);
  }
  .nav.has-menu.is-open .nav__links a { min-height: 48px; padding: 0; font-size: var(--fs-body); border-bottom: 1px solid var(--line-pine); }
  .nav.has-menu.is-open .nav__links .nav__links-resume { display: inline-flex !important; color: var(--copper-on-pine); border-bottom: 0; }
}
@media (max-width: 559px) {
  .nav.has-menu .nav__resume { display: none; }
  .nav__menu span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav__menu { padding: 0; justify-content: center; }
}
