/* Layout: centered column with generous side margins; dark UI over a slow field of drifting wisps. */
:root {
  color-scheme: dark;
  --bg: #0d0e11;
  --panel: rgba(20, 22, 27, 0.78);
  --panel-solid: #16181d;
  --fg: #e8e9ec;
  --muted: #a4a8b2;
  --line: #2a2e36;
  --accent: #dcc28c;          /* soft gold, echoes the warm wisps */
  --font-display: "Archivo", "Arial Black", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --radius: 10px;
  --gutter: clamp(1rem, 5vw, 3.5rem);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
}
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; image-rendering: crisp-edges; image-rendering: pixelated; }
.page-shell { position: relative; z-index: 1; }
.wrap { max-width: 68rem; margin: 0 auto; padding-inline: var(--gutter); }
.narrow { max-width: 52rem; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; text-wrap: balance; margin: 0; }
p { margin: 0; }

/* ---------- Header & navigation ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: rgba(13, 14, 17, 0.88);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-block: 0.75rem;
}
.brand { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--fg); text-decoration: none; letter-spacing: 0.01em; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.nav > li { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.45rem 0.8rem; border-radius: 6px;
  font: 600 1rem var(--font-body); color: var(--fg); text-decoration: none;
  background: none; border: 0; cursor: pointer;
}
.nav-link:hover, .nav-link[aria-expanded="true"] { background: #1d2026; color: var(--accent); }
.caret { width: 0.6em; height: 0.6em; transition: transform 0.15s; }
[aria-expanded="true"] .caret { transform: rotate(180deg); }
.menu {
  list-style: none; margin: 0; padding: 0.4rem;
  position: absolute; right: 0; top: calc(100% + 0.35rem); min-width: 15rem;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.menu a { display: block; padding: 0.5rem 0.75rem; border-radius: 6px; color: var(--fg); text-decoration: none; }
.menu a:hover, .menu a:focus-visible { background: #22252c; color: var(--accent); }
.menu a[aria-current="page"] { color: var(--accent); }

/* ---------- Home ---------- */
.hero { text-align: center; padding-block: clamp(4rem, 12vh, 7.5rem) 3rem; }
.hero h1 {
  font-size: clamp(2.6rem, 8.5vw, 5.75rem); font-weight: 800; letter-spacing: -0.02em;
}
.hero .role {
  margin-top: 0.9rem; font-size: clamp(1.05rem, 2.2vw, 1.4rem); font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.description { max-width: 46rem; margin: 0 auto; }
.description h2 { font-size: 1.6rem; margin-bottom: 0.9rem; }
.description p + p { margin-top: 1rem; }

.section-title { font-size: clamp(1.6rem, 3.5vw, 2.2rem); text-align: center; margin-bottom: 2rem; }
.projects { padding-block: 4.5rem 5rem; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3.25rem; }
.card { display: block; color: var(--fg); text-decoration: none; }
.card img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line);
  transition: border-color 0.2s, filter 0.2s;
}
.card:hover img, .card:focus-visible img { border-color: var(--accent); filter: brightness(1.08); }
.card-text { padding: 0.8rem 0.15rem 0; display: flex; flex-direction: column; gap: 0.15rem; }
.card h3 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
.card:hover h3 { color: var(--accent); }
.card .genre { color: var(--muted); font-size: 1.05rem; }

/* ---------- Project pages ---------- */
.project-page { padding-block: 2.5rem 5rem; }
.back { display: inline-block; margin-bottom: 1.25rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.back:hover { color: var(--accent); }
.project-page .cover {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line);
}
.project-page .panel { margin-top: 1.75rem; }
.eyebrow { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.project-page h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; margin-block: 0.4rem 1rem; }
.project-page .intro p + p { margin-top: 1rem; }
.project-page h2 { font-size: 1.35rem; margin-block: 2rem 0.9rem; }
.roles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem 2rem; }
.roles li { padding-left: 1.1rem; position: relative; }
.roles li::before {
  content: ""; position: absolute; left: 0; top: 0.68em; width: 0.4rem; height: 0.4rem;
  border-radius: 50%; background: var(--accent);
}
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.pager a { color: var(--fg); text-decoration: none; font-weight: 600; }
.pager a:hover { color: var(--accent); }
.pager small { display: block; color: var(--muted); font-weight: 400; }
.pager .next { text-align: right; margin-left: auto; }

.project-page .site-link {
  margin-top: 1.25rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
}
.project-page .site-link h2 { margin: 0 0 0.25rem; font-size: 1.2rem; }
.project-page .site-link p { color: var(--muted); }
.project-page .site-link .url { color: var(--fg); }

/* ---------- About ---------- */
.about-page { padding-block: 3rem 5rem; }
.about-top { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.portrait-col { display: grid; gap: 1.25rem; justify-items: start; }
.resume-link {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem;
  padding: 0; border-radius: 4px; text-decoration: none;
}
.resume-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: #ffffff; }
.pdf-icon.linkedin-icon { width: 2.5rem; }
.pdf-icon { width: 2.25rem; height: auto; transition: transform 0.15s; }
.resume-link:hover .pdf-icon { transform: translateY(-2px); }
.resume-link:hover .resume-title { color: var(--accent); }
.portrait { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.about-page h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; margin-bottom: 1rem; }
.about-page .text p + p { margin-top: 1rem; }
.about-page .greeting { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--accent); }
.resume { margin-top: 2rem; display: grid; gap: 2rem; }
.resume h2 { font-size: 1.35rem; margin-bottom: 0.8rem; }
.resume-row { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: 0.25rem 1.5rem; }
.resume-row + .resume-row { margin-top: 0.75rem; }
.resume-row dt { color: var(--muted); }
.resume-row dd { margin: 0; }
.btn {
  display: inline-block; padding: 0.6rem 1.2rem; border-radius: 6px;
  font-weight: 700; text-decoration: none; border: 1px solid var(--accent); color: var(--accent);
}
.btn:hover { background: var(--accent); color: var(--bg); }

/* Resume preview on About page */
.about-links { margin-top: 1.5rem; }
.resume-preview { margin-top: 3.5rem; display: grid; justify-items: center; gap: 1rem; }
.resume-preview h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); color: #ffffff; }
.resume-sheet { display: block; width: min(100%, 40rem); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); }
.resume-sheet img { width: 100%; transition: filter 0.2s; }
.resume-sheet:hover { border-color: var(--accent); }
.resume-sheet:hover img { filter: brightness(0.92); }
.resume-preview .hint { color: var(--muted); font-size: 0.98rem; }

/* Resume page */
.resume-page { padding-block: 2.5rem 5rem; }
.resume-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.resume-head h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; }
.resume-head .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.pdf-frame { display: block; width: 100%; height: min(85vh, 70rem); border: 1px solid var(--line); border-radius: 6px; background: #ffffff; }
.resume-fallback { width: 100%; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: rgba(13, 14, 17, 0.88); }
.site-footer .wrap { padding-block: 1.75rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; color: var(--muted); font-size: 0.98rem; }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .roles { grid-template-columns: 1fr; }
  .about-top { grid-template-columns: 1fr; }
  .portrait { max-width: 13rem; }
  .resume-row { grid-template-columns: 1fr; }
  .menu { right: auto; left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
