/* ============================================================
   DeBakker Clay — styles
   Tokens + layout + responsive navigation.
   Design source of truth: the approved v1.3 site (debakker.pages.dev)
   and docs/design/DESIGN.md. Vanilla CSS, no build step.
   No shadows, no rounded corners.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg:          #fbfbfa;   /* warm off-white paper           */
  --text:        #1a1a18;   /* near-black — never pure #000   */
  --text-2:      #33322e;   /* secondary body text            */
  --muted:       #6f6c64;   /* captions, meta, labels         */
  --nav-idle:    #8a877f;   /* inactive nav item (v1.3)       */
  --faint:       #a19d94;   /* tiny uppercase micro-labels    */
  --accent:      oklch(0.55 0.11 42);  /* terracotta — active/interactive */
  --hairline:    #eae8e4;   /* rules, borders, separators     */
  --placeholder: #f0eee9;   /* image placeholder fill         */

  --font-sans: "Work Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --content-max: 1400px;
  --pad: 40px;              /* desktop side padding (20px on mobile) */
  --header-h: 84px;        /* approx sticky-header height for menu offset */
}

/* ============================================================
   THE RESPONSIVE BREAKPOINT — 768px — DEFINED ONCE.
   The nav switches to a hamburger here; all mobile layout tweaks
   live in the single @media block at the bottom of this file.
   (767.98px so exactly 768 counts as desktop: >=768 = desktop.)
   ============================================================ */

/* ---------- Reset-ish ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
::selection { background: oklch(0.55 0.11 42 / 0.18); }

button {
  font: inherit; color: inherit; background: none; border: 0;
  margin: 0; padding: 0; cursor: pointer; text-align: inherit;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Layout container ---------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
.container-narrow { max-width: 760px; }   /* musings */
.container-mid    { max-width: 1000px; }  /* events, profile */

/* ============================================================
   HEADER + NAVIGATION
   One row: wordmark LEFT · nav CENTER · logo RIGHT.
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 250, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 22px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

/* Wordmark (left) */
.brand-word {
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--text);
}

/* Nav (center) */
.site-nav { flex: 1 1 auto; display: flex; justify-content: center; }
.nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 30px;
}
.nav-link {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--nav-idle);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease;
  white-space: nowrap;
}
.nav-link:hover { color: var(--accent); }
.nav-link.is-active {                 /* active view/filter — dark + underline (v1.3) */
  color: var(--text);
  border-bottom-color: var(--text);
}

/* Brand glyph (right) */
.brand-mark-btn { flex: 0 0 auto; display: inline-flex; }
.brand-mark { height: 40px; width: auto; fill: var(--text); display: block; }

/* Hamburger — hidden on desktop */
.nav-toggle { display: none; width: 40px; height: 40px; position: relative; flex: 0 0 auto; }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: ""; position: absolute; left: 8px;
  width: 24px; height: 1.5px; background: var(--text);
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.nav-toggle-bars      { top: 19px; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after  { top:  7px; }
.nav-open .nav-toggle-bars { background: transparent; }
.nav-open .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle-bars::after  { transform: translateY(-7px) rotate(-45deg); }

/* Backdrop behind the mobile menu */
.nav-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(26, 26, 24, 0.28);
  opacity: 0; transition: opacity 0.2s ease;
}

/* ============================================================
   VIEWS — in-app switching
   ============================================================ */
.view { display: none; }
.view.is-active { display: block; animation: view-fade 0.28s ease both; }
@keyframes view-fade { from { opacity: 0; } to { opacity: 1; } }
.site-main { min-height: 60vh; }

.page-title {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.05;
  margin: 48px 0 40px;
}

.back {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 40px 0 4px;
}
.back:hover { color: var(--accent); }

.empty-state {
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.04em; color: var(--muted);
  padding: 40px 0;
}

/* ---------- Placeholder image box ---------- */
.ph { position: relative; display: block; width: 100%; background: var(--placeholder); overflow: hidden; }
.ph::after {
  content: attr(data-ph);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); text-align: center;
}
.ph[data-loaded="true"]::after { content: none; }   /* hide label once a real image loads */
.ph-img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

/* ============================================================
   GALLERY — masonry of image tiles; title on hover overlay
   ============================================================ */
.gallery-title {
  font-family: var(--font-sans); font-weight: 300;
  font-size: clamp(30px, 5vw, 54px); line-height: 1.05;
  margin: 48px 0 34px;
}
/* Columns collapse to one on narrow screens on their own (min 300px). */
.gallery-grid { columns: 3 300px; column-gap: 34px; margin-top: 40px; }
.tile {
  display: block; width: 100%;
  break-inside: avoid; margin-bottom: 34px;
}
.tile-media { display: block; }
.tile-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0; transition: opacity 0.35s ease;
}
.tile:hover .tile-overlay,
.tile:focus-visible .tile-overlay { opacity: 1; }
.tile-overlay-title {
  font-family: var(--font-sans); font-weight: 500; font-size: 24px;
  color: #fff; text-wrap: balance;
}

