:root {
  --bg: #efe6d4;
  --paper: #f8f2e6;
  --line: #cdbd9c;
  --ink: #2a2118;
  --soft: #5e5243;
  --dim: #8a7c66;
  --accent: #c2410c;
  --gold: #9a5b0f;
  --pixel: "Silkscreen", ui-monospace, monospace;
  --sans: "Archivo", system-ui, sans-serif;
  --gap: clamp(12px, 3vw, 36px);
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: var(--gap); min-height: 100vh; color: var(--ink); font: 16px/1.6 var(--sans); }
::selection { background: var(--accent); color: var(--paper); }
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
svg { display: block; width: 100%; height: 100%; }

/* ---------- frame ---------- */
.frame {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  height: calc(100vh - 2 * var(--gap));
  height: calc(100dvh - 2 * var(--gap));
  min-height: 560px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.top { position: relative; display: flex; justify-content: center; align-items: center; padding: 18px 24px 0; min-height: 56px; }
.logo { font: 28px/1 var(--pixel); color: var(--accent); text-decoration: none; letter-spacing: .02em; }
.logo:hover { color: var(--ink); }
.sections { position: absolute; right: 24px; top: 20px; display: flex; gap: 22px; }
.sections a { font: 14px/1 var(--pixel); text-decoration: none; color: var(--soft); padding: 6px 0; border-bottom: 3px solid transparent; }
.sections a:hover { color: var(--ink); }
.sections a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- stage: avatar | content | rail ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) 44px; min-height: 0; }

.avatar { margin: 0; padding: 0 0 64px 96px; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 0; }
.bubble {
  position: relative; align-self: center; margin: 0 0 22px 18%;
  font: 18px/1 var(--pixel); color: var(--accent); background: var(--paper);
  padding: 12px 16px;
  /* stepped pixel border */
  box-shadow: 0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink);
}
.bubble::after {
  content: ""; position: absolute; right: 18px; bottom: -16px; width: 8px; height: 12px; background: var(--ink);
  box-shadow: 4px -4px 0 var(--ink);
}
.portrait {
  position: relative; width: min(100%, 330px); aspect-ratio: 1 / 1; max-height: calc(100% - 80px);
  display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(42,33,24,.04) 10px 20px);
  border: 3px dashed var(--line);
}
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; z-index: 1; } /* square crop: a little off the top, a bit more off the bottom */
.portrait:has(img) { border: 0; background: none; }
.ph { font: 13px/1.4 var(--pixel); color: var(--dim); text-align: center; }

