/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --paper: #efeeea;
  --paper-raised: #f7f6f2;
  --ink: #16181b;
  --muted: #83837a;
  --muted-2: #adaca2;
  --line: #d9d7cf;
  --accent: #3a5a40;
  --accent-soft: #e3e8e0;

  --display: "Space Grotesk", sans-serif;
  --body: "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", monospace;

  --content-width: 780px;
  --wide-width: 1100px;
  --edge: clamp(24px, 5vw, 72px);

  --dur: 0.6s;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0.01s; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--edge);
  mix-blend-mode: normal;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paper);
  opacity: 0.86;
  backdrop-filter: blur(6px);
  z-index: -1;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.site-header.scrolled::before { border-bottom-color: var(--line); }

.brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.main-nav {
  display: flex;
  gap: 28px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.main-nav a {
  text-decoration: none;
  color: var(--muted);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--ink); }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--accent);
}

/* ============================================================
   RUNNING INDEX (signature element)
   ============================================================ */
.index-rail {
  position: fixed;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 90;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.index-rail.visible { opacity: 1; }

.index-rail .rail-track {
  position: relative;
  width: 1px;
  height: 160px;
  background: var(--line);
}
.index-rail .rail-fill {
  position: absolute;
  top: 0; left: 0;
  width: 1px;
  background: var(--accent);
  height: 0%;
  transition: height 0.15s linear;
}

@media (max-width: 900px) {
  .index-rail { display: none; }
}

/* ============================================================
   VIEWS / ROUTING
   ============================================================ */
.view {
  display: none;
  padding-top: 96px;
}
.view.active { display: block; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 40px var(--edge) 80px;
  max-width: var(--wide-width);
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 5.4vw, 64px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0.4em 0 0.5em;
  max-width: 18ch;
}

.hero .lede {
  max-width: 56ch;
  color: var(--muted);
  font-size: 17px;
}

.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.3em);
  filter: blur(6px);
  animation: word-in var(--dur) var(--ease) forwards;
}
@keyframes word-in {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ============================================================
   WORK LIST
   ============================================================ */
.work-list {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 var(--edge) 120px;
}

.work-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 32px;
}

#work-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 40px 28px;
}

@media (max-width: 560px) {
  #work-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 18px; }
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper-raised);
}

.project-row {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.project-row.in-view { opacity: 1; transform: translateY(0); }

.project-row .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
  margin-bottom: 14px;
}
.project-row .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.project-row:hover .thumb img,
.project-row:focus-visible .thumb img {
  transform: scale(1.045);
}

.project-row .num {
  position: absolute;
  top: 10px; left: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper);
  background: rgba(22, 24, 27, 0.55);
  padding: 3px 8px;
  border-radius: 100px;
  backdrop-filter: blur(3px);
}

.project-row .draft-tag {
  position: absolute;
  top: 10px; right: 10px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--accent);
  border-radius: 100px;
  padding: 3px 9px;
}

.project-row .titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-row .title {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.project-row .cats {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-row:hover .title { color: var(--accent); }

/* ============================================================
   DETAIL VIEW
   ============================================================ */
.detail {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--edge) 140px;
}

.detail-banner {
  max-width: var(--wide-width);
  margin: 0 auto 36px;
  padding: 0 var(--edge);
}
.detail-banner img {
  width: 100%;
  aspect-ratio: 1296 / 300;
  object-fit: cover;
  border-radius: 2px;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.detail-banner img.in-view {
  opacity: 1;
  transform: scale(1);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 40px;
}
.back-link:hover { color: var(--accent); }

.detail-head .num {
  font-family: var(--mono);
  color: var(--muted-2);
  font-size: 13px;
}

.detail-head h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.015em;
  margin: 0.2em 0 0.4em;
}

.detail-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 32px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-meta .role {
  font-family: var(--body);
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-size: 14px;
}
.detail-meta .role strong {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.block {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.block.in-view { opacity: 1; transform: translateY(0); }

.block-text {
  font-size: 17px;
  margin: 0 0 22px;
  max-width: 68ch;
}

.block-heading {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 48px 0 18px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.block-heading:first-child { border-top: none; margin-top: 0; }

.block-image { margin: 28px 0; }
.block-image img {
  width: 100%;
  border-radius: 2px;
}

.block-video { margin: 28px 0; }
.video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--ink);
  border-radius: 2px;
  overflow: hidden;
}
.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-wrap {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 var(--edge) 140px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 800px) {
  .about-wrap { grid-template-columns: 1fr; }
}

.about-wrap .block-text { font-size: 18px; max-width: 60ch; }

.about-photo img { border-radius: 3px; }

.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 100px;
  padding: 12px 22px;
  transition: all 0.2s ease;
}
.resume-btn:hover { background: var(--ink); color: var(--paper); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  padding: 40px var(--edge) 60px;
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.site-footer a { text-decoration: none; color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
