:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1d1b1a;
  --muted: #6b655f;
  --line: #e6dfd5;
  --accent: #e0a100;
  --accent-ink: #a87400;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161412; --surface: #201d1a; --ink: #f3eee7; --muted: #a39b91;
    --line: #333029; --accent: #f5c542; --accent-ink: #f5c542;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; outline: none; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; gap: 28px; }
.nav a { text-decoration: none; font-size: .95rem; padding: 6px 0; border-bottom: 2px solid transparent; color: var(--muted); transition: color .15s, border-color .15s; }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-color: var(--accent); }
.menu-btn { display: none; background: none; border: 0; width: 44px; height: 44px; margin-right: -10px; cursor: pointer; position: relative; color: var(--ink); }
.menu-btn span { position: absolute; left: 11px; right: 11px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, top .2s; }
.menu-btn span:first-child { top: 17px; }
.menu-btn span:last-child { top: 25px; }
.menu-btn[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

@media (max-width: 640px) {
  .menu-btn { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 4px var(--gutter) 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { font-size: 1.15rem; padding: 14px 0; border-bottom: 1px solid var(--line); border-left: 0; }
  .nav a.active { border-bottom-color: var(--accent); }
}

/* layout */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.view { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* hero */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(24px, 4vw, 48px); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); margin-bottom: 20px; }
.eyebrow::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #3fae6a; box-shadow: 0 0 0 4px color-mix(in srgb, #3fae6a 22%, transparent); }
.hero h1 { font-size: clamp(2.4rem, 7vw, 5rem); max-width: 14ch; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p { max-width: 52ch; color: var(--muted); font-size: 1.1rem; margin: 22px 0 0; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 28px; }
.chip {
  font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.2vw, 28px); padding-bottom: 80px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.card { text-decoration: none; display: block; }
.card .thumb { aspect-ratio: 4/3; overflow: hidden; border-radius: var(--radius); background: var(--line); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.card:hover .thumb img, .card:focus-visible .thumb img { transform: scale(1.04); }
.card .meta { display: flex; justify-content: space-between; gap: 12px; padding: 14px 2px 0; align-items: baseline; }
.card h3 { font-size: 1.15rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; line-height: 1.3; }
.card .cat { font-size: .85rem; color: var(--muted); white-space: nowrap; }

/* project */
.back { display: inline-block; margin: 28px 0 0; color: var(--muted); text-decoration: none; font-size: .95rem; }
.back:hover { color: var(--accent-ink); }
.project-head { padding: 24px 0 36px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px 64px; align-items: end; }
.project-head h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; margin: 0; font-size: .95rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 760px) { .project-head { grid-template-columns: 1fr; } }
.gallery { display: grid; gap: clamp(12px, 2vw, 24px); }
.gallery figure { margin: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; height: auto; cursor: zoom-in; }
.gallery .narrow { max-width: 760px; margin-inline: auto; }
.next { display: flex; justify-content: space-between; gap: 16px; padding: 56px 0 80px; flex-wrap: wrap; }
.next a { text-decoration: none; }
.next small { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.next strong { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }
.next a:hover strong { color: var(--accent-ink); }
.next .r { text-align: right; margin-left: auto; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(10,9,8,.92); display: none; align-items: center; justify-content: center; padding: 16px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 92vh; max-width: 96vw; width: auto; border-radius: 6px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lightbox .x { top: 16px; right: 16px; }
.lightbox .p { left: 16px; top: 50%; }
.lightbox .n { right: 16px; top: 50%; }
@media (max-width: 560px) { .lightbox .p, .lightbox .n { top: auto; bottom: 16px; } }

/* about */
.about { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: clamp(32px, 6vw, 88px); padding: clamp(40px, 7vw, 88px) 0 96px; align-items: start; }
@media (max-width: 800px) { .about { grid-template-columns: 1fr; } .about .portrait { max-width: 320px; } }
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); filter: grayscale(1); }
.about h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 8px; }
.role { color: var(--accent-ink); font-weight: 600; margin: 0 0 28px; }
.about p { max-width: 60ch; margin: 0 0 1.1em; }
.about h2 { font-size: 1.5rem; margin: 40px 0 14px; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: .92rem; }
.btn { display: inline-block; background: var(--accent); color: #1d1b1a; text-decoration: none; padding: 13px 24px; border-radius: 999px; font-weight: 600; transition: background .15s, transform .15s; }
.btn:hover { background: var(--accent-ink); transform: translateY(-1px); }
.actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface); border-color: var(--ink); }

/* contact */
.contact { padding: clamp(40px, 8vw, 96px) 0 110px; }
.contact h1 { font-size: clamp(2.4rem, 7vw, 5rem); max-width: 12ch; }
.contact > p { color: var(--muted); max-width: 48ch; font-size: 1.1rem; margin: 22px 0 36px; }
.mail { font-family: var(--serif); font-size: clamp(1.4rem, 4.5vw, 2.6rem); color: var(--accent-ink); text-decoration-thickness: 2px; text-underline-offset: 6px; word-break: break-word; }
.contact-list { list-style: none; margin: 48px 0 0; padding: 0; border-top: 1px solid var(--line); max-width: 640px; }
.contact-list li { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact-list span { color: var(--muted); }
.contact-list a { text-decoration: none; font-weight: 500; }
.contact-list a:hover { color: var(--accent-ink); }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px var(--gutter); display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: 0; }
.socials { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.socials a { text-decoration: none; }
.socials a:hover { color: var(--accent-ink); }

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