/* ============================================================
   Bindery HQ — shared stylesheet
   Aesthetic: editorial / old-world bookbindery
   Paper + ink + bookcloth red + antique gold foil
   ============================================================ */

:root {
  --paper:        #f6f1e7;
  --paper-deep:   #efe7d8;
  --paper-card:   #fbf8f1;
  --ink:          #211c16;
  --ink-soft:     #4d463b;
  --ink-faint:    #6f675a;
  --oxblood:      #6e2128;
  --oxblood-deep: #531419;
  --gold:         #9a7634;
  --gold-bright:  #b08e4a;
  --rule:         rgba(33, 28, 22, 0.16);
  --rule-strong:  rgba(33, 28, 22, 0.32);

  --display: "Fraunces", Georgia, serif;
  --body:    "Newsreader", Georgia, serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  --measure: 68ch;
  --wrap: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.02rem, 0.96rem + 0.3vw, 1.16rem);
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
}

/* ---------- Layout helpers ---------- */
.wrap { width: min(var(--wrap), 92vw); margin-inline: auto; }
.narrow { width: min(74ch, 92vw); margin-inline: auto; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin: 0 0 1.2rem;
  display: inline-block;
}

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; }
a { color: var(--oxblood); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--oxblood-deep); }

/* ---------- Header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand .emblem { width: 30px; height: 38px; color: var(--oxblood); flex: none; }
.brand .wordmark { font-family: var(--display); font-weight: 600; font-size: 1.32rem; letter-spacing: -0.01em; }
.brand .wordmark .the { font-style: italic; font-weight: 400; color: var(--ink-soft); margin-right: 0.12em; }

.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  position: relative;
  padding: 0.2rem 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--oxblood);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.32s cubic-bezier(0.2,0.7,0.2,1);
}
.nav a:hover { color: var(--oxblood); }
.nav a:hover::after { transform: scaleX(1); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 2;
  padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--rule);
}
.hero-rule-top {
  border: 0;
  border-top: 3px double var(--rule-strong);
  margin: 0 0 clamp(2.5rem, 6vw, 4.5rem);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.7rem, 1.6rem + 5.4vw, 5.4rem);
  margin: 0 0 1.3rem;
  letter-spacing: -0.022em;
}
.hero h1 .the { display: block; font-style: italic; font-weight: 400; font-size: 0.42em; color: var(--ink-soft); letter-spacing: 0.02em; margin-bottom: 0.1em; }
.hero .lede {
  font-size: clamp(1.15rem, 1.02rem + 0.6vw, 1.42rem);
  color: var(--ink-soft);
  max-width: 34ch;
  margin: 0 0 2rem;
  line-height: 1.5;
}
.platforms {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 2.2rem;
}
.platforms .dot { color: var(--gold); }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.btn {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.85rem 1.4rem;
  border-radius: 2px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
  cursor: pointer;
  border: 1px solid var(--ink);
}
.btn-primary { background: var(--oxblood); border-color: var(--oxblood); color: var(--paper-card); }
.btn-primary:hover { background: var(--oxblood-deep); border-color: var(--oxblood-deep); color: var(--paper-card); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }

/* Hero emblem panel */
.hero-art {
  display: flex;
  justify-content: center;
}
.hero-art .seal {
  width: min(300px, 70%);
  height: auto;
  color: var(--oxblood);
}

/* ---------- Ornament divider ---------- */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  color: var(--gold);
  margin: clamp(3rem, 7vw, 5.5rem) 0;
}
.ornament::before, .ornament::after {
  content: "";
  height: 1px;
  width: min(28%, 240px);
  background: linear-gradient(to var(--dir, right), transparent, var(--rule-strong));
}
.ornament::before { --dir: left; }
.ornament span { font-size: 1.1rem; letter-spacing: 0.4em; }

/* ---------- Sections ---------- */
.section { position: relative; z-index: 2; padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.8rem); margin: 0 0 0.8rem; }
.section-head p { color: var(--ink-soft); margin: 0; max-width: 52ch; }

/* Intro / about with drop cap */
.colophon-intro p { font-size: clamp(1.12rem, 1rem + 0.5vw, 1.3rem); color: var(--ink-soft); max-width: var(--measure); line-height: 1.62; }
.colophon-intro p:first-of-type::first-letter {
  font-family: var(--display);
  font-weight: 600;
  float: left;
  font-size: 3.9em;
  line-height: 0.74;
  padding: 0.06em 0.12em 0 0;
  color: var(--oxblood);
}

/* ---------- Feature grid ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.feature {
  background: var(--paper-card);
  padding: clamp(1.6rem, 3vw, 2.2rem);
}
.feature .no {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  display: block;
  margin-bottom: 1rem;
}
.feature h3 { font-size: 1.42rem; margin: 0 0 0.6rem; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.55; }

/* Highlight band (privacy) */
.band {
  position: relative;
  z-index: 2;
  background: var(--ink);
  color: var(--paper);
  padding: clamp(3rem, 7vw, 5rem) 0;
}
.band .eyebrow { color: var(--gold-bright); }
.band h2 { color: var(--paper); font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem); margin: 0 0 1.2rem; max-width: 18ch; }
.band p { color: color-mix(in srgb, var(--paper) 78%, transparent); max-width: 56ch; margin: 0 0 1rem; }
.band .ledger { display: flex; flex-wrap: wrap; gap: 2.4rem; margin-top: 2.4rem; }
.band .ledger div { max-width: 26ch; }
.band .ledger strong { font-family: var(--display); font-weight: 600; display: block; font-size: 1.15rem; color: var(--gold-bright); margin-bottom: 0.3rem; }
.band .ledger p { font-size: 0.96rem; margin: 0; }

