/* Tutor Lawrence — site styles
   Idea: blue ink on paper. The one decorative device is a marked page:
   a learner's sentence with the tutor's corrections written over it. */

@font-face {
  font-family: "Lexend";
  src: url("/assets/fonts/lexend.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("/assets/fonts/caveat.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #f5f6f9;
  --sheet: #ffffff;
  --ink: #0f1b3d;
  --ink-soft: #4a5672;
  --pen: #1b3fcc;
  --pen-dark: #142f9c;
  --highlighter: #ffe25a;
  --rule: #d3d9e6;

  --text: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;

  --step--1: 0.889rem;
  --step-0: 1.0625rem;
  --step-1: 1.35rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  --step-4: clamp(2.2rem, 1.3rem + 4vw, 3.9rem);

  --gap: clamp(1.25rem, 4vw, 2.5rem);
  --band: clamp(3.5rem, 9vw, 7rem);
  --measure: 38rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-0);
  font-weight: 350;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.03em; font-weight: 650; text-wrap: balance; }
h1 { font-size: var(--step-4); letter-spacing: -0.045em; line-height: 1.04; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; }
p { text-wrap: pretty; }

a { color: var(--pen); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--pen-dark); }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2 * var(--gap), 70rem); margin-inline: auto; }
.skip { position: absolute; left: -999rem; top: 0; background: var(--ink); color: #fff; padding: 0.75rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; }
.wordmark { font-weight: 700; font-size: 1.2rem; letter-spacing: -0.04em; white-space: nowrap; color: var(--ink); text-decoration: none; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 1.5rem; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 1rem; padding: 0.4rem 0; }
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -0.55em 0 var(--highlighter); }
.menu-button { display: none; font: inherit; font-size: 1rem; font-weight: 600; color: var(--ink); background: none; border: 1.5px solid var(--ink); border-radius: 6px; padding: 0.45rem 0.8rem; cursor: pointer; }

.button {
  display: inline-block; background: var(--pen); color: #fff; font-weight: 650;
  text-decoration: none; padding: 0.85rem 1.4rem; border-radius: 6px; line-height: 1.2;
}
.button:hover { background: var(--pen-dark); color: #fff; }
.button-small { padding: 0.6rem 1rem; font-size: 1rem; white-space: nowrap; }

@media (max-width: 62rem) {
  .menu-button { display: block; }
  .header-row { gap: 0.75rem; }
  .header-row .button-small { margin-left: auto; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0; background: var(--sheet); border-bottom: 1px solid var(--rule); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 0.5rem var(--gap) 1rem; }
  .site-nav a { display: block; padding: 0.8rem 0; font-size: 1.125rem; border-bottom: 1px solid var(--rule); }
  .site-nav li:last-child a { border-bottom: 0; }
  .site-nav a[aria-current="page"] { box-shadow: none; font-weight: 700; }
}
@media (max-width: 26rem) {
  .wordmark { font-size: 1rem; }
  .header-row { gap: 0.5rem; }
  .button-small { padding: 0.55rem 0.65rem; font-size: 0.85rem; }
  .menu-button { padding: 0.45rem 0.6rem; font-size: 0.9rem; }
}

/* ---------- Bands ---------- */
.band { padding-block: var(--band); }
.band + .band { padding-top: 0; }
.band-sheet { background: var(--sheet); border-block: 1px solid var(--rule); padding-block: var(--band); }
.band-proof { padding-block: clamp(2.5rem, 6vw, 4rem); }
.band-sheet + .band { padding-top: var(--band); }
.band-ink { background: var(--ink); color: #fff; padding-block: var(--band); }
.band-ink a:not(.button) { color: #fff; }
.band-ink .button { background: var(--highlighter); color: var(--ink); }
.band-ink .button:hover { background: #fff; color: var(--ink); }

.lead { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }
.prose { max-width: var(--measure); }
.wrap.prose { max-width: none; }
.wrap.prose > * { max-width: var(--measure); }
.prose h2 + p, .prose h3 + p { margin-top: 0.6em; }
.prose h2:not(:first-child) { margin-top: 1.6em; }
.section-head { max-width: var(--measure); margin-bottom: 2.25rem; }
.section-head p { margin-top: 0.75rem; color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2rem; }
.actions-note { font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.9rem; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) var(--band); }
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 + .lead { margin-top: 1.4rem; }
@media (min-width: 62rem) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; } }
.page-hero h1 { max-width: 18ch; }
.page-hero .lead { margin-top: 1.4rem; }

/* ---------- The marked page ---------- */
.marked-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-bottom: 0.75rem; }
.marked-tabs button {
  font: inherit; font-size: 1rem; color: var(--ink-soft); background: none; border: 0;
  padding: 0.3rem 0; cursor: pointer; border-bottom: 2px solid transparent;
}
.marked-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--pen); }
.sheet {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px;
  padding: 1.25rem clamp(1.1rem, 4vw, 2rem) 1.5rem;
  box-shadow: 0 1px 0 #fff inset, 0 18px 40px -24px rgba(15, 27, 61, 0.35);
}
.sheet[hidden] { display: none; }
.sheet-text {
  font-size: clamp(1.1rem, 0.95rem + 0.7vw, 1.35rem);
  line-height: 3rem; padding-top: 0.25rem;
  background-image: linear-gradient(to bottom, transparent calc(3rem - 1px), var(--rule) calc(3rem - 1px));
  background-size: 100% 3rem; background-position: 0 -0.45rem;
}
.fix { position: relative; display: inline-block; line-height: 1; }
.fix del { text-decoration: none; background: linear-gradient(var(--pen), var(--pen)) no-repeat 0 55% / 100% 2px; color: var(--ink-soft); }
.fix ins {
  position: absolute; left: 0; bottom: 82%; transform: rotate(-2deg); transform-origin: left bottom;
  font-family: var(--hand); font-weight: 600; font-size: 1.45em; line-height: 1;
  color: var(--pen); text-decoration: none; white-space: nowrap;
}
.sheet-note {
  margin-top: 1.1rem; font-family: var(--hand); font-size: 1.5rem; line-height: 1.2; color: var(--pen);
  transform: rotate(-1deg); transform-origin: left;
}
.marked-caption { margin-top: 0.9rem; font-size: var(--step--1); color: var(--ink-soft); }