.content { min-height: 0; overflow-y: auto; padding: 24px 28px 40px 8px; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.view { margin: auto 0; max-width: 560px; }
.view + .view { margin-top: 56px; } /* without JS every section stacks */
.view[hidden] { display: none; }

h1 { font-weight: 800; font-size: clamp(34px, 4.2vw, 56px); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 18px; }
.lede { margin: 0 0 30px; color: var(--soft); font-size: 20px; }
/* "start" in the headline: pixel font, steady underline, links to Experience */
h1 .start { position: relative; font-family: var(--pixel); font-weight: 400; color: var(--accent); letter-spacing: -.02em; text-decoration: none; }
h1 .start::after { content: ""; position: absolute; left: 0; right: .1em; bottom: -.02em; height: .08em; background: var(--accent); }
h1 .start:hover { color: var(--ink); }
h1 .start:hover::after { background: var(--ink); }

.menu { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.menu a { display: flex; align-items: center; gap: 10px; font: 15px/1.6 var(--pixel); text-decoration: none; color: var(--ink); padding: 2px 0; outline: none; }
.menu a svg { width: 10px; height: 18px; color: var(--accent); visibility: hidden; flex: none; }
.menu a.sel { color: var(--accent); }
.menu a.sel svg { visibility: visible; animation: blink 1s steps(2, start) infinite; }
.menu a:focus-visible { text-decoration: underline 2px; text-underline-offset: 5px; }
.keys { margin: 18px 0 0; font: 11px/1 var(--pixel); color: var(--dim); }
@keyframes blink { to { visibility: hidden; } }
@media (hover: none) { .keys { display: none; } }

/* ---------- section views ---------- */
.back { display: inline-block; font: 13px/1 var(--pixel); text-decoration: none; color: var(--dim); margin-bottom: 14px; }
.back:hover { color: var(--accent); }
h2 { font: 30px/1.1 var(--pixel); margin: 0 0 20px; color: var(--accent); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.cards li { background: var(--paper); padding: 14px 18px; box-shadow: 0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink), 6px 6px 0 var(--line); margin: 3px; }
.cards h3 { margin: 0; font-size: 18px; font-weight: 700; }
.cards h3 a { text-decoration: none; }
.cards h3 a::after { content: " ↗"; color: var(--accent); }
.cards h3 a:hover { color: var(--accent); }
.cards .meta { margin: 2px 0 6px; font: 11px/1.6 var(--pixel); color: var(--gold); }
.cards p { margin: 0; color: var(--soft); font-size: 15px; }

.exp { list-style: none; margin: 0; padding: 0; }
.exp li { display: grid; grid-template-columns: 16ch 1fr; gap: 0 16px; padding: 12px 0; border-top: 2px dashed var(--line); }
.exp li:first-child { border-top: 0; padding-top: 0; }
.exp .when { font: 12px/1.9 var(--pixel); color: var(--gold); white-space: nowrap; }
.exp p { margin: 0; color: var(--soft); font-size: 15px; }
.exp .role { color: var(--ink); font-weight: 700; font-size: 16px; }
.exp .role span { font-weight: 400; color: var(--soft); }

.awards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.awards li { display: flex; gap: 14px; align-items: center; font-size: 17px; font-weight: 500; }
.awards svg { width: 18px; height: 18px; color: var(--gold); flex: none; }
.awards small { font: 11px/1 var(--pixel); color: var(--dim); margin-left: 6px; }

/* ---------- right rail ---------- */
.rail { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 22px; }
.rail::before, .rail::after { content: ""; width: 4px; height: 60px; background: repeating-linear-gradient(var(--gold) 0 4px, transparent 4px 12px); }
.rail a { width: 10px; height: 10px; background: var(--gold); transform: rotate(45deg); transition: transform .15s; }
.rail a:hover { transform: rotate(45deg) scale(1.3); }
.rail a[aria-current="page"] { background: var(--accent); transform: rotate(45deg) scale(1.6); }

/* ---------- bottom-left dock ---------- */
.dock { position: absolute; left: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 14px; z-index: 2; }
.dock a { position: relative; display: block; width: 28px; height: 28px; color: var(--gold); }
.dock a:hover, .dock a:focus-visible { color: var(--accent); }
.dock span { position: absolute; left: 40px; top: 50%; transform: translateY(-50%); font: 12px/1 var(--pixel); color: var(--paper); background: var(--ink); padding: 6px 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; }
.dock a:hover span, .dock a:focus-visible span { opacity: 1; }

/* ---------- small screens: one column, page scrolls ---------- */
@media (max-width: 860px) {
  .frame { display: block; height: auto; min-height: calc(100dvh - 2 * var(--gap)); overflow: visible; padding-bottom: 76px; }
  .top { flex-direction: column; gap: 14px; padding: 20px 16px 0; }
  .sections { position: static; gap: 18px; }
  .stage { display: block; }
  .avatar { padding: 28px 16px 0; }
  .portrait { width: min(64%, 240px); max-height: none; }
  .bubble { margin-bottom: 18px; font-size: 15px; }
  .content { overflow: visible; padding: 28px 20px 8px; }
  .view { margin: 0; }
  .rail { display: none; }
  .dock { left: 0; right: 0; bottom: 18px; flex-direction: row; justify-content: center; gap: 28px; }
  .dock span { display: none; }
  .exp li { grid-template-columns: 1fr; }
  /* inside a section the portrait would push the content off screen */
  body[data-view]:not([data-view=""]) .avatar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .menu a.sel svg { animation: none; }
}

/* ---------- gallery: coming soon ---------- */
.soon { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 24px 120px; min-height: 0; }
.soon h1 { font: clamp(40px, 8vw, 72px)/1 var(--pixel); color: var(--accent); margin: 10px 0 18px; letter-spacing: 0; }
.soon-msg { font: 20px/1 var(--pixel); margin: 0 0 22px; }
.soon-msg .dots::after { content: ""; display: inline-block; width: 3ch; text-align: left; animation: dots 1.6s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }
.loading { width: min(320px, 80%); height: 24px; padding: 4px; margin: 0 0 22px; box-shadow: 0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink); background: var(--paper); }
.loading i { display: block; height: 100%; width: 66%; background: repeating-linear-gradient(90deg, var(--accent) 0 12px, transparent 12px 16px); }
.soon .lede { margin: 0; }
.dock a[aria-current="page"] { color: var(--accent); }
@media (max-width: 860px) { .soon { padding: 64px 20px 40px; } }
@media (prefers-reduced-motion: reduce) { .soon-msg .dots::after { animation: none; content: "..."; } }
