/* =========================================================
   Jusstips — shared styles
   ========================================================= */

:root {
  /* default palette: cream */
  --bg: #F2ECE0;
  --bg-soft: #EBE3D2;
  --bg-card: #FAF6EC;
  --ink: #1B1F1B;
  --ink-soft: #4A4F47;
  --ink-mute: #807868;
  --line: #1B1F1B;
  --line-soft: rgba(27,31,27,0.14);
  --accent: #2F4A35;
  --accent-ink: #F2ECE0;
  /* Brand accent — extracted from logo (warm muted gold) */
  --highlight: #D2AE6D;
  --highlight-ink: #1B1F1B;
  --gold: #D2AE6D;
}
[data-palette="forest"] {
  --bg: #1F2A22;
  --bg-soft: #283328;
  --bg-card: #2A352A;
  --ink: #EFE8D8;
  --ink-soft: #C9C0AB;
  --ink-mute: #8E9387;
  --line: #EFE8D8;
  --line-soft: rgba(239,232,216,0.18);
  --accent: #D9C28A;
  --accent-ink: #1F2A22;
  --highlight: #D2AE6D;
  --highlight-ink: #1F2A22;
  --gold: #D2AE6D;
}
[data-palette="paper"] {
  --bg: #F6F4EE;
  --bg-soft: #ECE8DD;
  --bg-card: #FFFFFF;
  --ink: #14171A;
  --ink-soft: #3D434A;
  --ink-mute: #7C8089;
  --line: #14171A;
  --line-soft: rgba(20,23,26,0.12);
  --accent: #173B66;
  --accent-ink: #F6F4EE;
  --highlight: #D2AE6D;
  --highlight-ink: #14171A;
  --gold: #D2AE6D;
}
[data-palette="rose"] {
  --bg: #F5E9DF;
  --bg-soft: #EFDDCD;
  --bg-card: #FBF3EA;
  --ink: #2B1A18;
  --ink-soft: #5A3D38;
  --ink-mute: #8A6A63;
  --line: #2B1A18;
  --line-soft: rgba(43,26,24,0.14);
  --accent: #6B2A2A;
  --accent-ink: #F5E9DF;
  --highlight: #D2AE6D;
  --highlight-ink: #2B1A18;
  --gold: #D2AE6D;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s ease, color 0.4s ease;
}
.serif {
  font-family: "Instrument Serif", "Newsreader", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}
[data-display="geist"] .serif,
[data-display="geist"] .display {
  font-family: "Geist", sans-serif !important;
  font-weight: 500;
  letter-spacing: -0.04em;
}
.mono {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- RIBBON ---------- */
.ribbon {
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.ribbon-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.ribbon-left { display: flex; align-items: center; gap: 14px; }
.ribbon-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--highlight);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--highlight) 30%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.ribbon-right { display: flex; align-items: center; gap: 28px; }
.ribbon-right a { text-decoration: none; opacity: 0.85; }
.ribbon-right a:hover { opacity: 1; }

/* ---------- NAV ---------- */
.nav {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 48px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.brand-mark sup {
  font-style: normal;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  vertical-align: super;
  margin-left: 2px;
}
/* Logo image — mix-blend-mode multiplies out the white background of the
   current logo PNG so it sits cleanly on any palette. Once a transparent-bg
   (or SVG) version of the logo is available, remove the blend-mode rule. */
.brand-logo {
  height: 200px;
  width: auto;
  display: block;
  mix-blend-mode: multiply;
}
.foot-brand .brand-logo {
  height: 200px;
  margin-bottom: 4px;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover::after,
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--ink);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 11px 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  transition: transform 0.2s ease;
}
.nav-cta:hover { transform: translateY(-1px); }
.nav-cta-arrow {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--highlight);
  color: var(--highlight-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--highlight); border-color: var(--highlight); color: var(--highlight-ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn-arrow {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- SECTION ---------- */
.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--line);
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  margin-bottom: 64px;
  align-items: end;
}
.section-eyebrow {
  color: var(--ink-mute);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--ink-mute);
}
.section-title {
  font-family: "Instrument Serif", serif;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 400;
  color: var(--ink);
  text-wrap: balance;
}
.section-title em {
  font-style: italic;
  color: var(--highlight);
}
.section-intro {
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0;
}

/* ---------- FOOTER ---------- */
footer.foot {
  padding: 80px 0 40px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 80px;
}
.foot-brand .brand-mark { font-size: 72px; }
/* Dark backgrounds need a different blend approach for the white-bg logo —
   `screen` keeps the gold/black readable while making white blend with the ink.
   Apply manually on dark sections if you use the logo there. */
.brand-logo.on-dark { mix-blend-mode: screen; }
.foot-brand p {
  margin: 16px 0 0;
  color: var(--ink-soft);
  max-width: 32ch;
  font-size: 15px;
}
.foot-col h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin: 0 0 18px;
  font-weight: 500;
  font-family: "Geist Mono", monospace;
}
.foot-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.foot-col a {
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
}
.foot-col a:hover { color: var(--highlight); }
.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-mute);
}
.foot-bottom-right {
  display: flex;
  gap: 24px;
}
.megaword {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: clamp(120px, 22vw, 380px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin: 60px 0 0;
  text-align: center;
  user-select: none;
  overflow: hidden;
  cursor: default;
}
.megaword .dot { color: var(--highlight); }

/* ---------- PAGE HEADER (subpages) ---------- */
.page-header {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--line);
}
.page-header-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: end;
}
.page-header-meta {
  display: flex;
  gap: 18px;
  margin-bottom: 28px;
  color: var(--ink-mute);
  flex-wrap: wrap;
}
.page-header h1 {
  font-family: "Instrument Serif", serif;
  font-size: clamp(56px, 7vw, 116px);
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 0;
  font-weight: 400;
  color: var(--ink);
  text-wrap: balance;
}
.page-header h1 em {
  font-style: italic;
  color: var(--highlight);
}
.page-header-lede {
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0;
}

/* ---------- SHARED ELEMENTS ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  background: var(--highlight);
  color: var(--highlight-ink);
  padding: 4px 10px;
  border-radius: 999px;
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tag.muted {
  background: transparent;
  color: var(--ink-mute);
  border: 1px solid var(--line-soft);
}

/* responsive */
@media (max-width: 960px) {
  .nav-inner { grid-template-columns: auto auto; gap: 16px; }
  .nav-links { display: none; }
  .section-head, .foot-grid, .page-header-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .section { padding: 56px 0; }
  .container { padding: 0 20px; }
  .brand-logo { height: 120px; }
  .foot-brand .brand-logo { height: 120px; }
}

/* prevent horizontal overflow on small screens */
html, body { overflow-x: hidden; }

@media (max-width: 700px) {
  .ribbon-inner { padding: 0 20px; gap: 12px; }
  .ribbon-right { display: none; }
  .ribbon-left .mono { font-size: 11px; }
}
