/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --black: #0A0A0A;
  --cream: #F2EBDD;
  --gold: #C9A227;
  --wine: #8B1A1A;

  --cream-dim: #cfc6b3;
  --gold-ink: #7a5c12; /* AA-safe darkened gold for text on cream (gold itself only passes contrast on black) */
  --cream-line: rgba(242, 235, 221, 0.14);
  --black-line: rgba(10, 10, 10, 0.12);
  --black-soft: #1c1a17;
  --cream-soft: #e9e0cc;

  --bg: var(--cream);
  --text: var(--black);
  --text-muted: #55504a;
  --line: var(--black-line);

  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --container: 1180px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --nav-h: 76px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.03; letter-spacing: -0.01em; }
::selection { background: var(--gold); color: var(--black); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--gold); color: var(--black);
  z-index: 9999; border-radius: 4px; font-weight: 700;
  font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase;
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-top: clamp(4rem, 10vw, 8rem);
  padding-bottom: clamp(4rem, 10vw, 8rem);
  position: relative;
}
.section--ink { background: var(--black); color: var(--cream); }
.section--cream { background: var(--cream); color: var(--black); }

.kicker {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.section--ink .kicker { color: var(--cream-dim); }
.kicker::before { content: '*'; color: var(--wine); font-weight: 700; }

.eyebrow-line {
  width: 48px; height: 3px; background: var(--wine);
  margin-block: 1rem 1.75rem;
}

.italic-accent {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =============================================================
   4. Typography
   ============================================================= */
h1, h2, h3 { font-family: var(--font-display); text-transform: uppercase; }

.h-display {
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  line-height: 0.98;
}
.h-section {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.02;
}
.h-card { font-size: clamp(1.35rem, 2.6vw, 1.7rem); line-height: 1.06; }

.lede {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gold);
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  max-width: 42ch;
  margin-top: 1.1rem;
}

.body-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 62ch;
}
.section--ink .body-text { color: var(--cream-dim); }

.pull-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  color: var(--wine);
  border-left: 3px solid var(--wine);
  padding-left: 1.2rem;
  margin-block: 2rem;
  max-width: 48ch;
}
.pull-quote::before { content: '\2192\00A0'; }

/* =============================================================
   5. Components
   ============================================================= */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-mono);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .95em 1.6em;
  border-radius: 999px;
  transition: transform .35s var(--ease-out), background .35s var(--ease-out), color .35s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--gold); color: var(--black); }
.btn-primary:hover { transform: translateY(-2px); background: var(--cream); }
.btn-ghost {
  border: 1px solid currentColor;
  color: inherit;
}
.btn-ghost:hover { transform: translateY(-2px); background: currentColor; }
.btn-ghost:hover { color: var(--black); }
.section--ink .btn-ghost:hover { color: var(--black); background: var(--cream); }
.section--cream .btn-ghost:hover { color: var(--cream); background: var(--black); }

.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.25rem; }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 500;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(10,10,10,0.86);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--cream-line);
  color: var(--cream);
  transition: transform .5s var(--ease-out);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-logo {
  font-family: var(--font-mono);
  font-size: .95rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.nav-logo b { color: var(--gold); }
.nav-links { display: none; align-items: center; gap: 2rem; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--cream-dim);
  transition: color .3s var(--ease-out);
  position: relative;
}
.nav-links a:hover, .nav-links a.is-active { color: var(--gold); }
.nav-cta {
  display: none;
}
.nav-toggle {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  width: 44px; height: 44px; margin-right: -10px; /* WCAG 2.2 target size: visual icon stays 24px, hit area grows to 44px */
}
.nav-toggle span { width: 24px; }
.nav-toggle span { display: block; height: 2px; background: var(--cream); transition: transform .3s var(--ease-out), opacity .3s var(--ease-out); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 490;
  background: var(--black); color: var(--cream);
  display: flex; flex-direction: column; justify-content: center; gap: 2rem;
  padding: 2rem var(--gutter);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
}
.nav-mobile.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.nav-mobile a { font-family: var(--font-display); text-transform: uppercase; font-size: 2rem; }

/* Reading progress (article pages only) */
.reading-progress {
  position: fixed; top: var(--nav-h); left: 0;
  height: 3px; width: 0%;
  background: var(--gold);
  z-index: 480;
  transform-origin: left;
}

/* Hero */
.hero {
  min-height: 100svh;
  display: flex; align-items: center;
  padding-top: calc(var(--nav-h) + 2rem);
  padding-bottom: 3rem;
  position: relative;
  overflow: clip;
}
.hero-halo {
  position: absolute; inset: -30% -10% -40% auto; right: -10%;
  width: 60%; aspect-ratio: 1;
  background: radial-gradient(45% 45% at 50% 50%, rgba(201,162,39,0.35), transparent 72%);
  filter: blur(90px);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}
.hero-kicker-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.hero-portrait {
  width: clamp(140px, 30vw, 220px);
  aspect-ratio: 1;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid var(--gold);
  justify-self: center;
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; }
.hero-meta {
  margin-top: 2.5rem;
  display: flex; flex-wrap: wrap; gap: .6rem 1.2rem;
  font-family: var(--font-mono); font-size: .78rem;
  color: var(--cream-dim); letter-spacing: .02em;
}
.hero-meta span { display: inline-flex; align-items: center; padding-left: 1.2em; position: relative; }
.hero-meta span::before {
  content: '\2022'; color: var(--wine);
  position: absolute; left: 0;
}
.hero-meta span:first-child { padding-left: 0; }
.hero-meta span:first-child::before { content: none; }

