/* Linesong's site: the app's own paper, inks and typefaces (App/Linesong/DesignSystem.swift in
   the app's repository), carried here so that nothing is fetched from anywhere else. */

@font-face { font-family: "IM Fell English"; src: url("fonts/IMFeENrm28P.ttf") format("truetype"); font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("fonts/IMFeENit28P.ttf") format("truetype"); font-style: italic; font-display: swap; }
@font-face { font-family: "IM Fell English SC"; src: url("fonts/IMFeENsc28P.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Crimson Pro"; src: url("fonts/CrimsonPro-Regular.ttf") format("truetype"); font-style: normal; font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Crimson Pro"; src: url("fonts/CrimsonPro-Italic.ttf") format("truetype"); font-style: italic; font-weight: 200 900; font-display: swap; }

:root {
  /* Rag paper by day. */
  --paper: #F5F1E4;
  --plate: #FBF8EF;
  --sunk: #ECE6D5;
  --ink: #2B2620;
  --faded: #6E6557;
  --faint: #9A917F;
  --rule: #CFC6B1;
  --press: #23527C;
  --display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --caps: "IM Fell English SC", "IM Fell English", "Iowan Old Style", Georgia, serif;
  --body: "Crimson Pro", "Iowan Old Style", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  /* Lamp black by night. */
  :root {
    --paper: #14120F; --plate: #1F1C17; --sunk: #0D0C0A; --ink: #EFE7D3; --faded: #A99F88;
    --faint: #6F6857; --rule: #3D382D; --press: #8DB7DD; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.1875rem; line-height: 1.5;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
}
a { color: var(--press); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:focus-visible { outline: 2px solid var(--press); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

.page { max-width: 46rem; margin: 0 auto; }
.wide { max-width: 64rem; margin: 0 auto; }

/* The head of every page: the icon and the name, and the way to the others. */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 28px 8px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 9px; }
.brand span { font-family: var(--display); font-size: 1.6rem; line-height: 1; }
nav { display: flex; gap: 20px; font-family: var(--caps); font-size: 1.05rem; letter-spacing: 0.04em; }
nav a { text-decoration: none; }
nav a[aria-current="page"] { color: var(--faded); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 7vw, 4.2rem); margin: 0; }
h2 { font-size: 1.9rem; margin: 0 0 0.4em; }
h3 { font-size: 1.35rem; margin: 1.4em 0 0.3em; }
.kicker { font-family: var(--caps); letter-spacing: 0.06em; color: var(--faded); font-size: 1.05rem; margin: 0 0 10px; }
.lede { font-size: 1.4rem; line-height: 1.4; color: var(--ink); max-width: 34rem; margin: 18px 0 0; }
.soon { font-family: var(--caps); letter-spacing: 0.05em; color: var(--press); margin-top: 22px; }
p, li { max-width: 40rem; }
section { padding-block: 40px; border-top: 1px solid var(--rule); }
.hero { border-top: 0; padding-block: 48px 40px; display: grid; gap: 36px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; }
.hero figure { margin: 0; }
.hero img { border-radius: 4px; box-shadow: 0 1px 0 var(--rule); }
figcaption { font-size: 0.95rem; color: var(--faded); margin-top: 8px; font-style: italic; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }

/* The opening: the pelican drawn dot by dot, the words in the room the bird leaves. On a wide page
   they sit to its left, level with the beak, which points at them; on a phone the heading sits in
   the space beside its neck and the rest comes under it. */
.opening { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); grid-template-rows: auto 1fr; column-gap: 28px; padding-block: 4px 32px; border-top: 0; }
.opening .stage { grid-column: 2; grid-row: 1 / span 2; position: relative; height: min(86vh, 900px); min-height: 540px; touch-action: pan-y; }
.opening canvas, .opening .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: right center; }
.opening .headline { grid-column: 1; grid-row: 1; padding-top: max(12vh, 90px); }
.opening h1 { font-size: clamp(2.8rem, 6.2vw, 5rem); line-height: 0.98; }
.opening .rest { grid-column: 1; grid-row: 2; display: grid; gap: 14px; align-content: start; padding-top: 18px; }
.opening .lede { margin: 0; font-size: 1.3rem; }
.opening .soon { margin: 6px 0 0; }
.opening .credit { margin: 4px 0 0; font-size: 0.92rem; color: var(--faded); font-style: italic; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; }
.controls button { font: inherit; font-family: var(--caps); letter-spacing: 0.04em; font-size: 1rem; color: var(--press); background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 7px 14px 7px 12px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.controls button[aria-pressed="true"] { background: var(--sunk); }
.controls button:focus-visible { outline: 2px solid var(--press); outline-offset: 2px; }
.controls svg { width: 18px; height: 18px; }
@media (max-width: 860px) {
  .opening { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .opening .stage { grid-column: 1; grid-row: 1; height: auto; min-height: 0; aspect-ratio: 673 / 1024; max-width: 100%; }
  .opening canvas, .opening .still { object-position: center; }
  /* Beside the neck: from two thirds across, a quarter of the way down, clear of the back. */
  .opening .headline { grid-column: 1; grid-row: 1; justify-self: end; align-self: start; width: 34%; margin-top: 37%; padding-top: 0; position: relative; z-index: 1; pointer-events: none; }
  .opening h1 { font-size: clamp(2rem, 9.5vw, 3.4rem); }
  .opening .rest { grid-row: 2; padding-top: 6px; }
}

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { padding-left: 1.6em; position: relative; }
.steps li::before { content: ""; position: absolute; left: 0.3em; top: 0.62em; width: 0.42em; height: 0.42em; border-radius: 50%; background: var(--ink); }

.plates { display: grid; gap: 28px 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
.plates figure { margin: 0; }
.plates img { border-radius: 3px; }
.plates b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; display: block; margin-top: 10px; }
.plates span { font-size: 0.95rem; color: var(--faded); display: block; }
@media (max-width: 600px) { .plates { grid-template-columns: 1fr; } }

.costs { display: grid; gap: 4px 24px; grid-template-columns: max-content minmax(0, 1fr); margin: 14px 0 0; }
.costs dt { font-family: var(--display); font-size: 1.15rem; }
.costs dd { margin: 0 0 10px; color: var(--faded); }
@media (max-width: 520px) { .costs { grid-template-columns: 1fr; } .costs dd { margin-bottom: 14px; } }

/* The legal pages and support: one column to read. */
.doc { padding-block: 32px 24px; }
.doc h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); }
.doc .updated { color: var(--faded); margin-top: 8px; }
.doc h2 { font-size: 1.55rem; margin-top: 1.6em; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 0.35em; }
.box { background: var(--sunk); border-radius: 8px; padding: 16px 20px; margin: 22px 0; }
.box p { margin: 0.3em 0; }
.table-wrap { overflow-x: auto; margin: 14px 0; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 1rem; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); }
th { font-family: var(--caps); font-weight: 400; letter-spacing: 0.04em; color: var(--faded); }

footer { border-top: 1px solid var(--rule); margin-top: 24px; padding-block: 24px 40px; color: var(--faded); font-size: 1rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer nav { font-size: 0.95rem; }
