/* A shared visual language: warm neutrals, cardinal accents, consistent surfaces. */
:root {
  font-size: 112.5%;
  color-scheme: light;
  --cardinal: #8c1515;
  --ink: #292725;
  --muted: #6e6862;
  --rule: #e4dfd7;
  --paper: #f6f4ef;
  --surface: #fffefa;
  --wash: #f8e6df;
  --green: #287451;
  --green-wash: #eaf4eb;
  --gold-wash: #fff1d9;
  --btn-bg: #8c1515;
  --btn-fg: #fff;
  --font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --cardinal: #f0988f;
  --ink: #f0ece6;
  --muted: #b7aea5;
  --rule: #3c3732;
  --paper: #1a1917;
  --surface: #24221f;
  --wash: #432b27;
  --green: #9bd7b1;
  --green-wash: #24382b;
  --gold-wash: #3c3021;
  --btn-bg: #a52b27;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(ellipse at 90% 0%, var(--wash), transparent 45%), var(--paper); color: var(--ink); font: 1rem/1.7 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--cardinal); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--cardinal); outline-offset: 5px; border-radius: 3px; }
.skip { position: fixed; top: 12px; left: -999px; z-index: 100; padding: 10px 20px; background: var(--btn-bg); color: white; }
.skip:focus { left: 12px; }
.page { max-width: 1500px; margin: auto; padding: 0 48px; display: grid; grid-template-columns: 258px minmax(0,1fr); gap: 64px; }
.rail { position: sticky; top: 0; height: 100dvh; min-height: 620px; align-self: start; padding: 52px 28px 32px 0; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 28px; overflow-y: auto; scrollbar-width: thin; }
.eyebrow { margin: 0 0 10px; color: var(--cardinal); font-size: .66rem; font-weight: 700; letter-spacing: .14em; line-height: 1.6; }
h1 { margin: 0; font-size: 2.15rem; letter-spacing: -.055em; line-height: 1.15; }
h1 a { text-decoration: none; }
.brand-dot { color: var(--cardinal); }
.school { margin: 16px 0 0; color: var(--muted); font-size: .79rem; line-height: 1.8; }
.nav { counter-reset: navigation; list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.nav a { counter-increment: navigation; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 6px; text-decoration: none; font-size: .8rem; font-weight: 500; color: var(--muted); border: 1px solid transparent; transition: background .18s, color .18s; }
.nav a::before { content: '0' counter(navigation); display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 7px; background: var(--wash); color: var(--cardinal); font-size: .65rem; font-weight: 700; font-variant-numeric: tabular-nums; transition: background-color .2s, color .2s; }
.nav a::after { content: '↗'; margin-left: auto; opacity: 0; transform: translate(-4px, 3px); transition: opacity .2s, transform .2s; }
.nav a:hover, .nav a:focus-visible { color: var(--cardinal); background: var(--wash); border-color: var(--cardinal); box-shadow: 0 3px 10px #8c151512; }
.nav a:hover::after, .nav a:focus-visible::after, .nav a.active::after { opacity: 1; transform: none; }
.nav a.active, .nav a.active:hover, .nav a.active:focus-visible { color: #fff; background: linear-gradient(110deg, #8c1515, #ba382c); border-color: #8c1515; box-shadow: 0 4px 12px #8c151529; }
.nav a.active::before { color: #fff; background: #ffffff26; }
.nav a:active { transform: scale(.97); }
@media (max-width: 1150px) { .nav a::after { display: none; } }
@media (prefers-reduced-motion: reduce) { .nav a:active, .nav a::after { transform: none; } }
.rail-actions { display: flex; gap: 8px; }
.btn { display: inline-flex; justify-content: space-between; align-items: center; gap: 26px; border: 1px solid var(--btn-bg); border-radius: 6px; padding: 10px 18px; background: var(--btn-bg); color: var(--btn-fg); font-size: .8rem; font-weight: 600; text-decoration: none; }
.btn:hover { filter: brightness(1.15); color: #fff; }
.icon-btn { width: 44px; min-height: 44px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--cardinal); }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.rail-contact { margin-top: auto; display: grid; gap: 6px; font-size: .75rem; color: var(--muted); }
.rail-contact a { width: fit-content; text-decoration: none; }
main { min-width: 0; padding: 48px 0 24px; }
main:focus { outline: none; }
section { padding: 30px; border: 1px solid var(--rule); border-top: 3px solid var(--cardinal); border-radius: 12px; background: var(--surface); scroll-margin-top: 28px; }
section + section { margin-top: 28px; }
.section-heading { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--rule); }
.section-title { display: flex; gap: 13px; align-items: center; }
.section-number { display: inline-grid; place-items: center; flex-shrink: 0; height: 30px; width: 32px; border: 1px solid var(--rule); border-radius: 5px; color: var(--btn-fg); background: var(--btn-bg); font-size: .7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
h2 { font-size: 1.35rem; line-height: 1.3; letter-spacing: -.035em; margin: 0; font-weight: 600; }
.hero { display: grid; grid-template-columns: minmax(0,1fr) 166px; gap: 30px; align-items: center; }
.portrait { display: block; width: 166px; height: 190px; object-fit: cover; object-position: center 35%; border-radius: 8px; background: var(--wash); border: 1px solid var(--rule); }
.lead { margin: 0; font-size: clamp(2rem,3.5vw,3.25rem); font-weight: 600; line-height: 1.12; letter-spacing: -.055em; }
.nw { white-space: nowrap; }
.wave { display: inline-block; font-size: .7em; }
.intro { margin: 20px 0 0; font-size: .92rem; }
.hero .intro { color: var(--muted); font-size: .87rem; }
strong { font-weight: 600; color: var(--ink); }
.opportunity { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px; background: var(--green-wash); border: 1px solid color-mix(in srgb, var(--green) 30%, var(--rule)); border-radius: 6px; font-size: .82rem; }
.status-dot { width: 8px; height: 8px; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 12%, transparent); border-radius: 50%; flex-shrink: 0; }
.interests { margin-top: 22px; padding: 0; border: 1px solid var(--cardinal); border-radius: 8px; overflow: clip; background: var(--gold-wash); }
.interests summary { cursor: pointer; padding: 16px 18px; list-style: none; }
.interests summary::-webkit-details-marker { display: none; }
.interests-heading { display: flex; align-items: center; gap: 9px; font-size: .88rem; font-weight: 600; line-height: 1.4; }
.disclosure-icon { display: inline-grid; place-items: center; margin-left: auto; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-fg); font-size: 1.2rem; transition: transform .25s; }
.disclosure-hint { display: block; margin-top: 6px; color: var(--cardinal); font-size: .74rem; font-weight: 500; }
.when-open { display: none; }
.interests[open] .when-open { display: inline; }
.interests[open] .when-closed { display: none; }
.interests[open] .disclosure-icon { transform: rotate(45deg); }
.interests .points { padding: 0 18px 18px; margin-top: 0; }
@media (hover: hover) { .interests summary:hover { background: var(--wash); } }
.interests summary:focus-visible { outline-offset: -5px; }
.points { list-style: none; padding: 0; margin: 16px 0 0; font-size: .84rem; color: var(--muted); }
.points li { position: relative; padding-left: 28px; margin-top: 10px; }
.points .em { position: absolute; left: 0; }
.more { font-weight: 600; color: var(--ink); }
.entry { display: grid; grid-template-columns: 125px minmax(0,1fr); gap: 22px; padding: 24px 0; border-top: 1px solid var(--rule); }
.entry:first-child { padding-top: 0; border-top: 0; }
.entry:last-child { padding-bottom: 0; }
.when { font-size: .73rem; color: var(--muted); line-height: 1.65; }
.what { min-width: 0; }
.what h3 { margin: 0; font-size: 1.02rem; line-height: 1.4; font-weight: 600; letter-spacing: -.02em; }
.what .sub { margin: 5px 0 0; color: var(--muted); font-size: .79rem; }
.what p { margin: 12px 0 0; font-size: .85rem; }
.what ul { list-style: none; margin: 14px 0 0; padding: 0; }
.what li { position: relative; padding-left: 15px; margin: 8px 0 0; font-size: .84rem; }
.what li::before { content: ''; position: absolute; left: 0; top: .73em; width: 4px; height: 4px; background: var(--cardinal); border-radius: 50%; }
.education { margin-top: 24px; padding-bottom: 0; }
.what .chips, .chips { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 14px 0 0; gap: 7px; }
.what .chips li, .chips li { margin: 0; padding: 4px 9px; border: 1px solid var(--rule); border-radius: 4px; color: var(--muted); background: var(--paper); font-size: .7rem; line-height: 1.5; }
.what .chips li::before { display: none; }
#projects .cols { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
#projects .entry { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
#projects .when { color: var(--cardinal); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
#projects .what { display: flex; flex-direction: column; flex: 1; }
#projects .what h3 { font-size: 1.25rem; }
a.link { display: inline-block; width: fit-content; margin-top: 18px; padding-bottom: 2px; color: var(--cardinal); text-decoration: none; border-bottom: 1px solid currentColor; font-size: .82rem; font-weight: 600; }
a.link:hover { opacity: .75; }
.fig { margin: auto 0 0; padding-top: 24px; }
.fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.fig figcaption { color: var(--muted); margin-top: 10px; font-size: .65rem; }
.dg text { font-family: var(--font); fill: var(--ink); font-size: 14.5px; }
.dg .sub { fill: var(--muted); font-size: 12px; }
.dg .box { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.dg .acc { stroke: var(--cardinal); }
.dg .used { fill: var(--wash); stroke: var(--cardinal); stroke-width: 1.5; }
.dg .free { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.dg .merged { fill: var(--surface); stroke: var(--cardinal); stroke-width: 1.5; }
.dg .link { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.dg .link.acc { stroke: var(--cardinal); }
.dg marker path { fill: var(--muted); }
.dg .t { fill: var(--cardinal); font-weight: 600; }
.heap .after { opacity: 0; }
.heap[aria-pressed="true"] .after { opacity: 1; }
.heap[aria-pressed="true"] .before { opacity: 0; }
.skill-list { margin: 0; padding: 0; list-style: none; }
.skill-list li { display: grid; grid-template-columns: 125px minmax(0,1fr); gap: 22px; align-items: baseline; padding: 16px 0; border-top: 1px solid var(--rule); }
.skill-list li:first-child { padding-top: 0; border-top: 0; }
.skill-list .name { font-size: 1rem; font-weight: 600; letter-spacing: -.02em; }
.skill-list .for { color: var(--muted); font-size: .82rem; }
.also { border-top: 1px solid var(--rule); padding-top: 20px; margin: 8px 0 0; font-size: .76rem; font-weight: 600; color: var(--muted); }
.pick { color: var(--cardinal); font-weight: 500; }
#awards .entry { grid-template-columns: 165px minmax(0,1fr); }
.langs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; list-style: none; }
.what .langs { margin: 0; }
.what .langs li { margin: 0; padding: 0; }
.what .langs li::before { display: none; }
.langs .big { display: block; font-size: 1.1rem; font-weight: 600; }
.langs .lbl { display: block; color: var(--muted); font-size: .7rem; margin-top: 4px; }
#contact > p:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0; }
footer { margin-top: 26px; padding: 0 2px; color: var(--muted); font-size: .7rem; }
.glow { display: none; }
@media (max-width: 1150px) {
  .page { padding: 0 28px; grid-template-columns: 218px minmax(0,1fr); gap: 32px; }
  .rail { padding-right: 20px; }
  section { padding: 24px; }
  .hero { grid-template-columns: minmax(0,1fr) 130px; gap: 20px; }
  .portrait { width: 130px; height: 160px; }
  #projects .cols { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 860px) {
  :root { --hdr: 112px; }
  .page { display: block; padding: var(--hdr) 20px 0; }
  .rail { position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: auto; min-height: 0; overflow: visible; padding: 14px 20px 0; border: 0; border-bottom: 1px solid var(--rule); background: var(--paper); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
  .rail .eyebrow, .school, .rail-contact { display: none; }
  .rail h1 { font-size: 1.4rem; }
  .rail-id { grid-column: 1; grid-row: 1; align-self: center; }
  .rail-actions { grid-column: 2; grid-row: 1; }
  .rail .btn { padding: 8px 12px; gap: 15px; }
  .rail .icon-btn { width: 40px; min-height: 40px; }
  .rail nav { grid-column: 1/-1; grid-row: 2; min-width: 0; }
  .nav { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; padding: 0 0 10px; }
  .nav li { flex-shrink: 0; }
  .nav a { padding: 7px 10px; font-size: .74rem; gap: 6px; white-space: nowrap; }
  .nav a::before { font-size: .6rem; }
  main { padding: 22px 0; }
  section { scroll-margin-top: calc(var(--hdr) + 18px); }
  .hero { grid-template-columns: minmax(0,1fr) 150px; }
  .portrait { width: 150px; height: 175px; }
  .lead { font-size: 2.5rem; }
}
@media (max-width: 540px) {
  :root { font-size: 106.25%; }
  .page { padding-left: 12px; padding-right: 12px; }
  .rail { padding-left: 16px; padding-right: 16px; }
  section { padding: 22px 18px; border-radius: 9px; }
  section + section { margin-top: 18px; }
  .section-heading { margin-bottom: 22px; padding-bottom: 18px; }
  h2 { font-size: 1.16rem; }
  .hero { grid-template-columns: minmax(0,1fr) 85px; gap: 15px; align-items: start; }
  .hero .eyebrow { font-size: .55rem; letter-spacing: .08em; }
  .lead { font-size: 1.85rem; }
  .nw { white-space: normal; }
  .portrait { width: 85px; height: 104px; }
  .hero-text { display: contents; }
  .hero .eyebrow { grid-column: 1; margin-bottom: 0; }
  .hero .lead { grid-column: 1; }
  .hero .portrait { grid-column: 2; grid-row: 1 / span 2; }
  .hero .intro { grid-column: 1/-1; margin-top: 0; }
  .hero .wave { display: none; }
  .intro { font-size: .85rem; }
  .hero-text .intro { font-size: .8rem; }
  .opportunity { font-size: .77rem; padding: 12px; }
  .entry, #awards .entry { grid-template-columns: minmax(0,1fr); gap: 8px; padding: 20px 0; }
  .entry:last-child { padding-bottom: 0; }
  .when br { display: block; }
  .skill-list li { grid-template-columns: minmax(0,1fr); gap: 3px; }
  #projects .entry { padding: 18px; }
  .langs { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
  #contact a.link { font-size: .76rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Small, deliberate responses to hover, focus, and touch. */
section { transition: border-color .25s, box-shadow .25s; }
.section-number { transition: transform .25s, background-color .25s, color .25s; }
.entry .what, .skill-list .name, .portrait, .nav a, .btn, .icon-btn, a.link, .motion-button { transition: transform .25s cubic-bezier(.2,.7,.2,1), color .2s, background-color .2s, box-shadow .2s; }
.language-skills { margin-top: 24px; }
.language-skills h3 { margin: 0; font: 600 .8rem/1.5 var(--font); color: var(--ink); }
.chips li:has(.motion-button) { padding: 0; border: 0; background: transparent; }
.motion-button { display: block; width: 100%; color: inherit; font: inherit; text-align: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.chips .motion-button { padding: 5px 10px; background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; }
.langs .motion-button { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 12px 10px; height: 100%; }
.langs li { min-width: 0; }
.langs .big { font-size: 1rem; }
.skill-list .motion-button { display: inline-block; width: auto; padding: 0; border: 0; background: transparent; }
.motion-button:active, .btn:active, .icon-btn:active { transform: scale(.95); }
.heap { cursor: pointer; border-radius: 6px; touch-action: manipulation; }
.heap .before, .heap .after { transition: opacity .3s; }
.heap[aria-pressed="true"] { background: var(--wash); }
@media (hover: hover) and (pointer: fine) {
  section:hover { border-color: var(--cardinal); box-shadow: 0 6px 24px color-mix(in srgb, var(--cardinal) 7%, transparent); }
  section:hover .section-number { background: var(--cardinal); color: var(--surface); }
  .portrait:hover { transform: translateY(-4px) rotate(1deg); box-shadow: 0 8px 20px #0002; }
  .nav a:hover, .btn:hover, .icon-btn:hover, a.link:hover { transform: translateY(-2px); }
  .motion-button:hover { transform: translateY(-3px); color: var(--cardinal); }
  .chips .motion-button:hover, .langs .motion-button:hover { border-color: var(--cardinal); background: var(--wash); box-shadow: 0 4px 10px #0001; }
  .heap:not([data-interacted]):hover .after { opacity: 1; }
  .heap:not([data-interacted]):hover .before { opacity: 0; }
}
.motion-button:focus-visible { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) {
  section:hover .section-number, .entry:hover > .what, .entry:focus-within > .what,
  .portrait:hover, .nav a:hover, .btn:hover, .icon-btn:hover, a.link:hover,
  .motion-button:hover, .motion-button:active, .motion-button:focus-visible,
  .btn:active, .icon-btn:active { transform: none; }
}

#projects .entry { background: linear-gradient(145deg, var(--wash), var(--paper) 65%); }
.langs .motion-button { border-top: 3px solid var(--cardinal); background: var(--wash); }
#contact { background: linear-gradient(120deg, var(--surface) 35%, var(--wash)); }

@media print {
  .page { display: block; padding: 0; }
  .rail { position: static; height: auto; min-height: 0; border: 0; padding: 0; }
  .rail nav, .rail-actions, .rail-contact, .skip { display: none; }
  main { padding-top: 20px; }
  section { break-inside: avoid; }
  details > * { display: block; }
}
