/* ---------------------------------------------------------------------------
   The resume over the memories: film-title restraint.

   The scenes carry the picture, so the type stays out of their way -- white on
   a soft scrim, one warm accent taken from the light itself, the name and the
   titles in Anton (kept from the original portfolio), body copy in Inter.
   --------------------------------------------------------------------------- */

:root {
  --ink:   #0b0c09;
  --paper: #f5f0e4;
  --text:  rgba(245, 240, 228, 0.90);
  --muted: rgba(245, 240, 228, 0.72);
  --faint: rgba(245, 240, 228, 0.16);
  --wash:  rgba(245, 240, 228, 0.07);
  --gold:  #f1cf8b;
  --gold-soft: rgba(241, 207, 139, 0.70);

  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --pad: clamp(22px, 5.5vw, 92px);
  --top: clamp(96px, 16vh, 150px);
  --bottom: 104px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font: 400 16px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 10;
  padding: 10px 16px; background: var(--paper); color: var(--ink);
  font-weight: 600; text-decoration: none; border-radius: 6px;
  transition: top 0.2s;
}
.skip:focus { top: 16px; }

/* --- the world ------------------------------------------------------------ */
#world {
  position: fixed; inset: 0; z-index: 0;
  background: var(--ink) center / cover no-repeat;
  transition: background-image 0.8s ease;
}
body[data-scene="canopy"] #world { background-image: url(../assets/poster-canopy.jpg); }
body[data-scene="reeds"]  #world { background-image: url(../assets/poster-reeds.jpg); }
body[data-scene="field"]  #world { background-image: url(../assets/poster-field.jpg); }
body[data-scene="peaks"]  #world { background-image: url(../assets/poster-peaks.jpg); }
body[data-scene="ferns"]  #world { background-image: url(../assets/poster-ferns.jpg); }
#world canvas { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
body.world-ready #world canvas { opacity: 1; }
body.no-webgl #world canvas { display: none; }

/* Legibility. A gradient, not a blurred panel: backdrop-filter over a live
   WebGL canvas re-blurs the whole region every frame, and a scrim reads as
   the picture's own shadow rather than as a box laid on top of it. */
.scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 8, 6, 0.80) 0%, rgba(7, 8, 6, 0.60) 30%, rgba(7, 8, 6, 0.18) 56%, rgba(7, 8, 6, 0) 72%),
    linear-gradient(180deg, rgba(7, 8, 6, 0.50) 0%, rgba(7, 8, 6, 0) 20%),
    linear-gradient(0deg, rgba(7, 8, 6, 0.55) 0%, rgba(7, 8, 6, 0) 24%);
  transition: opacity 1s ease;
}
/* The landing keeps the light: only the lower-left corner the name sits in. */
body[data-view="home"] .scrim {
  background:
    radial-gradient(130% 100% at 0% 100%, rgba(7, 8, 6, 0.78) 0%, rgba(7, 8, 6, 0.42) 42%, rgba(7, 8, 6, 0) 72%),
    linear-gradient(180deg, rgba(7, 8, 6, 0.40) 0%, rgba(7, 8, 6, 0) 18%);
}

/* --- chrome --------------------------------------------------------------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px var(--pad);
}
.brand {
  font: 400 19px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--paper); text-decoration: none; white-space: nowrap;
  transition: opacity 0.4s;
}
body[data-view="home"] .brand { opacity: 0; pointer-events: none; }
.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px clamp(14px, 2.2vw, 32px); }
.nav a {
  position: relative; padding: 8px 0;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: color 0.3s;
}
.nav a:hover { color: var(--paper); }
.nav a[aria-current="page"] { color: var(--paper); }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0.22em; bottom: 2px; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav-num { color: var(--gold-soft); margin-right: 8px; font-variant-numeric: tabular-nums; }

.pager {
  position: fixed; right: var(--pad); bottom: 26px; z-index: 3;
  display: flex; align-items: center; gap: 14px;
  transition: opacity 0.4s;
}
body[data-view="home"] .pager { opacity: 0; pointer-events: none; }
.pager-pos {
  min-width: 62px; text-align: center;
  font-size: 11.5px; letter-spacing: 0.24em; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pager-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--faint); background: rgba(7, 8, 6, 0.25); color: var(--paper);
  font: 400 17px/1 var(--body); cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
}
.pager-btn:hover { border-color: var(--gold-soft); background: rgba(7, 8, 6, 0.45); }

/* --- views ---------------------------------------------------------------- */
main { position: fixed; inset: 0; z-index: 2; outline: none; }
.view {
  position: absolute; inset: 0;
  display: flex; align-items: flex-start;
  padding: var(--top) var(--pad) var(--bottom);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--faint) transparent;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.view.is-active { opacity: 1; transition: opacity 0.6s ease; }