/* ============================================================
   PIECE DETAIL — lead (title + desc) LEFT, meta RIGHT (v1.3)
   ============================================================ */
.piece-hero { width: 100%; height: clamp(320px, 50vw, 660px); }

.piece-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: 56px;
  margin-top: 8px;
}
.piece-title {
  font-family: var(--font-sans); font-weight: 600;
  font-size: clamp(42px, 7vw, 104px);
  line-height: 0.98; letter-spacing: -0.02em;
  margin: 0 0 34px; text-wrap: balance;
}
.piece-desc { font-weight: 300; font-size: 18px; line-height: 1.7; color: var(--text-2); max-width: 720px; }
.piece-desc p { margin: 0 0 18px; }
.piece-meta {
  font-family: var(--font-sans); font-weight: 500;
  font-size: 15px; line-height: 1.95; color: var(--accent);
  padding-top: 8px;
}

.plates { display: flex; flex-direction: column; gap: 72px; margin-top: 72px; align-items: flex-start; }
.plate { margin: 0; width: 100%; }
.plate-full { width: min(860px, 100%); }
.plate-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; width: 100%; }
.plate figcaption {
  font-weight: 300; font-style: italic; font-size: 17px; line-height: 1.6;
  color: var(--muted); margin-top: 14px; max-width: 620px;
}
.pull-quote { margin: 72px 0 0; max-width: 860px; }
.pull-quote blockquote {
  margin: 0; font-family: var(--font-sans); font-weight: 300;
  font-size: clamp(24px, 3vw, 36px); line-height: 1.25; letter-spacing: -0.01em;
  text-wrap: balance;
}
.pull-quote figcaption {
  margin-top: 16px; font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* ============================================================
   MUSINGS — full body inline (v1.3)
   ============================================================ */
.musing {
  padding-bottom: 40px; margin-bottom: 40px;
  border-bottom: 1px solid var(--hairline);
}
.musing:last-child { border-bottom: 0; }
.musing-date {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint);
}
.musing-heading {
  font-family: var(--font-sans); font-weight: 400; font-size: 26px;
  margin: 0 0 14px;
}
.musing-body { font-weight: 300; font-size: 18px; line-height: 1.68; color: var(--text-2); }
.musing-body p { margin: 0 0 14px; }
.musing-body p:last-child { margin-bottom: 0; }

/* ============================================================
   EVENTS — single flat list (v1.3)
   ============================================================ */
.event-row {
  display: grid; grid-template-columns: 130px 1fr; gap: 24px;
  padding: 22px 0; border-top: 1px solid var(--hairline); align-items: start;
}
.event-date {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); padding-top: 4px;
}
.event-title { display: block; font-size: 22px; font-weight: 400; margin-bottom: 5px; }
.event-where { display: block; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 56px; align-items: start; margin-top: 56px;
}
.profile-text .page-title { margin-top: 0; }
.profile-text p {
  font-weight: 300; font-size: 18px; line-height: 1.66; color: var(--text-2);
  margin: 0 0 20px; max-width: 620px;
}
.profile-contact {
  border-top: 1px solid var(--hairline);
  padding-top: 22px; margin-top: 30px; font-size: 15px; color: var(--muted);
}
.profile-contact .label {
  display: block; font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
  margin-bottom: 8px;
}
.profile-contact a { border-bottom: 1px solid #d8d5ce; }

/* ============================================================
   FOOTER — IG icon centered · wordmark left · copyright right
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 80px;
  padding: 34px var(--pad);
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.footer-ig { color: var(--text); display: inline-flex; }
.footer-ig:hover { color: var(--accent); }
.footer-row {
  width: 100%; max-width: var(--content-max);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
}

/* ============================================================
   MOBILE  —  < 768px  (THE single nav breakpoint)
   ============================================================ */
@media (max-width: 767.98px) {
  :root { --pad: 20px; }

  /* Header: wordmark left + hamburger right; logo hidden; nav becomes a menu */
  .brand-mark-btn { display: none; }
  .nav-toggle { display: block; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0; z-index: 45;
    display: block;
    background: var(--bg);
    border-bottom: 1px solid var(--hairline);
    transform: translateY(-8px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .nav-list { flex-direction: column; gap: 0; padding: 8px var(--pad) 20px; }
  .nav-link {
    display: block; width: 100%;
    font-size: 22px; padding: 16px 0;
    border-bottom: 1px solid var(--hairline);
  }
  .nav-link.is-active { border-bottom-color: var(--accent); color: var(--accent); }

  .nav-open .site-nav { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
  .nav-open .nav-backdrop { display: block; opacity: 1; }

  /* Layout collapses to single column */
  .piece-intro,
  .plate-pair,
  .profile-grid { grid-template-columns: 1fr; gap: 28px; }
  .piece-meta { padding-top: 0; }
  .event-row { grid-template-columns: 84px 1fr; gap: 16px; }
  .page-title, .gallery-title { margin-top: 36px; }
}