@media (prefers-reduced-motion: no-preference) {
  .js .sheet.play .fix del { background-size: 0 2px; animation: strike 0.35s ease-out forwards; }
  .js .sheet.play .fix ins, .js .sheet.play .sheet-note { opacity: 0; animation: write 0.4s ease-out forwards; }
  .js .sheet.play .fix:nth-of-type(1) del { animation-delay: 0.5s; }
  .js .sheet.play .fix:nth-of-type(1) ins { animation-delay: 0.8s; }
  .js .sheet.play .fix:nth-of-type(2) del { animation-delay: 1.2s; }
  .js .sheet.play .fix:nth-of-type(2) ins { animation-delay: 1.5s; }
  .js .sheet.play .fix:nth-of-type(3) del { animation-delay: 1.9s; }
  .js .sheet.play .fix:nth-of-type(3) ins { animation-delay: 2.2s; }
  .js .sheet.play .sheet-note { animation-delay: 2.7s; }
  @keyframes strike { to { background-size: 100% 2px; } }
  @keyframes write { to { opacity: 1; } }
}

/* ---------- Proof line ---------- */
.proof { font-size: var(--step-3); line-height: 1.15; letter-spacing: -0.035em; font-weight: 600; max-width: 24ch; }
.proof + p { margin-top: 1rem; color: var(--ink-soft); max-width: var(--measure); }

/* ---------- Two doors ---------- */
.doors { display: grid; gap: var(--gap); }
@media (min-width: 48rem) { .doors { grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); } }
.door { border-top: 3px solid var(--ink); padding-top: 1.25rem; }
.door h2 { font-size: var(--step-3); }
.door p { margin-top: 0.9rem; max-width: 30rem; }
.door ul { margin-top: 1.25rem; display: grid; gap: 0.4rem; }
.door li a { font-weight: 650; }