/* About */
.about-grid {
  display: grid;
  gap: 3rem;
  align-items: start;
}
.about-portrait {
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--black-line);
}
.credentials {
  margin-top: 2.25rem;
  display: flex; flex-wrap: wrap; gap: .6rem;
  font-family: var(--font-mono); font-size: .78rem;
  letter-spacing: .01em;
}
.credentials span {
  border: 1px solid var(--black-line);
  border-radius: 999px;
  padding: .5em 1em;
  color: var(--text-muted);
}
.section--ink .credentials span { border-color: var(--cream-line); color: var(--cream-dim); }

/* Pillars */
.pillar-grid {
  margin-top: 3rem;
  display: grid;
  gap: 1px;
  background: var(--cream-line);
  border: 1px solid var(--cream-line);
}
.pillar-card {
  background: var(--black);
  padding: 2.25rem 1.75rem;
  display: flex; flex-direction: column; gap: .75rem;
}
.pillar-num {
  font-family: var(--font-mono);
  color: var(--wine);
  font-size: .85rem;
}
.pillar-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-transform: uppercase;
  color: var(--cream);
}
.pillar-card p { color: var(--cream-dim); font-size: .92rem; }
.pillar-card-cta {
  margin-top: .5rem;
  font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase;
  color: var(--gold); display: inline-flex; align-items: center; gap: .4em;
  transition: transform .3s var(--ease-out);
}
.pillar-card-cta:hover { transform: translateX(4px); }

/* Blog cards */
.blog-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 1.5rem; margin-bottom: 2.5rem;
}
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}
.card {
  display: flex; flex-direction: column;
  border: 1px solid var(--black-line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--black);
  color: var(--cream);
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 48px -24px rgba(10,10,10,.45); }
.card-media { aspect-ratio: 4 / 5; overflow: hidden; background: var(--black-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.card:hover .card-media img { transform: scale(1.045); }
.card-body { padding: 1.5rem 1.5rem 1.75rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.card-tag {
  font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--gold);
}
.card h2, .card h3 { font-family: var(--font-display); font-size: 1.2rem; text-transform: none; line-height: 1.15; }
.card .lede { font-size: .95rem; margin-top: 0; color: var(--cream-dim); font-style: italic; }
.card-footer {
  margin-top: auto; padding-top: .75rem;
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--cream-dim); text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
}
.card-arrow { color: var(--gold); transition: transform .3s var(--ease-out); }
.card:hover .card-arrow { transform: translateX(4px); }

/* Contact form */
.contact-form {
  display: grid; gap: 1.1rem;
  max-width: 560px;
  margin-top: 2.5rem;
}
.form-row { display: flex; flex-direction: column; gap: .5rem; }
.form-row label {
  font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--cream-dim);
}
.form-row input, .form-row select, .form-row textarea {
  background: var(--black-soft);
  border: 1px solid var(--cream-line);
  border-radius: 8px;
  padding: .85em 1em;
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color .3s var(--ease-out);
}
.form-row textarea { min-height: 130px; resize: vertical; }
.form-row input:focus-visible, .form-row select:focus-visible, .form-row textarea:focus-visible {
  outline: none; border-color: var(--gold);
}
.form-honey { position: absolute; opacity: 0; height: 0; width: 0; pointer-events: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }
.form-status {
  font-family: var(--font-mono); font-size: .85rem;
}
.form-status[data-state="success"] { color: var(--gold); }
.form-status[data-state="error"] { color: #e08585; }
.form-fallback { font-family: var(--font-mono); font-size: .8rem; color: var(--cream-dim); }
.form-fallback a:hover { color: var(--gold); }

/* Contact / footer */
.contact-row {
  display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: center;
  margin-top: 2.5rem;
}
.social-row { display: flex; gap: 1.25rem; margin-top: 2rem; }
.social-row a {
  font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase;
  border: 1px solid var(--cream-line); border-radius: 999px; padding: .55em 1.1em;
  transition: background .3s var(--ease-out), color .3s var(--ease-out);
}
.social-row a:hover { background: var(--gold); color: var(--black); border-color: var(--gold); }

.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--cream-line);
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--cream-dim); text-transform: uppercase;
}
.site-footer a:hover { color: var(--gold); }

/* =============================================================
   6. Article page
   ============================================================= */
.article-header { padding-top: calc(var(--nav-h) + 3rem); padding-bottom: 3rem; }
.article-tagrow { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; }
.article-body { max-width: 66ch; margin-top: 2.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.article-body p { font-size: 1.08rem; color: var(--text-muted); }
.article-hashtags {
  margin-top: 2rem; font-family: var(--font-mono); font-size: .78rem;
  color: var(--gold-ink);
}

.gallery {
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}
.gallery--single { grid-template-columns: 1fr; max-width: 560px; }
.gallery img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--black-line);
  background: var(--black-soft); /* visible placeholder box while the image loads, prevents layout shift */
}

.article-cta {
  margin-top: 3.5rem; padding: 1.75rem; border: 1px solid var(--black-line); border-radius: 12px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem;
  background: var(--cream-soft);
}
.article-cta p { font-size: 1.05rem; }

.article-nav {
  margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--black-line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-family: var(--font-mono); font-size: .82rem; text-transform: uppercase;
}
.article-nav a { display: flex; align-items: center; gap: .5em; }
.article-nav a:hover { color: var(--wine); }

/* =============================================================
   7. Effects
   ============================================================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 720px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .nav-cta { display: inline-flex; }
  .hero-grid { grid-template-columns: 1.4fr .6fr; }
  .hero-portrait { justify-self: end; }
  .about-grid { grid-template-columns: .8fr 1.2fr; }
  .about-portrait { order: 0; }
}

@media (min-width: 960px) {
  .pillar-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .h-display { font-size: clamp(3.4rem, 6vw, 6.4rem); }
}

/* =============================================================
   9. Reduced motion — only intrusive
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-halo { display: none; }
}
