:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --ink: #1c1a18;
  --muted: #6c655d;
  --line: #e3ddd4;
  --accent: #c8502a;
  --accent-ink: #ffffff;
  --radius: 14px;
  --max: 1180px;
  --read: 720px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131211; --surface: #1c1b19; --ink: #eee9e2; --muted: #a39b91; --line: #2e2b28; --accent: #ef7a52; --accent-ink: #1a0e09;
  }
}
:root[data-theme="dark"] {
  --bg: #131211; --surface: #1c1b19; --ink: #eee9e2; --muted: #a39b91; --line: #2e2b28; --accent: #ef7a52; --accent-ink: #1a0e09;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { font: 600 20px/1 var(--serif); text-decoration: none; letter-spacing: -0.01em; padding: 12px 0; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 10px; }
.nav a { text-decoration: none; font-size: 15px; color: var(--muted); padding: 12px 8px; }
.nav a:hover, .nav a.active { color: var(--ink); }
.menu-btn { display: none; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; margin-right: -14px; background: none; border: 0; color: var(--ink); font: 500 15px var(--sans); cursor: pointer; }
.menu-btn .bars, .menu-btn .bars::before, .menu-btn .bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.menu-btn .bars { position: relative; }
.menu-btn .bars::before, .menu-btn .bars::after { content: ""; position: absolute; left: 0; }
.menu-btn .bars::before { top: -6px; }
.menu-btn .bars::after { top: 6px; }
.site-header.open .bars { background: transparent; }
.site-header.open .bars::before { transform: translateY(6px) rotate(45deg); }
.site-header.open .bars::after { transform: translateY(-6px) rotate(-45deg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
#work { scroll-margin-top: 80px; }

/* Hero */
.hero { padding: 96px 0 72px; }
.nw { white-space: nowrap; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.hero h1 { font: 500 clamp(44px, 7vw, 88px)/1.02 var(--serif); letter-spacing: -0.025em; margin: 0 0 26px; max-width: 13ch; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p { font-size: 20px; color: var(--muted); max-width: 56ch; margin: 0 0 32px; }
.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid var(--line); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:hover { transform: translateY(-1px); }

/* Work grid */
.section { padding: 32px 0 72px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 22px; margin-bottom: 30px; }
.section-head h2 { font: 500 30px/1.1 var(--serif); margin: 0; }
.section-head span { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 44px 32px; }
.grid.small { grid-template-columns: repeat(3, 1fr); }
.card { text-decoration: none; display: block; }
.card .thumb { border-radius: var(--radius); overflow: hidden; background: var(--surface); aspect-ratio: 4 / 3; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.card h3 { font: 500 22px/1.25 var(--serif); margin: 16px 0 4px; }
.card .meta { color: var(--muted); font-size: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.card .meta b { font-weight: 500; color: var(--ink); }

/* Project page */
.project-head { padding-top: 72px; padding-bottom: 40px; }
.back { display: inline-block; padding: 12px 0; margin: -12px 0; font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.project-head h1 { font: 500 clamp(38px, 6vw, 68px)/1.05 var(--serif); letter-spacing: -0.02em; margin: 18px 0 16px; max-width: 18ch; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.prose { max-width: var(--read); margin: 0 auto; padding: 0 24px; }
.prose p, .prose ul { margin: 0 0 1.2em; }
.prose h2 { font: 600 13px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 3em 0 1em; }
.prose h3 { font: 500 24px/1.3 var(--serif); margin: 2em 0 .6em; }
.prose li { margin-bottom: .4em; }
.prose a { color: var(--accent); overflow-wrap: anywhere; }
.figure { margin: 36px auto; max-width: calc(var(--max) - 48px); padding: 0 24px; }
.figure img { border-radius: var(--radius); margin: 0 auto; }
.embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.embed iframe, .embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed video { object-fit: contain; background: #000; }
.play-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; border: 0; padding: 0; cursor: pointer; background: rgba(0,0,0,.28); color: #fff; font: 600 15px var(--sans); transition: background .2s ease; }
.play-overlay:hover { background: rgba(0,0,0,.4); }
.play-circle { width: 84px; height: 84px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .2s ease; }
.play-overlay:hover .play-circle { transform: scale(1.06); }
.play-circle svg { width: 36px; height: 36px; fill: #fff; margin-left: 4px; }
.play-label { background: rgba(0,0,0,.55); padding: 6px 14px; border-radius: 999px; }
.video-embed.started .play-overlay { display: none; }
@media (max-width: 560px) { .play-circle { width: 64px; height: 64px; } .play-circle svg { width: 28px; height: 28px; } }
.sub-links { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

.next { border-top: 1px solid var(--line); margin-top: 80px; padding: 48px 0 24px; display: flex; justify-content: space-between; gap: 24px; }
.next a { text-decoration: none; }
.next small { display: block; color: var(--muted); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.next strong { font: 500 24px/1.3 var(--serif); }
.next .r { text-align: right; margin-left: auto; }

/* Simple pages */
.page-head { padding-top: 72px; padding-bottom: 32px; }
.figure.narrow img { max-width: 340px; }
.page-head h1 { font: 500 clamp(40px, 6vw, 64px)/1.05 var(--serif); margin: 0; letter-spacing: -0.02em; }
.about { display: grid; grid-template-columns: 340px 1fr; gap: 56px; align-items: start; padding-bottom: 40px; }
.about img { border-radius: var(--radius); width: 100%; }
.about .prose { padding: 0; margin: 0; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; max-width: 640px; }
.contact-card .big { display: inline-block; padding: 8px 0; font: 500 clamp(22px, 4vw, 34px)/1.2 var(--serif); text-decoration: none; color: var(--accent); overflow-wrap: anywhere; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 96px; padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; margin-left: 20px; display: inline-block; padding: 12px 0; }
.site-footer a:first-child { margin-left: 0; }
.site-footer a:hover { color: var(--ink); }

/* Tablet */
@media (max-width: 900px) {
  .grid.small { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .about img { max-width: 220px; }
  .hero { padding: 72px 0 56px; }
}
/* Phone */
@media (max-width: 640px) {
  .grid, .grid.small, .sub-links { grid-template-columns: 1fr; gap: 36px; }
  html.js .menu-btn { display: inline-flex; }
  html.js .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0,0,0,.08); }
  html.js .site-header.open .nav { display: flex; }
  html.js .nav a { font: 500 26px/1.2 var(--serif); color: var(--ink); padding: 14px 0; border-bottom: 1px solid var(--line); }
  html.js .nav a:last-child { border-bottom: 0; }
  html.js .nav a.active { color: var(--accent); }
  .section-head h2 { font-size: 26px; }
  .project-head, .page-head { padding-top: 48px; }
  .figure { margin: 24px auto; }
  .next { margin-top: 56px; }
  .site-footer { margin-top: 64px; }
  .site-footer .wrap { flex-direction: column; gap: 4px; }
  .site-footer a { margin: 0 20px 0 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap, .prose, .figure { padding-left: 16px; padding-right: 16px; }
  .site-header .wrap { height: 60px; }
  .logo { font-size: 19px; }
  .btns .btn { flex: 1 1 auto; justify-content: center; min-height: 48px; }
  .hero { padding: 56px 0 48px; }
  .hero p { font-size: 18px; }
  .contact-card { padding: 28px 22px; }
  .next { flex-direction: column; }
  .next .r { text-align: left; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .btn:hover, .card:hover .thumb img { transform: none; }
}
