:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: #121212;
  --text: #f5f3ee;
  --muted: #9c978d;
  --border: #262420;
  --accent: #c9a24b;
  --accent-soft: rgba(201, 162, 75, 0.1);
  --grad: linear-gradient(var(--accent), var(--accent));
  --shadow: none;
  --shadow-lg: 0 12px 32px -16px rgba(0, 0, 0, 0.8);
  --radius: 12px;
  --max: 960px;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
}
.nav__name { font-weight: 600; text-decoration: none; }
.nav__links { display: flex; gap: 24px; }
.nav__links a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav__links a:hover { color: var(--text); }

main { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero { padding: 96px 0 80px; }
.eyebrow {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  max-width: 14ch;
}
.hero h1 em { color: var(--muted); }
.hero__lede {
  margin-top: 28px;
  max-width: 58ch;
  font-size: 18px;
  color: var(--muted);
}
.hero__lede a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--surface); }
.btn--primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--primary:hover { background: var(--text); opacity: 0.9; }

/* Sections */
.section { padding: 64px 0; border-top: 1px solid var(--border); }
.section__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 36px;
  margin-bottom: 32px;
}

/* Projects */
.projects { display: grid; gap: 20px; }
.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s ease;
}
.project:hover { border-color: var(--accent); }
.project__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.project h3 { font-size: 22px; font-weight: 600; }
.project__role { color: var(--muted); font-size: 14px; }
.project > p { color: var(--muted); max-width: 70ch; }

.stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 18px;
  font-size: 14px;
}
.stats strong { color: var(--accent); font-weight: 600; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags li {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
}

.project__link {
  display: inline-block;
  margin-top: 20px;
  font-weight: 500;
  text-decoration: none;
  color: var(--accent);
}
.project__link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Timeline */
.timeline { list-style: none; }
.timeline li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.timeline li:last-child { border-bottom: none; }
.timeline__when { color: var(--muted); font-size: 14px; padding-top: 2px; }
.timeline h3 { font-size: 17px; font-weight: 600; }
.timeline h3 span { color: var(--muted); font-weight: 400; }
.timeline p { color: var(--muted); margin-top: 4px; font-size: 15px; }

/* Contact */
.contact p { color: var(--muted); margin-bottom: 24px; font-size: 18px; }

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 24px 48px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 640px) {
  .nav { padding: 14px 16px; }
  .nav__links { gap: 16px; }
  main { padding: 0 16px; }
  .footer { padding: 32px 16px 40px; }
  .hero { padding: 64px 0 56px; }
  .project { padding: 22px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
}

/* Featured: ZykoStudy */
.featured__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}
.featured__head .eyebrow { margin-bottom: 8px; }
.featured__head .section__title { font-size: clamp(40px, 6vw, 56px); margin-bottom: 0; }
.featured__lede { font-size: 19px; color: var(--muted); max-width: 62ch; }

.metrics {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 36px 0;
}
.metrics li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.metrics strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
  color: var(--accent);
}
.metrics span { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); }

