@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/space-grotesk-400.ttf") format("truetype");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/space-grotesk-500.ttf") format("truetype");
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/chakra-petch-400.ttf") format("truetype");
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/chakra-petch-500.ttf") format("truetype");
}
:root {
  color-scheme: dark;
  --bg: #0c1013;
  --text: #e0e5e7;
  --muted: #a1adb3;
  --accent: #a5f6ed;
  --line: #303b42;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
}
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}


h1 { font-size: 21px; line-height: 1.3; font-weight: 500; letter-spacing: -.4px; margin: 0 0 16px; }
h1 a { text-decoration: none; }
nav { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
nav a { color: var(--muted); text-decoration: none; padding: 3px 0; }
nav a:hover { text-decoration: underline; }
p { margin: 0 0 12px; }
.social-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.social-links a { padding-block: 4px; text-decoration: none; }
#work { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
h2 { font-size: 14px; color: var(--muted); font-weight: 400; margin: 0 0 14px; }
h3 { font-size: 16px; font-weight: 500; margin: 0 0 8px; }
h3 a { color: var(--accent); }
.project p { font-size: 15px; }
figure { margin: 14px 0 0; }
.trace-link { display: block; }
.trace-link img { display: block; width: 100%; height: auto; }
figcaption { margin-top: 10px; font-size: 12px; color: var(--muted); }
figcaption a { white-space: nowrap; }
.skip-link { position: fixed; top: 10px; left: 10px; transform: translateY(-150%); padding: 12px; background: var(--accent); color: var(--bg); z-index: 10; }
.skip-link:focus { transform: translateY(0); }
dialog { width: min(1400px,94vw); max-height: 92vh; padding: 24px; background: var(--bg); color: var(--text); border: 1px solid var(--line); }
dialog::backdrop { background: #000c; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.dialog-header h2 { font-size: 16px; color: var(--text); margin: 0; }
.dialog-header button { font: inherit; font-size: 14px; background: none; border: 1px solid var(--line); color: var(--text); padding: 8px 16px; cursor: pointer; min-height: 44px; }
dialog p, .original-link { font-size: 13px; color: var(--muted); }
.trace-scroll { overflow: auto; max-height: 64vh; background: white; }
.trace-scroll img { display: block; width: 1800px; max-width: none; height: auto; }
.original-link { display: inline-block; margin-top: 15px; }
body:has(dialog[open]) { overflow: hidden; }
dialog[open] { animation: expand .18s ease-out; }
@keyframes expand { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 650px) {
  .page { grid-template-columns: minmax(0,1fr); gap: 22px; width: calc(100% - 40px); margin-top: 28px; margin-bottom: 48px; }
  .sidebar { position: static; }
  h1 { margin-bottom: 16px; }
  nav { flex-direction: row; gap: 25px; }
  nav a { padding-block: 8px; }
  #work { margin-top: 26px; }
  dialog { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Each pixel star has an independent cadence and phase. */
body { isolation: isolate; background: radial-gradient(ellipse at 80% 100%, #25495d 0, #142a3b 35%, var(--bg) 78%); background-attachment: fixed; }
h1, nav { font-family: "Chakra Petch", system-ui, sans-serif; }
.star-field { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.star-field span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  background: #c3def0;
}
@media (prefers-reduced-motion: no-preference) {
  .star-field span { animation: pixel-twinkle calc(var(--duration) * .25) ease-in-out var(--delay) infinite alternate; }
}
@keyframes pixel-twinkle { from { opacity: .65; } to { opacity: 1; } }
@media (forced-colors: active) { .star-field { display: none; } }

html { scroll-snap-type: y mandatory; scroll-padding-top: 0; }
.page { display: block; margin: 0 auto; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-snap-type: y proximity; }
}

.social-links { align-items: center; gap: 12px; }
.social-links .social-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; }
.social-icon svg { display: block; width: 24px; height: 24px; fill: currentColor; }

.email-address { color: var(--muted); font-size: 14px; margin-top: 12px; }
.project + .project { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.project figure img { display: block; width: 100%; height: auto; }

/* Transparent header and centered page sections. */
.page { width: min(1120px, calc(100% - 80px)); }
.sidebar {
  position: fixed;
  inset: 0 0 auto;
  transform: none;
  width: auto;
  padding: 20px max(40px, calc((100vw - 1120px) / 2));
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  z-index: 2;
}
.sidebar h1 { margin: 0; font-size: 20px; letter-spacing: .035em; }
.sidebar nav { flex-direction: row; gap: 28px; }
.sidebar nav a { padding: 8px 0; }
#main { margin: 0; }
#about, #work {
  min-height: 100svh;
  margin: 0;
  padding: 100px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  border: 0;
}
.intro-content { width: min(100%, 570px); margin-inline: auto; }
#work > h2 { margin-bottom: 28px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.project { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); align-items: center; gap: 48px; }
.project h3 { font-family: "Chakra Petch", system-ui, sans-serif; font-size: 23px; margin-bottom: 16px; }
.project p { margin-bottom: 0; }
.project figure { margin: 0; min-width: 0; }
@media (max-width: 700px) {
  .page { width: calc(100% - 40px); }
  .sidebar { padding: 14px 20px; }
  .sidebar h1 { font-size: 18px; }
  .sidebar nav { gap: 20px; }
  #about, #work { padding: 100px 0; }
}

/* A continuous sky, gently quieter around the central reading area. */
.star-field {
  -webkit-mask-image: radial-gradient(ellipse 42% 32% at 50% 50%, #0005 0%, #000a 55%, #000 100%);
  mask-image: radial-gradient(ellipse 42% 32% at 50% 50%, #0005 0%, #000a 55%, #000 100%);
}
/* Selected work shares one compact section rather than one screen per project. */
#work { width: min(100%, 820px); margin-inline: auto; }
#work > h2 { margin-bottom: 20px; }
#work .project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 28px;
  align-items: center;
}
#work .project + .project { margin-top: 24px; padding-top: 24px; }
#work .project h3 { font-size: 19px; margin-bottom: 10px; }
#work .project p { font-size: 14px; }
#work .project figure { margin: 0; }
#work .project-copy, #work .project figure { grid-column: auto; grid-row: auto; }
@media (max-width: 600px) {
  #work .project { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  #work .project figure { width: min(100%, 280px); }
}

/* Let the identity and navigation float directly over the sky. */
.sidebar h1, .sidebar nav {
  text-shadow: 0 1px 6px var(--bg), 0 0 14px var(--bg);
}


#about { position: relative; }
.scroll-cue {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--muted);
  font-size: 24px;
  text-decoration: none;
}

/* Individual stars are attenuated behind the full introduction bounds. */
.star-field span { background: rgb(195 222 240 / var(--star-visibility, 1)); }

.scroll-cue { color: var(--accent); }

/* A growing collection uses ordinary scrolling instead of page snapping. */
html.media-page { scroll-snap-type: none; }
.media-main { padding: 140px 0 80px; }
.media-title { font-family: "Chakra Petch", system-ui, sans-serif; font-size: 24px; color: var(--text); margin-bottom: 10px; }
.media-intro { color: var(--muted); font-size: 14px; }
.media-group { margin-top: 22px; }
.media-group h3 { font-size: 13px; color: var(--accent); margin-bottom: 8px; }
.media-list { list-style: none; padding: 0; margin: 0; }
.media-list li { padding: 6px 0; }
.media-list li > span:not(.media-item-title) { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.sidebar nav a[aria-current="page"] { color: var(--accent); }
@media (max-width: 450px) {
  .sidebar nav { gap: 14px; font-size: 14px; }
  .media-main { padding-top: 110px; }
}

