/* Layout: Ledger. Sticky intro + portrait on the left, work scrolling on the right.
   Palette "Kitsap": spruce water, copper (the beard), sea glass, fog. One dark identity, by choice. */
:root {
  --spruce-950: #08191a;
  --spruce-900: #0c2223;
  --spruce-800: #12302f;
  --line: rgba(159, 216, 196, 0.14);
  --fog: #e4ece7;
  --muted: #8fa8a0;
  --copper: #e8793b;
  --copper-soft: rgba(232, 121, 59, 0.14);
  --seaglass: #9fd8c4;
  --seaglass-soft: rgba(159, 216, 196, 0.1);

  --f-display: "Archivo", "Arial Narrow", sans-serif;
  --f-body: "Schibsted Grotesk", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--spruce-950);
  color: var(--fog);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--copper); color: var(--spruce-950); }

a { color: inherit; }
a:focus-visible,
summary:focus-visible { outline: 2px solid var(--copper); outline-offset: 4px; border-radius: 4px; }

#sound {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.skip {
  position: absolute;
  left: -999px;
  top: 12px;
  background: var(--copper);
  color: var(--spruce-950);
  padding: 8px 14px;
  border-radius: 6px;
  z-index: 10;
}
.skip:focus { left: 16px; }

.shell {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 64px;
}

/* ---------- left ---------- */

.intro {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  /* same space above the portrait and below the links; both shrink on short screens so the links never touch the edge */
  padding-block: clamp(40px, 9vh, 88px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vh, 28px);
}

.portrait {
  width: 148px;
  aspect-ratio: 1;
  max-width: 100%;
  border-radius: 22px;
  object-fit: cover;
  object-position: 50% 30%;
  outline: 2px solid var(--copper);
  outline-offset: 6px;
  background: #000;
}

.name {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 900;
  font-stretch: 68%;
  font-size: clamp(3.4rem, 6.4vw, 5.6rem);
  line-height: 0.86;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.role {
  margin: 12px 0 0;
  font-size: 1.25rem;
  font-weight: 500;
}


.blurb {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}
.nav a::before {
  content: "";
  width: 32px;
  height: 1px;
  background: currentColor;
  transition: width 0.25s ease;
}
.nav a:hover,
.nav a.active { color: var(--fog); }
.nav a.active::before { width: 64px; background: var(--copper); }

.intro-foot {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.location {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.location b { color: var(--seaglass); font-weight: 500; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.links a {
  display: inline-block;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.2s, color 0.2s;
}
.links a:hover { border-color: var(--copper); color: var(--copper); }

/* ---------- right ---------- */

.content {
  padding-block: clamp(40px, 9vh, 88px) 96px;
  display: grid;
  gap: 96px;
  min-width: 0;
}

.section { display: grid; gap: 24px; scroll-margin-top: 48px; }

.label {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--seaglass);
  margin: 0;
}

.about p {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
}
.about p + p { margin-top: 16px; }
.about strong { color: var(--fog); font-weight: 500; }

/* cases */

.cases { display: grid; gap: 8px; }

.case {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  padding: 22px;
  margin-inline: -22px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s, opacity 0.25s;
}
.case:hover,
.case:focus-within {
  background: var(--seaglass-soft);
  border-color: var(--line);
}
@media (hover: hover) {
  .cases:hover .case:not(:hover) { opacity: 0.55; }
}

.years {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: 5px;
  font-variant-numeric: tabular-nums;
}

.case-body { display: grid; gap: 10px; min-width: 0; }

.case h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}
.case h3 a { text-decoration: none; }
.case h3 a::after {
  content: "↗";
  display: inline-block;
  margin-left: 6px;
  font-size: 0.9em;
  color: var(--copper);
  transition: transform 0.2s;
}
.case:hover h3 a { color: var(--copper); }
.case:hover h3 a::after { transform: translate(3px, -3px); }

.case p { margin: 0; color: var(--muted); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--seaglass);
  background: var(--seaglass-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

details { margin-top: 4px; }
summary {
  cursor: pointer;
  width: fit-content;
  list-style: none;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "+ "; }
details[open] summary::before { content: "− "; }

.study {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
}
.study div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; }
.study dt {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.study dd { margin: 0; color: var(--fog); font-size: 0.95rem; }

/* more work */

.more {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.more li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}
.more .yr { font-family: var(--f-mono); font-size: 0.75rem; color: var(--muted); }
.more a { text-decoration: none; font-weight: 500; }
.more a:hover { color: var(--copper); }
.more span:last-child { font-size: 0.85rem; color: var(--muted); text-align: right; }

.footer {
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 52ch;
}
.footer p { margin: 0; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 0; }
  .intro { position: static; height: auto; padding-block: 56px 16px; }
  .nav { display: none; }
  .portrait { width: 112px; }
  .content { padding-block: 48px 72px; gap: 72px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .shell {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .case { grid-template-columns: 1fr; gap: 6px; padding: 18px 14px; margin-inline: -14px; }
  .study div { grid-template-columns: 1fr; gap: 2px; }
  .more li { grid-template-columns: 44px minmax(0, 1fr); }
  .more span:last-child { grid-column: 2; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- typed role ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.role .co { color: var(--copper); }
.role .at { opacity: 1; transition: opacity 0.5s ease; }
.role.typing .at { opacity: 0; }
.role .typed { color: var(--fog); }

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.15em;
  background: var(--copper);
  opacity: 0;
}
.role.typing .caret { opacity: 1; animation: blink 0.9s steps(1) infinite; }
.role.landed .caret { animation: blink 0.9s steps(1) 3, fade 0.4s ease 2.7s forwards; opacity: 1; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes fade { to { opacity: 0; } }

/* ---------- side quests ---------- */

.quests {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.quest {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(12, 34, 35, 0.72);
  backdrop-filter: blur(6px);
}
.quest h3 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.quest p { margin: 0; color: var(--muted); }

.quest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
}

.kicker {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* a little channel meter: sea glass in the body, copper at the peak */
.meter { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.meter i {
  width: 4px;
  height: 100%;
  border-radius: 1px;
  background: linear-gradient(to top, var(--seaglass) 0 70%, var(--copper) 70% 100%);
  transform-origin: bottom;
  transform: scaleY(0.4);
  animation: level 1.2s ease-in-out infinite alternate;
}
.meter i:nth-child(2) { animation-duration: 0.9s; animation-delay: -0.3s; }
.meter i:nth-child(3) { animation-duration: 1.4s; animation-delay: -0.7s; }
.meter i:nth-child(4) { animation-duration: 0.8s; animation-delay: -0.2s; }
.meter i:nth-child(5) { animation-duration: 1.1s; animation-delay: -0.9s; }
.meter i:nth-child(6) { animation-duration: 1.3s; animation-delay: -0.4s; }
.meter i:nth-child(7) { animation-duration: 1s; animation-delay: -0.6s; }
@keyframes level { from { transform: scaleY(0.25); } to { transform: scaleY(0.95); } }

.level {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--copper);
  border: 1px solid var(--copper);
  border-radius: 4px;
  padding: 2px 8px;
  background: var(--copper-soft);
}

@media (prefers-reduced-motion: reduce) {
  .meter i { transform: scaleY(0.7); }
}

/* ---------- small outbound links under a case or quest ---------- */

.case-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.case-links a {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--fog);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.case-links a::after { content: " ↗"; color: var(--copper); }
.case-links a:hover { color: var(--copper); border-color: var(--copper); }