/* ---------- Download ---------- */
.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.dl-card {
  border: 1px solid var(--rule-strong);
  background: var(--paper-card);
  padding: 1.6rem;
  border-radius: 2px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.dl-card:hover { transform: translateY(-3px); border-color: var(--oxblood); color: var(--ink); }
.dl-card .os { font-family: var(--display); font-weight: 600; font-size: 1.3rem; }
.dl-card .meta { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }

/* Coming-soon variant: non-interactive */
.dl-card.is-soon { cursor: default; border-style: dashed; border-color: var(--rule-strong); opacity: 0.92; }
.dl-card.is-soon:hover { transform: none; border-color: var(--rule-strong); }
.dl-card .soon {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.1rem;
}
.dl-card .soon::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }
.note {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-top: 1.4rem;
}

/* ---------- Prose (legal / support pages) ---------- */
.page-head {
  position: relative;
  z-index: 2;
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}
.page-head h1 { font-size: clamp(2.2rem, 1.5rem + 2.6vw, 3.6rem); margin: 0.6rem 0 0.6rem; }
.page-head .updated { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; color: var(--ink-faint); }

.prose { position: relative; z-index: 2; padding: clamp(2.5rem, 5vw, 4rem) 0 1rem; }
.prose .narrow > * { max-width: var(--measure); }
.prose h2 {
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
  margin: 2.6rem 0 0.8rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
.prose h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.prose h3 { font-size: 1.2rem; margin: 1.8rem 0 0.5rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.5rem; }
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-deep);
  padding: 0.1em 0.4em;
  border-radius: 2px;
}
.callout {
  border-left: 3px solid var(--gold);
  background: var(--paper-card);
  padding: 1rem 1.3rem;
  margin: 1.6rem 0;
  max-width: var(--measure);
}
.callout p { margin: 0; color: var(--ink-soft); }

/* FAQ */
.faq { border-top: 1px solid var(--rule); }
.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 1.3rem 0;
  max-width: var(--measure);
}
.faq summary {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--oxblood); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0.9rem 0 0; color: var(--ink-soft); }

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.contact-cards .card {
  border: 1px solid var(--rule-strong);
  background: var(--paper-card);
  padding: 1.5rem;
  border-radius: 2px;
}
.contact-cards .card .label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 0.6rem; }
.contact-cards .card a { font-family: var(--display); font-size: 1.18rem; font-weight: 600; word-break: break-word; }
.contact-cards .card p { margin: 0.5rem 0 0; font-size: 0.92rem; color: var(--ink-faint); }

/* ---------- Footer / colophon ---------- */
.colophon {
  position: relative;
  z-index: 2;
  border-top: 3px double var(--rule-strong);
  background: var(--paper-deep);
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 2.5rem;
}
.colophon .wrap { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
.colophon .mark { display: inline-flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.colophon .mark .emblem { width: 24px; height: 30px; color: var(--oxblood); }
.colophon .mark .wordmark { font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.colophon .mark .wordmark .the { font-style: italic; font-weight: 400; color: var(--ink-soft); }
.colophon p { font-size: 0.92rem; color: var(--ink-soft); margin: 0 0 0.4rem; max-width: 34ch; }
.colophon h4 { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 1rem; font-weight: 500; }
.colophon ul { list-style: none; margin: 0; padding: 0; }
.colophon ul li { margin-bottom: 0.55rem; }
.colophon ul a { font-family: var(--body); font-size: 0.96rem; color: var(--ink-soft); text-decoration: none; }
.colophon ul a:hover { color: var(--oxblood); text-decoration: underline; }
.colophon .legal {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rule);
  margin-top: 1rem;
  padding-top: 1.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
}

/* ---------- Load animation ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.rise { opacity: 0; animation: rise 0.85s cubic-bezier(0.2,0.7,0.2,1) forwards; }
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.18s; }
.d3 { animation-delay: 0.31s; }
.d4 { animation-delay: 0.44s; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art .seal { width: 180px; }
  .colophon .wrap { grid-template-columns: 1fr 1fr; }
  .colophon .mark { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .nav { display: none; }
  .nav.open { display: flex; position: absolute; top: 100%; right: 4vw; flex-direction: column; gap: 1rem; background: var(--paper-card); border: 1px solid var(--rule-strong); padding: 1.2rem 1.5rem; border-radius: 3px; }
  .nav-toggle { display: inline-flex; background: none; border: 1px solid var(--rule-strong); border-radius: 2px; padding: 0.5rem 0.7rem; cursor: pointer; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); }
  .colophon .wrap { grid-template-columns: 1fr; }
}

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