/* =============================================================
   LOOPN · v1.2 · SHARED STYLESHEET
   Brand-locked tokens. Used by index, about, privacy, terms.
   Body ground: warm-white #FAF8F2.
   Five colors. No additions. Gold is for the dot only.
   ============================================================= */

:root {
  --warm-white: #FAF8F2;
  --paper:      #F4EFE6;
  --paper-deep: #ECE4D2;
  --paper-lite: #FBF6EB;
  --ink:        #181612;
  --ink-70:     #3A3530;
  --ink-50:     #6B665B;
  --ink-30:     #9A8F7E;
  --ink-10:     #D9D2C2;
  --green:      #2D4A3E;
  --green-deep: #1F362C;
  --gold:       #C8A165;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--warm-white);
  color: var(--ink);
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-feature-settings: 'ss01', 'ss02';
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Paper grain — extremely subtle SVG noise */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
  opacity: 0.45;
}

main, header, footer, section { position: relative; z-index: 2; }

/* ---------- TYPOGRAPHY ---------- */
.display {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.98;
}
.display em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  color: var(--ink);
}
.serif-body {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}

/* ---------- THE DOT (active-state indicator) ---------- */
.dot {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 999px;
  display: inline-block;
  position: relative;
  flex: none;
}
.dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  opacity: 0.4;
  animation: pulse 2.4s cubic-bezier(.2,.6,.3,1) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 0.4; }
  50%      { transform: scale(1.4); opacity: 0; }
}

/* ---------- HERO RIPPLE BINDU (animated · only used on home hero) ---------- */
.hero-mark {
  width: 96px; height: 96px;
  flex: none;
  position: relative;
  display: block;
}
.hero-mark .core { fill: var(--gold); }
.hero-mark .ring {
  fill: none;
  stroke: var(--gold);
  stroke-width: 18;
  transform-origin: 512px 512px;
  transform-box: fill-box;
  /* Resting state — full radius, visible. Without this, reduced-motion users see only the dot. */
  opacity: 0.55;
}
.hero-mark .ring.r2 { opacity: 0.38; }
.hero-mark .ring.r3 { opacity: 0.22; }
@media (prefers-reduced-motion: no-preference) {
  .hero-mark .ring { animation: ripple 4s cubic-bezier(.2,.6,.3,1) infinite; }
  .hero-mark .ring.r2 { animation-delay: -1.33s; }
  .hero-mark .ring.r3 { animation-delay: -2.66s; }
  @keyframes ripple {
    0%   { transform: scale(0.18); opacity: 0.85; stroke-width: 24; }
    60%  { transform: scale(1.0);  opacity: 0.32; stroke-width: 16; }
    100% { transform: scale(1.6);  opacity: 0;    stroke-width: 8; }
  }
}
@media (max-width: 767px) {
  .hero-mark { width: 80px; height: 80px; }
}

/* ---------- MONOGRAM SEAL (Sunday Loop signature) ---------- */
.seal {
  width: 96px; height: 96px;
  display: block;
  margin: 0 auto;
}

/* ---------- REVEAL-ON-SCROLL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.1s cubic-bezier(.2,.6,.2,1), transform 1.1s cubic-bezier(.2,.6,.2,1);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot::after { animation: none; }
  .hero-mark .ring { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- "STRIKE" for the IS-NOT column ---------- */
.strike {
  color: var(--ink);
  opacity: 0.35;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(24, 22, 18, 0.7);
}

/* ---------- LETTER (Sunday Loop card + memory card) ---------- */
.letter {
  background: var(--paper-lite);
  border: 1px solid rgba(24, 22, 18, 0.06);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 24px 60px -28px rgba(24, 22, 18, 0.18),
    0 4px 12px -6px rgba(24, 22, 18, 0.08);
}

/* ---------- THREAD ILLUSTRATION ---------- */
.thread { stroke: var(--green); stroke-width: 1.3; fill: none; opacity: 0.5; }
.thread-old { stroke-dasharray: 3 4; opacity: 0.4; }

/* ---------- QUIET LINK ---------- */
.ulink {
  position: relative;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: opacity 0.2s ease;
  text-decoration: none;
  color: inherit;
}
.ulink:hover, .ulink:focus-visible { opacity: 0.65; }
a:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 2px; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- ACCESS FORM ---------- */
input.access {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(24, 22, 18, 0.4);
  border-radius: 0;
  padding: 12px 0;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  width: 100%;
  transition: border-color 0.25s ease;
}
input.access:focus { outline: none; border-bottom-color: var(--green); }
input.access::placeholder { color: rgba(24, 22, 18, 0.35); }