.featured__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.featured__cols h3 { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.checklist { list-style: none; }
.checklist li {
  position: relative;
  padding: 8px 0 8px 22px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 15px;
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.checklist strong { color: var(--text); font-weight: 600; }

@media (max-width: 760px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .featured__cols { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
  .nav__name { flex-shrink: 0; }
  .nav__links a:not(:first-child):not(:last-child) { display: none; }
}

.contact__links { display: flex; flex-wrap: wrap; gap: 12px; }

.featured__role { margin-top: 10px; color: var(--muted); font-size: 15px; }
.stack { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }

/* ZykoStudy game gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 150px;
  gap: 10px;
  margin-top: 32px;
}
.g {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.g img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.g:hover img { transform: scale(1.04); }
.g figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}
.g--hero { grid-column: span 2; grid-row: span 2; }
.g--tall { grid-row: span 2; }
.g--wide { grid-column: span 2; }

@media (max-width: 640px) {
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 120px; }
  .g--tall { grid-row: span 1; }
  .g--wide { grid-column: span 1; }
  .g--wide:last-child { grid-column: span 2; }
}
.project > p + p { margin-top: 10px; }

/* Books */
.section__lede { color: var(--muted); margin: -20px 0 28px; }
.books {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.book {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.book__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.book h3 { font-size: 16px; font-weight: 600; line-height: 1.35; }
.book__author { color: var(--muted); font-size: 13px; margin-top: 2px; }
.book__rating {
  flex-shrink: 0;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
}
.book__rating small { font-family: var(--sans); font-size: 12px; margin-left: 1px; }
.book--top .book__rating { color: var(--accent); }
.book__note { margin-top: 10px; color: var(--muted); font-size: 14px; }


/* ---------- Elevated design ---------- */

::selection { background: var(--accent); color: #fff; }
html, body { overflow-x: clip; }

/* Film-grain texture over the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Floating glass nav */
.nav {
  top: 12px;
  margin-top: 12px;
  max-width: calc(var(--max) + 16px);
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  backdrop-filter: none;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.nav--scrolled {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border-color: var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(160%);
}
.nav__name { letter-spacing: -0.01em; }
.nav__links a { position: relative; transition: color 0.2s ease; }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.nav__links a:hover::after { transform: scaleX(1); }

/* Hero */
.hero { position: relative; padding: 120px 0 32px; isolation: isolate; }
.hero__glow {
  position: absolute;
  z-index: -1;
  inset: -40px -20vw 0 -20vw;
  background:
    radial-gradient(40% 50% at 20% 30%, var(--glow-a), transparent 70%),
    radial-gradient(35% 45% at 75% 20%, var(--glow-b), transparent 70%);
  filter: blur(20px);
  animation: drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3%, 4%, 0) scale(1.08); }
}


.hero h1 {
  font-size: clamp(48px, 9vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  max-width: 12ch;
}
.hero__lede { font-size: 19px; margin-top: 32px; }

.btn { transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease; }
.btn--primary { box-shadow: var(--shadow); }
.btn--primary:hover { opacity: 1; transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.facts strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: 0;
  color: var(--text);
  margin-right: 6px;
  vertical-align: -3px;
}

/* Numbered section labels */
.section { padding: 96px 0; }
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker span { color: var(--accent); }
.kicker::after {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--border);
}
.section__title { font-size: clamp(36px, 5vw, 52px); letter-spacing: -0.02em; line-height: 1.05; }
.featured__head .section__title { font-size: clamp(48px, 8vw, 84px); }

/* Cards: lift + glow on hover */
.project, .metrics li, .book, .g {
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease, opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.project:hover, .metrics li:hover, .book:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.project h3 { letter-spacing: -0.01em; }

.metrics li { position: relative; overflow: hidden; padding: 24px; }
.metrics li::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--grad);
  opacity: 0.8;
}
.metrics strong {
  font-size: clamp(44px, 5vw, 56px);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.gallery { grid-auto-rows: 170px; gap: 12px; }
.g img { transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.g:hover { box-shadow: var(--shadow-lg); }
.g:hover img { transform: scale(1.06); }
.g::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent 45%);
  pointer-events: none;
}
.g figcaption {
  z-index: 1;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.checklist li::before { background: var(--grad); }

.timeline li:hover h3 { color: var(--accent); }
.timeline h3 { transition: color 0.2s ease; }
.timeline__when { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; padding-top: 4px; }

.book--top {
  border-color: transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
}
.book--top .book__rating {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.contact .section__title { font-size: clamp(44px, 7vw, 80px); }

/* Scroll reveal (only when JS is on and motion is allowed) */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.in.project:hover,
.js .reveal.in.book:hover,
.js .metrics li.reveal.in:hover { transform: translateY(-3px); transition-delay: 0s; }

/* Hero entrance */
.js .hero > *:not(.hero__glow) { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.js .hero > :nth-child(3) { animation-delay: 0.1s; }
.js .hero > :nth-child(4) { animation-delay: 0.2s; }
.js .hero > :nth-child(5) { animation-delay: 0.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

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

@media (max-width: 640px) {
  .nav { top: 8px; margin: 8px 8px 0; padding: 10px 16px; }
  .hero { padding: 72px 0 24px; }
  .facts { gap: 12px 24px; margin-top: 40px; }
  .facts strong { font-size: 24px; }
  .section { padding: 72px 0; }
  .gallery { grid-auto-rows: 130px; }
}

/* Black + blue: primary buttons are blue */
.btn--primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn:not(.btn--primary):hover { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }

/* Gallery tiles link to the free demos */
a.g { display: block; color: inherit; text-decoration: none; }
a.g figcaption::after { content: " · Play ↗"; opacity: 0; transition: opacity 0.2s ease; }
a.g:hover figcaption::after, a.g:focus-visible figcaption::after { opacity: 1; }
a.g:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Book summary + lessons (expandable) */
.book { display: flex; flex-direction: column; }
.book__more { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.book__more summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  user-select: none;
}
.book__more summary::-webkit-details-marker { display: none; }
.book__more summary::before { content: "+ "; }
.book__more[open] summary::before { content: "\2212  "; }
.book__more p { margin-top: 10px; font-size: 14px; color: var(--text); opacity: 0.9; }
.book__more ul { margin: 10px 0 0 18px; font-size: 13.5px; color: var(--muted); }
.book__more li + li { margin-top: 4px; }
.books { align-items: start; }

/* ZykoStudy role, as prose */
.featured__story { max-width: 70ch; }
.featured__story h3 { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.featured__story p { color: var(--muted); font-size: 16px; line-height: 1.75; }
.featured__story p + p { margin-top: 14px; }
.featured__story strong { color: var(--text); font-weight: 600; }

/* Simple black / white / gold: no glow, no grain, no gradients */
.hero__glow { display: none; }
body::after { display: none; }
.metrics li::before { display: none; }
.metrics li { border-top: 2px solid var(--accent); }
.book--top { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.project:hover, .metrics li:hover, .book:hover { border-color: var(--accent); }
.nav--scrolled { background: color-mix(in srgb, var(--bg) 88%, transparent); }
::selection { background: var(--accent); color: var(--bg); }

/* Three ZykoStudy number tiles */
.metrics { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics li:last-child { grid-column: span 2; }
}

/* Game cards: uniform portrait tiles, like zykostudy.com/games */
.gallery--cards { grid-template-columns: repeat(4, 1fr); grid-auto-rows: auto; }
.gallery--cards .g { aspect-ratio: 2 / 3; grid-column: auto; grid-row: auto; }
.gallery--cards .g figcaption {
  left: 12px; bottom: 12px; right: auto;
  background: none; border: 0; backdrop-filter: none; padding: 0;
  font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
@media (max-width: 640px) {
  .gallery--cards { grid-template-columns: repeat(2, 1fr); }
  .gallery--cards .g:last-child { grid-column: auto; }
}

/* Photo next to the About Me heading */
.hero__title { display: flex; align-items: center; gap: 24px; }
.avatar {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}
@media (max-width: 640px) {
  .hero__title { gap: 16px; }
  .avatar { width: 72px; height: 72px; }
}