.view[hidden] { display: none; }

/* The entrance: each block drifts up in turn as the cut lands. */
.rise {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.9s ease, transform 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * 75ms + 80ms);
}
.view.is-active .rise { opacity: 1; transform: none; }

.panel { width: min(100%, 38rem); margin: auto 0; }

.kicker {
  display: inline-block;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--gold);
}
.panel > p:first-child { margin: 0 0 12px; }
.title {
  margin: 0 0 30px;
  font: 400 clamp(54px, 7.4vw, 112px)/0.9 var(--display);
  letter-spacing: 0.01em; text-transform: uppercase; color: var(--paper);
  text-shadow: 0 2px 34px rgba(0, 0, 0, 0.35);
}
.title-xl { font-size: clamp(64px, 10vw, 150px); }
p { margin: 0 0 14px; color: var(--text); text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35); }
.label {
  margin: 18px 0 8px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--muted);
}

/* home */
.view-home { align-items: flex-end; padding-bottom: clamp(84px, 15vh, 150px); }
.home-name {
  display: grid; margin: 0 0 30px;
  font: 400 clamp(84px, 15.5vw, 240px)/0.84 var(--display);
  letter-spacing: 0.005em; color: var(--paper);
  /* The name crosses the canopy's white core; a wide soft shadow keeps the
     letterforms from dissolving into it without drawing a box. */
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.25), 0 6px 90px rgba(0, 0, 0, 0.55);
}
.home-sub { font-size: 14px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.cta {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 14px;
  padding: 14px 22px 14px 24px; border: 1px solid var(--gold-soft); border-radius: 999px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--paper); text-decoration: none;
  transition: border-color 0.3s, background 0.3s;
}
.cta:hover { background: rgba(241, 207, 139, 0.12); }
.cta > span { position: relative; }
/* The auto-enter countdown fills the button from the left. */
.cta-fill {
  position: absolute !important; inset: 0; z-index: 0;
  background: rgba(241, 207, 139, 0.16);
  transform: scaleX(0); transform-origin: left;
}
body.auto-entering .cta-fill { animation: fill var(--auto-enter, 3500ms) linear forwards; }
@keyframes fill { to { transform: scaleX(1); } }

/* profile */
.profile { display: grid; grid-template-columns: 148px 1fr; gap: 28px; align-items: start; }
.profile figure { margin: 4px 0 0; }
.portrait {
  aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  outline: 1px solid rgba(245, 240, 228, 0.18); outline-offset: -1px;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
/* A second portrait tucks in at the first one's lower corner. */
.pair { position: relative; margin-bottom: 34px !important; }
.portrait-alt {
  position: absolute; width: 58%; right: -22px; bottom: -34px;
  transform: rotate(3deg); outline-color: rgba(245, 240, 228, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.role { font-size: 12px; font-weight: 500; letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold); }
.profile-body p:not(.label) { font-size: 17px; }
.actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }

/* chips */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; }
/* A dark translucent base, not a light wash: the chips have to read over
   the field's grass and the peaks' lit slope as well as over shadow. */
.chips li {
  padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; line-height: 1.5; color: var(--paper);
  background: rgba(7, 8, 6, 0.46); border: 1px solid rgba(245, 240, 228, 0.16);
}

/* buttons and links */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 16px 11px 18px; border-radius: 999px;
  border: 1px solid var(--faint); background: rgba(7, 8, 6, 0.2);
  font-size: 12px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--paper); text-decoration: none;
  transition: border-color 0.3s, background 0.3s;
}
.btn:hover { border-color: var(--gold-soft); background: rgba(241, 207, 139, 0.10); }
.btn small { font-size: 13px; font-weight: 400; letter-spacing: 0.02em; text-transform: none; color: var(--muted); }
.btn-arrow { color: var(--gold); }
.textlink {
  display: inline-flex; align-items: center; gap: 8px; margin-right: 18px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--paper); text-decoration: none; border-bottom: 1px solid var(--gold-soft); padding-bottom: 2px;
}
.textlink small { display: none; }