button.submit {
  background: var(--green);
  color: var(--warm-white);
  padding: 14px 28px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
button.submit:hover, button.submit:focus-visible { background: var(--green-deep); transform: translateY(-1px); }
button.submit:disabled { opacity: 0.6; cursor: progress; transform: none; }

/* ============================================================
   STICKY NAV — v3 (centered lockup, shrink-on-scroll, mobile menu)
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  background: rgba(250, 248, 242, 0.78);
  border-bottom: 1px solid rgba(24, 22, 18, 0.06);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.nav-row {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: flex-end; /* nav links anchor right; lockup is absolutely centered */
  position: relative;
  transition: height 0.3s cubic-bezier(.2,.6,.2,1);
}
.nav-lockup {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: inherit;
}
.nav-lockup .nav-mark { width: 60px; height: 60px; flex: none; transition: width 0.3s ease, height 0.3s ease; }
.nav-lockup .nav-wordmark { height: 52px; width: auto; transition: height 0.3s ease; }

/* Shrunk state — applied via JS once user scrolls past 80px */
.nav.is-shrunk .nav-row { height: 76px; }
.nav.is-shrunk .nav-lockup .nav-mark { width: 40px; height: 40px; }
.nav.is-shrunk .nav-lockup .nav-wordmark { height: 32px; }

/* Mobile: revert to left-aligned lockup so hamburger has room. */
@media (max-width: 767px) {
  .nav-row { justify-content: space-between; height: 76px; }
  .nav-lockup {
    position: static;
    transform: none;
    left: auto;
    top: auto;
    gap: 14px;
  }
  .nav-lockup .nav-mark { width: 44px; height: 44px; }
  .nav-lockup .nav-wordmark { height: 36px; }
  .nav.is-shrunk .nav-row { height: 60px; }
  .nav.is-shrunk .nav-lockup .nav-mark { width: 32px; height: 32px; }
  .nav.is-shrunk .nav-lockup .nav-wordmark { height: 26px; }
}

/* Desktop nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--ink-70);
}
.nav-links a { color: inherit; }
.nav-links .nav-cta {
  background: var(--ink);
  color: var(--warm-white);
  padding: 10px 20px;
  border-radius: 999px;
  border-bottom: 0;
  font-weight: 500;
  font-size: 13px;
  transition: background 0.2s ease;
}
.nav-links .nav-cta:hover { background: var(--green); opacity: 1; }

/* Hamburger */
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.nav-burger span {
  display: block;
  position: absolute;
  left: 9px;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s cubic-bezier(.2,.6,.2,1), opacity 0.2s ease;
}
.nav-burger span:nth-child(1) { top: 14px; }
.nav-burger span:nth-child(2) { top: 20px; }
.nav-burger span:nth-child(3) { top: 26px; }
.nav-burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile menu overlay */
.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--warm-white);
  z-index: 40;
  flex-direction: column;
  padding: 96px 32px 48px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.nav-mobile.is-open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}
.nav-mobile a {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-size: 36px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  padding: 16px 0;
  border-bottom: 1px solid rgba(24, 22, 18, 0.08);
}
.nav-mobile a:last-child { border-bottom: 0; }

@media (max-width: 767px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
}

/* ---------- LAYOUT HELPERS ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .container { padding: 0 40px; } }

.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .container-narrow { padding: 0 40px; } }

.grid { display: grid; }
.grid-12 { grid-template-columns: repeat(12, 1fr); gap: 32px; }
@media (max-width: 767px) { .grid-12 { grid-template-columns: 1fr; gap: 24px; } }

.col-span-5 { grid-column-end: span 5; } .col-start-7 { grid-column-start: 7; }
.col-span-7 { grid-column-end: span 7; } .col-span-4 { grid-column-end: span 4; }
.col-start-9 { grid-column-start: 9; }
@media (max-width: 767px) {
  [class*="col-span-"], [class*="col-start-"] { grid-column: 1 / -1; }
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-50);
}

/* ---------- TYPE SCALE ---------- */
h1.hero {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: 400;
  letter-spacing: -0.022em;
  line-height: 1.0;
  font-size: clamp(44px, 7vw, 96px);
  margin: 0;
  max-width: 18ch;
}
h1.hero em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

