/* ==========================================================================
   The Manuscript Desk — shared stylesheet
   Palette: Quink blue-black ink, foolscap grey-green paper, ribbon red
   Type:    Courier Prime (typescript) / Literata (reading) / Petit Formal Script (longhand)
   ========================================================================== */

:root {
  --ink:          #1a2540;
  --ink-soft:     #45536f;
  --paper:        #eceee8;
  --paper-raised: #f7f7f4;
  --ribbon:       #9e2b25;
  --ribbon-tint:  #f0e3e1;
  --pencil:       #7d7a6e;
  --rule:         #d5d8cf;

  --measure: 34rem;
  --page:    68rem;

  --step--1: clamp(0.86rem, 0.83rem + 0.14vw, 0.94rem);
  --step-0:  clamp(1.06rem, 1.01rem + 0.24vw, 1.19rem);
  --step-1:  clamp(1.28rem, 1.18rem + 0.44vw, 1.5rem);
  --step-2:  clamp(1.55rem, 1.36rem + 0.82vw, 2rem);
  --step-3:  clamp(1.85rem, 1.5rem + 1.5vw, 2.75rem);
  --step-4:  clamp(2.2rem, 1.5rem + 3vw, 4rem);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Literata", Georgia, "Times New Roman", serif;
  font-size: var(--step-0);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

/* faint horizontal ruling, like manuscript paper */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 35px,
    rgba(26, 37, 64, 0.035) 35px,
    rgba(26, 37, 64, 0.035) 36px
  );
}
body > * { position: relative; z-index: 1; }

img { max-width: 100%; display: block; }

a { color: var(--ribbon); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

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

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- layout ---------------------------------------------------- */

.wrap {
  width: min(100% - 2.5rem, var(--page));
  margin-inline: auto;
}

.band { padding-block: clamp(3rem, 8vw, 5.5rem); }
.band + .band { border-top: 1px solid var(--rule); }
.band--raised { background: var(--paper-raised); }

/* the signature: a ribbon-red margin rule, as on manuscript paper,
   with the section label hanging in the margin beside it */
.ruled {
  border-left: 1px solid var(--ribbon);
  padding-left: clamp(1.1rem, 3vw, 2.4rem);
}

.eyebrow {
  font-family: "Courier Prime", "Courier New", monospace;
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ribbon);
  margin: 0 0 0.9rem;
}

h1, h2, h3, h4 {
  font-family: "Courier Prime", "Courier New", monospace;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 0.7em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); }

p { margin: 0 0 1.15em; max-width: var(--measure); }
.lede { font-size: var(--step-1); line-height: 1.55; color: var(--ink-soft); max-width: 38rem; }
.wide { max-width: 46rem; }

.hand {
  font-family: "Petit Formal Script", "Snell Roundhand", cursive;
  color: var(--ink-soft);
}

/* ---------- header ----------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper-raised);
}
.masthead__inner {
  display: flex; flex-wrap: wrap; gap: 0.9rem 2rem;
  align-items: baseline; justify-content: space-between;
  padding-block: 1.1rem;
}
.brand {
  font-family: "Courier Prime", monospace;
  font-weight: 700; font-size: 1.16rem;
  letter-spacing: 0.02em;
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: baseline; gap: 0.5rem;
}
.brand__mark {
  color: var(--ribbon);
  font-family: "Petit Formal Script", cursive;
  font-size: 1.5rem; font-weight: 400;
}
.brand:hover { color: var(--ribbon); }

.nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1.35rem; }
.nav a {
  font-family: "Courier Prime", monospace;
  font-size: 0.88rem; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none;
  padding-block: 0.15rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ribbon); }

/* ---------- hero ------------------------------------------------------- */

.hero { padding-block: clamp(3rem, 9vw, 6.5rem); position: relative; overflow: hidden; }

.hero__video-wrap { position: absolute; inset: 0; z-index: 0; }
.hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero__overlay {
  position: absolute; inset: 0;
  background: var(--paper);
  opacity: 0.4;
}
.hero > .wrap { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .hero__video { display: none; }
}
@media (max-width: 34rem) {
  .hero__video { display: none; } /* skip video on small screens: saves data, avoids autoplay issues */
}

/* longhand becoming typescript — the thing the service actually does */
.transform {
  margin: 0 0 2.2rem;
  min-height: 4.4em;
  font-size: clamp(1.4rem, 4.4vw, 2.5rem);
  line-height: 1.5;
}
.transform span { display: block; }
.transform .is-hand {
  font-family: "Petit Formal Script", cursive;
  color: var(--ink-soft);
  animation: handOut 900ms ease-in 2.6s forwards;
}
.transform .is-type {
  font-family: "Courier Prime", monospace;
  font-weight: 700;
  color: var(--ink);
  opacity: 0;
  animation: typeIn 900ms ease-out 2.6s forwards;
  border-left: 3px solid var(--ribbon);
  padding-left: 0.7rem;
  margin-top: 0.4rem;
}
@keyframes handOut { to { opacity: 0.32; } }
@keyframes typeIn  { from { opacity: 0; transform: translateY(6px); }
                     to   { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .transform .is-hand { opacity: 0.32; }
  .transform .is-type { opacity: 1; }
}

/* ---------- buttons ---------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: "Courier Prime", monospace;
  font-size: 0.94rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.7rem;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper-raised);
  transition: background 0.18s ease, color 0.18s ease;
}
.btn:hover { background: var(--ribbon); border-color: var(--ribbon); color: #fff; }
.btn--quiet { background: transparent; color: var(--ink); }
.btn--quiet:hover { background: var(--ink); color: var(--paper-raised); border-color: var(--ink); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.6rem; }

/* ---------- grids ------------------------------------------------------ */

.grid { display: grid; gap: 2rem; margin-top: 2.5rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); }

