/* The Chant Studio — shared styles.
   Every page loads this file; each design option adds its own site.css.
   Branding follows the business card: one ink (PMS 476) on plain white,
   Minion-style serif (Crimson Pro on the web), letter-spaced small caps,
   old-style numerals, and the script "of" as a blind deboss. */

/* ---------- Fonts (self-hosted: no requests to Google or Adobe) ----------
   Crimson Pro stands in for the card's Minion Pro, which can't be self-hosted.
   Gentium covers Greek only (Crimson Pro has none). The 500 and 700 files add
   e-macron for the English syllabifier's thē. See ../fonts/OFL.txt. */
@font-face { font-family: "Crimson Pro"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/crimson-400.woff2") format("woff2"); }
@font-face { font-family: "Crimson Pro"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/crimson-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Crimson Pro"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/crimson-500.woff2?v=7a214993") format("woff2"); }
@font-face { font-family: "Crimson Pro"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/crimson-700.woff2?v=39ed1c37") format("woff2"); }
@font-face { font-family: "Studio Greek"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/greek-400.woff2") format("woff2");
             unicode-range: U+0300-036F, U+0370-03FF, U+1F00-1FFF; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #4e3629;        /* PMS 476 C */
  --ink-soft: #7d6a5d;   /* secondary text */
  --tint: #c5baac;       /* the deboss, as the printer's proof shows it */
  --rule: #e9e3dc;
  --wash: #faf8f6;       /* barely-there surface for inputs */
  --draft: #fbefb4;
  --draft-ink: #5c4a00;

  --serif: "Crimson Pro", "Studio Greek", "Minion Pro", Georgia, serif;

  --step--1: 0.85rem;
  --step-0: 1.2rem;
  --step-1: 1.4rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.1rem, 1.6rem + 2.2vw, 3.1rem);

  --measure: 60ch;
  --gutter: clamp(16px, 4vw, 40px);
  --page: 1080px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--serif);
  font-variant-numeric: oldstyle-nums;
  padding-inline: var(--gutter);
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; text-decoration-color: var(--tint); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; text-wrap: balance; margin: 0; font-weight: 500; }
p { margin: 0; }
strong { font-weight: 700; }
.prose { display: grid; gap: 1em; max-width: var(--measure); }

/* Card typography: capitals at 80% with generous spacing (THE CHANT STUDIO),
   and bold small caps for names and headings (JOSHUA BOYD). */
.caps {
  text-transform: uppercase;
  font-size: 0.8em;
  letter-spacing: 0.12em;
  font-weight: 500;
}
.smallcaps {
  font-variant-caps: small-caps;
  letter-spacing: 0.14em;
  font-weight: 700;
}
.muted { color: var(--ink-soft); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--paper); padding: 6px 10px; z-index: 10; }

/* Text the owner still needs to write or confirm. Remove the class when filled in. */
.draft {
  background: var(--draft);
  color: var(--draft-ink);
  border-radius: 3px;
  padding-inline: 0.2em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 0.8rem/1 var(--serif);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 1em 1.6em;
  border-radius: 2px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #3d2a20; border-color: #3d2a20; }
.button.quiet { background: transparent; color: var(--ink); border-color: var(--tint); }
.button.quiet:hover { border-color: var(--ink); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Header and footer ---------- */
.site-header {
  max-width: var(--page); margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px;
  padding-block: 22px;
}
.brand { display: block; line-height: 0; }
.brand img { height: auto; width: clamp(220px, 34vw, 320px); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 26px; }
.site-nav a {
  text-decoration: none;
  text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.14em; font-weight: 500;
}
.site-nav a:hover { text-decoration: underline; text-decoration-color: var(--tint); }

.site-footer {
  max-width: var(--page); margin-inline: auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-block: 28px 44px;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.site-footer a { color: var(--ink-soft); }

/* ---------- Contact (the card's bottom line) ---------- */
.contact-email { font-size: var(--step-2); overflow-wrap: anywhere; }
.contact-other { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.contact-other a { text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.14em; font-weight: 500; }

/* ---------- Syllabifier page ---------- */
.tool { max-width: var(--page); margin-inline: auto; display: grid; gap: 22px; padding-block: 12px 56px; }
.tool-head { display: grid; gap: 8px; }
.beta {
  justify-self: start; max-width: var(--measure);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px;
  padding: 8px 12px; border: 1px solid var(--tint); border-radius: 2px;
  background: var(--wash); color: var(--ink-soft); font-size: 1.05rem;
}
.beta strong { text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.14em; font-weight: 500; color: var(--ink); }
.tool-head h1 { font-size: var(--step-2); }
.tool-head p { color: var(--ink-soft); max-width: var(--measure); }

.tool-options {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px;
  padding-block: 12px; border-block: 1px solid var(--rule);
  font-size: 1.05rem;
}
.tool-options label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.tool-options select {
  font: inherit; font-size: 16px; /* iOS zooms in on controls under 16px */
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--tint); border-radius: 2px; padding: 4px 8px;
}
.tool-options input[type=checkbox] { accent-color: var(--ink); width: 15px; height: 15px; }

.sheets { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .sheets { grid-template-columns: 1fr; } }
.sheet { display: grid; grid-template-rows: auto 1fr; gap: 8px; min-width: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head .label { text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.14em; font-weight: 500; color: var(--ink-soft); }
.count { text-transform: none; letter-spacing: 0; font-variant-numeric: oldstyle-nums tabular-nums; }
.sheet textarea {
  width: 100%; min-height: 300px; resize: vertical;
  font: 1.2rem/1.75 var(--serif); color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 2px;
  padding: 14px 16px;
}
.sheet textarea#out { background: var(--wash); border-color: var(--tint); }
.sheet .button { padding: 0.7em 1.1em; }

.tool-notes { display: grid; gap: 8px; max-width: 78ch; color: var(--ink-soft); font-size: 1.05rem; }
.tool-notes h2 { text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.14em; font-weight: 500; }
.tool-notes .gk { color: var(--ink); }
.tool-notes .gk b { color: var(--tint); font-weight: 400; }

/* ---------- Not-found page ---------- */
.notfound { max-width: var(--page); margin-inline: auto; padding-block: 12vh 16vh; display: grid; gap: 16px; }
.notfound h1 { font-size: var(--step-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.tool-head h1 .dot { color: var(--tint); }