h2.section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.04;
  font-size: clamp(36px, 5.4vw, 72px);
  margin: 0 0 1rem;
}
h2.section-title em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

h3.subhead {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: 400;
  letter-spacing: -0.016em;
  line-height: 1.05;
  font-size: clamp(28px, 3.6vw, 44px);
  margin: 0;
}
h3.subhead em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

/* ---------- LONG-FORM PROSE (about, privacy, terms) ---------- */
.prose {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-70);
  max-width: 65ch;
}
.prose p { margin: 0 0 1.2em; }
.prose h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: 400;
  letter-spacing: -0.018em;
  font-size: clamp(28px, 3.4vw, 36px);
  line-height: 1.15;
  color: var(--ink);
  margin: 2.4em 0 0.6em;
}
.prose h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: 500;
  font-size: 20px;
  color: var(--ink);
  margin: 1.8em 0 0.4em;
}
.prose ul { margin: 0 0 1.2em; padding-left: 1.2em; }
.prose ul li { margin-bottom: 0.5em; }
.prose a { color: var(--ink); border-bottom: 1px solid var(--ink-30); text-decoration: none; transition: border-color 0.2s ease; }
.prose a:hover { border-color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 500; }
.prose em { font-style: italic; }
.prose code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  background: rgba(24,22,18,0.05);
  padding: 1px 6px;
  border-radius: 3px;
}

/* ---------- SECTION RHYTHM ---------- */
.pad-x { padding-left: 24px; padding-right: 24px; }
.pad-y { padding-top: 96px; padding-bottom: 96px; }
@media (min-width: 768px) {
  .pad-x { padding-left: 40px; padding-right: 40px; }
  .pad-y { padding-top: 144px; padding-bottom: 144px; }
}
.pad-y-sm { padding-top: 72px; padding-bottom: 72px; }
@media (min-width: 768px) { .pad-y-sm { padding-top: 112px; padding-bottom: 112px; } }
.pad-y-md { padding-top: 96px; padding-bottom: 96px; }
@media (min-width: 768px) { .pad-y-md { padding-top: 128px; padding-bottom: 128px; } }

/* ---------- COLOR HELPERS ---------- */
.text-ink-70 { color: var(--ink-70); }
.text-ink-50 { color: var(--ink-50); }
.text-ink-30 { color: var(--ink-30); }

.on-dark { background: var(--ink); color: var(--warm-white); }
.on-dark .text-ink-50 { color: rgba(250, 248, 242, 0.55); }
.on-dark .text-ink-70 { color: rgba(250, 248, 242, 0.75); }
.on-dark .eyebrow { color: rgba(250, 248, 242, 0.55); }
.on-dark .border-rule { border-color: rgba(250, 248, 242, 0.1); }

.on-paper { background: rgba(236, 228, 210, 0.4); }
.border-rule { border-top: 1px solid rgba(24, 22, 18, 0.08); }

/* ---------- LISTS ---------- */
ul.clean { list-style: none; padding: 0; margin: 0; }

/* ---------- SKIP LINK (a11y) ---------- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--warm-white);
  padding: 12px 16px; z-index: 100;
  text-decoration: none; border-radius: 0 0 6px 0;
}
.skip:focus { left: 0; }

/* ---------- FIELD NOTES (blog cards on About page) ---------- */
.note-card {
  display: block;
  padding: 32px 0;
  border-top: 1px solid rgba(24, 22, 18, 0.08);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}
.note-card:last-child { border-bottom: 1px solid rgba(24, 22, 18, 0.08); }
.note-card:hover { opacity: 0.7; }
.note-card .note-meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-50);
  margin-bottom: 12px;
}
.note-card .note-title {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: 400;
  letter-spacing: -0.015em;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 12px;
}
.note-card .note-excerpt {
  color: var(--ink-70);
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
  max-width: 60ch;
}

/* Print */
@media print {
  body::before { display: none; }
  .nav, footer, .nav-mobile { display: none; }
  section { padding: 24px 0 !important; break-inside: avoid; }
}

/* Helpful inline-on-md utility (keep in sync with mobile nav rules) */
@media (min-width: 768px) {
  [data-md-inline] { display: inline !important; }
}