.card {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  padding: 1.6rem 1.5rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { margin-bottom: 0; font-size: 0.98rem; }
.card p + p { margin-top: 0.8em; }

/* numbered steps — used only where order genuinely matters */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 2.5rem 0 0; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  gap: 0 1.2rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--rule);
  max-width: 46rem;
}
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: "Courier Prime", monospace;
  font-size: 0.95rem; font-weight: 700;
  color: var(--ribbon);
  padding-top: 0.28rem;
}
.steps h3 { margin-bottom: 0.35rem; }
.steps p { margin-bottom: 0; }

/* ---------- price table ------------------------------------------------ */

.rates { margin-top: 2.5rem; border-top: 2px solid var(--ink); }
.rate {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 2rem;
  align-items: baseline;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--rule);
}
.rate__name { font-family: "Courier Prime", monospace; font-weight: 700; font-size: var(--step-0); }
.rate__price {
  font-family: "Courier Prime", monospace; font-weight: 700;
  font-size: var(--step-1); color: var(--ribbon);
  white-space: nowrap; text-align: right;
}
.rate__note {
  grid-column: 1 / -1;
  font-size: 0.96rem; color: var(--ink-soft);
  margin: 0.35rem 0 0; max-width: 44rem;
}

@media (max-width: 34rem) {
  .rate { grid-template-columns: 1fr; }
  .rate__price { text-align: left; white-space: normal; }
}

.callout {
  background: var(--ribbon-tint);
  border-left: 3px solid var(--ribbon);
  padding: 1.5rem 1.6rem;
  margin: 2.5rem 0 0;
  max-width: 46rem;
}
.callout :last-child { margin-bottom: 0; }
.callout h3 { margin-bottom: 0.45rem; }

.note {
  font-size: 0.94rem;
  color: var(--pencil);
  max-width: 46rem;
}

/* ---------- lists ------------------------------------------------------ */

.ticks { list-style: none; padding: 0; margin: 1.6rem 0 0; max-width: 46rem; }
.ticks li {
  padding: 0.5rem 0 0.5rem 1.9rem;
  position: relative;
  border-bottom: 1px dotted var(--rule);
}
.ticks li::before {
  content: "—";
  position: absolute; left: 0;
  color: var(--ribbon);
  font-family: "Courier Prime", monospace;
}

/* ---------- faq -------------------------------------------------------- */

.faq { margin-top: 2.5rem; max-width: 46rem; }
.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 0.35rem 0;
}
.faq summary {
  cursor: pointer;
  padding: 0.95rem 2rem 0.95rem 0;
  font-family: "Courier Prime", monospace;
  font-weight: 700;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 0.2rem; top: 50%;
  transform: translateY(-50%);
  color: var(--ribbon); font-size: 1.3rem;
}
.faq details[open] summary::after { content: "–"; }
.faq details > *:not(summary) { padding-bottom: 0.4rem; }

/* ---------- form ------------------------------------------------------- */

.form { max-width: 38rem; margin-top: 2.4rem; }
.field { margin-bottom: 1.4rem; }
.field label {
  display: block;
  font-family: "Courier Prime", monospace;
  font-size: 0.88rem; letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 0.45rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  font-family: inherit; font-size: 1rem;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-bottom: 2px solid var(--ink-soft);
  padding: 0.7rem 0.8rem;
  border-radius: 0;
}
.field textarea { min-height: 8.5rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-bottom-color: var(--ribbon);
  background: #fff;
}
.field .hint { font-size: 0.88rem; color: var(--pencil); margin: 0.4rem 0 0; }
fieldset { border: 1px solid var(--rule); padding: 1.1rem 1.2rem; margin: 0 0 1.4rem; }
legend {
  font-family: "Courier Prime", monospace;
  font-size: 0.88rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding-inline: 0.5rem;
}
.check { display: flex; gap: 0.65rem; align-items: flex-start; margin-bottom: 0.6rem; }
.check input { width: auto; margin-top: 0.35rem; }
.check label { text-transform: none; letter-spacing: 0; font-family: inherit; font-size: 1rem; margin: 0; }

/* ---------- footer ----------------------------------------------------- */

.footer {
  border-top: 1px solid var(--rule);
  background: var(--ink);
  color: #c9cfdd;
  padding-block: 3rem 2.2rem;
  font-size: 0.95rem;
}
.footer a { color: #fff; }
.footer a:hover { color: var(--ribbon-tint); }
.footer h4 { color: #fff; margin-bottom: 0.6rem; }
.footer__cols { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.footer__cols p { max-width: 24rem; }
.footer__list { list-style: none; padding: 0; margin: 0; }
.footer__list li { margin-bottom: 0.35rem; }
.footer__base {
  margin-top: 2.4rem; padding-top: 1.3rem;
  border-top: 1px solid rgba(255,255,255,0.16);
  font-size: 0.87rem; color: #97a1b6;
}