/* entries: experience, projects, education */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 30px; }
.entry { padding-bottom: 28px; border-bottom: 1px solid var(--faint); }
.entry:last-child { border-bottom: 0; padding-bottom: 0; }
.entry-row { display: flex; gap: 22px; align-items: flex-start; }
.entry-main { flex: 1; min-width: 0; }
.entry-head { display: flex; align-items: center; gap: 14px; }
.plate {
  flex: none; width: 42px; height: 42px; border-radius: 10px; overflow: hidden;
  background: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.plate img { width: 100%; height: 100%; object-fit: contain; }
.entry-title {
  margin: 0; font: 400 28px/1.05 var(--display); letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--paper);
}
.entry-sub { margin: 3px 0 0; font-size: 15px; color: var(--muted); }
.entry-meta { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--faint); color: var(--muted);
}
.status-upcoming, .status-current { border-color: var(--gold-soft); color: var(--gold); }
.entry-photo {
  flex: none; width: 92px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  transition: transform 0.6s var(--ease);
}
.entry-photo:hover { transform: scale(1.06) rotate(-1deg); }
.entry-photo.wide { width: 100%; aspect-ratio: auto; margin-top: 14px; }
.entry-photo.wide:hover { transform: none; }
.bullets { margin: 12px 0 0; padding-left: 18px; }
.bullets li { margin: 0 0 8px; font-size: 15px; color: var(--text); }
.bullets li::marker { color: var(--gold-soft); }

.award {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  margin: 14px 0 0; padding: 6px 14px 6px 6px; border-radius: 999px;
  border: 1px solid var(--gold-soft); background: rgba(241, 207, 139, 0.08);
  font-size: 13px; color: var(--text);
}
.award img { width: 26px; height: 26px; border-radius: 50%; background: #fff; object-fit: contain; }
.award strong { color: var(--gold); letter-spacing: 0.14em; font-size: 12px; }
.award span { letter-spacing: 0.14em; font-size: 12px; font-weight: 600; }
.award em { font-style: normal; color: var(--muted); }

.more { margin-top: 14px; }
.more summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold);
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "+"; font-size: 15px; letter-spacing: 0; transition: transform 0.3s; }
.more[open] summary::after { transform: rotate(45deg); }
.links { margin-top: 14px; }

/* skills */
.skills { display: grid; gap: 22px; }
.skill .label { margin-top: 0; }

/* contact */
.contact-links { display: grid; gap: 12px; justify-items: start; }
.btn-lg { padding: 16px 22px 16px 24px; font-size: 13px; }

.noscript { position: fixed; inset: 0; z-index: 5; padding: 12vh var(--pad); background: var(--ink); }
.noscript h1 { font: 400 72px/1 var(--display); text-transform: uppercase; margin: 0 0 16px; color: var(--paper); }

/* --- phones and narrow windows --------------------------------------------- */
@media (max-width: 820px) {
  :root { --top: 84px; --bottom: 92px; }
  .top { padding: 18px var(--pad); }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
    flex-wrap: nowrap; justify-content: flex-start; gap: 22px;
    overflow-x: auto; scrollbar-width: none;
    padding: 14px var(--pad) calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(0deg, rgba(7, 8, 6, 0.85), rgba(7, 8, 6, 0.55) 70%, rgba(7, 8, 6, 0));
  }
  .nav::-webkit-scrollbar { display: none; }
  .pager { display: none; }
  .scrim {
    background:
      linear-gradient(180deg, rgba(7, 8, 6, 0.55) 0%, rgba(7, 8, 6, 0.30) 30%, rgba(7, 8, 6, 0.55) 70%, rgba(7, 8, 6, 0.80) 100%);
  }
  .profile { grid-template-columns: 1fr; }
  .profile figure { width: 132px; }
  /* The photo follows its entry's text: first, it floated above the heading
     with nothing to say whose it was. */
  .entry-row { flex-direction: column; gap: 14px; }
  .entry-photo:not(.wide) { width: 112px; }
  .title { margin-bottom: 22px; }
}

/* --- reduced motion: no drift, quick fades --------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .rise { transform: none; transition: opacity 0.25s ease; transition-delay: 0s; }
  .view, .view.is-active { transition-duration: 0.2s; }
  #world canvas { transition: none; }
  .entry-photo:hover { transform: none; }
}