/* ---------- Steps (a real sequence) ---------- */
.steps { counter-reset: step; display: grid; gap: 2rem var(--gap); }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 68rem) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: block; font-family: var(--hand); font-weight: 700;
  font-size: 3rem; line-height: 1; color: var(--pen); margin-bottom: 0.4rem;
}
.steps p { margin-top: 0.5rem; color: var(--ink-soft); }
.band-sheet .steps p { color: var(--ink-soft); }

/* ---------- Plain lists with a rule ---------- */
.ruled { display: grid; border-top: 1px solid var(--rule); }
.ruled > li { padding: 1.25rem 0; border-bottom: 1px solid var(--rule); display: grid; gap: 0.35rem 2rem; }
@media (min-width: 48rem) { .ruled > li { grid-template-columns: 16rem 1fr; align-items: baseline; } }
.ruled p { color: var(--ink-soft); max-width: var(--measure); }
.ticks { display: grid; gap: 0.6rem; max-width: var(--measure); }
.ticks li { padding-left: 1.6rem; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--pen); font-weight: 800; }

/* ---------- Price list and packages ---------- */
.price-list { border-top: 3px solid var(--ink); }
.price-list a {
  display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 1.5rem; align-items: baseline;
  padding: 1.1rem 0; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none;
}
.price-list a:hover .pl-name { text-decoration: underline; }
.pl-name { font-weight: 700; font-size: var(--step-1); letter-spacing: -0.01em; }
.pl-length { grid-column: 1; color: var(--ink-soft); font-size: 1rem; }
.pl-price { grid-column: 2; grid-row: 1 / span 2; font-weight: 750; font-size: var(--step-2); letter-spacing: -0.02em; }

.packages { border-top: 3px solid var(--ink); }
.package { display: grid; gap: 1rem 2.5rem; padding: 2rem 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 6rem; }
@media (min-width: 52rem) { .package { grid-template-columns: 17rem 1fr auto; align-items: start; } }
.package h3 { font-size: var(--step-2); letter-spacing: -0.02em; line-height: 1.15; }
.package-length { margin-top: 0.4rem; color: var(--ink-soft); }
.package-includes { display: grid; gap: 0.5rem; }
.package-includes li { padding-left: 1.6rem; position: relative; }
.package-includes li::before { content: "✓"; position: absolute; left: 0; color: var(--pen); font-weight: 800; }
.package-price { font-size: var(--step-3); font-weight: 780; letter-spacing: -0.03em; line-height: 1; }
.mark { background: linear-gradient(transparent 52%, var(--highlighter) 52%, var(--highlighter) 92%, transparent 92%); padding-inline: 0.12em; }

/* ---------- About / photo ---------- */
.split { display: grid; gap: clamp(2rem, 6vw, 4.5rem); align-items: start; }
@media (min-width: 52rem) { .split { grid-template-columns: 20rem 1fr; } .split-wide { grid-template-columns: 24rem 1fr; } }
.portrait { border-radius: 4px; border: 1px solid var(--rule); background: var(--sheet); width: 100%; max-width: 24rem; }
.portrait-caption { font-family: var(--hand); font-size: 1.5rem; color: var(--pen); margin-top: 0.5rem; transform: rotate(-1.5deg); transform-origin: left; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--rule); max-width: 46rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 650; padding: 1.1rem 2rem 1.1rem 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.9rem; font-size: 1.5rem; line-height: 1; color: var(--pen); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 1.25rem; color: var(--ink-soft); max-width: var(--measure); }

/* ---------- Closing call ---------- */
.closing h2 { max-width: 20ch; }
.closing p { margin-top: 1rem; max-width: 34rem; color: #c9d1e6; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 3rem 2rem; font-size: 1rem; border-top: 1px solid var(--rule); }
.band-ink + .site-footer, main > .band-ink:last-child ~ .site-footer { border-top: 0; }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid p { color: var(--ink-soft); margin-top: 0.4rem; max-width: 20rem; }
.footer-grid p a { color: var(--pen); }
.footer-grid p.wordmark { color: var(--ink); margin-top: 0; }
.footer-grid ul { display: grid; gap: 0.5rem; align-content: start; }
.footer-grid a { color: var(--ink); }
.footer-small { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: var(--step--1); }

/* ---------- Not found ---------- */
.notfound { min-height: 50vh; display: grid; align-content: center; }
