/*
 * Longhand — site styles. Tokens follow docs/BRAND.md.
 * Bright paper, blue-black ink, four era colours. Instrument Serif Italic
 * speaks, Newsreader reads, Karla runs the controls, Plex Mono keeps the dates.
 * All fonts self-hosted (OFL). Large base size for older readers.
 * No inline styles anywhere: the CSP is style-src 'self'.
 */

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/newsreader-roman.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/newsreader-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/karla.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/plex-mono-500.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --paper: #fffdf8;
  --paper-raised: #f6f1e6;
  --ink: #23212b;
  --ink-soft: #5a5766;
  --ink-faint: #827e8c;
  --rule: #e7e0d2;
  --accent: #24727d;
  --focus: #24727d;
  --danger: #a3271b;
  --danger-paper: #fbe6de;
  --ok: #597133;
  --ok-paper: #ebefdf;

  /* era fills (graphic), inks (text-safe), washes */
  --teal: #2793a6;
  --mustard: #e0a21e;
  --sage: #739745;
  --coral: #df5a40;
  --teal-ink: #24727d;
  --mustard-ink: #8b6515;
  --sage-ink: #597133;
  --coral-ink: #ac4831;
  --teal-wash: #e1eeed;
  --sage-wash: #ebefdf;
  --coral-wash: #fbe6de;
  --today: #23212b;

  --measure: 36rem;
  --gutter: 1.125rem;
  --display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --reading: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ui: "Karla", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a1820;
    --paper-raised: #25232d;
    --ink: #f4f0e8;
    --ink-soft: #b8b3c1;
    --ink-faint: #8c8796;
    --rule: #36333f;
    --accent: #4fb6c6;
    --focus: #4fb6c6;
    --danger: #ff9d8c;
    --danger-paper: #412a2b;
    --ok: #94b867;
    --ok-paper: #30352d;
    --teal: #4fb6c6;
    --mustard: #f0bd45;
    --sage: #94b867;
    --coral: #f07a5f;
    --teal-ink: #4fb6c6;
    --mustard-ink: #f0bd45;
    --sage-ink: #94b867;
    --coral-ink: #f07a5f;
    --teal-wash: #24343e;
    --sage-wash: #30352d;
    --coral-wash: #412a2b;
    --today: #fffdf8;
  }
}
:root[data-theme="dark"] {
  --paper: #1a1820;
  --paper-raised: #25232d;
  --ink: #f4f0e8;
  --ink-soft: #b8b3c1;
  --ink-faint: #8c8796;
  --rule: #36333f;
  --accent: #4fb6c6;
  --focus: #4fb6c6;
  --danger: #ff9d8c;
  --danger-paper: #412a2b;
  --ok: #94b867;
  --ok-paper: #30352d;
  --teal: #4fb6c6;
  --mustard: #f0bd45;
  --sage: #94b867;
  --coral: #f07a5f;
  --teal-ink: #4fb6c6;
  --mustard-ink: #f0bd45;
  --sage-ink: #94b867;
  --coral-ink: #f07a5f;
  --teal-wash: #24343e;
  --sage-wash: #30352d;
  --coral-wash: #412a2b;
  --today: #fffdf8;
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--reading);
  font-optical-sizing: auto;
  font-size: 1.25rem; /* 20px base: comfortable for older eyes */
  line-height: 1.6;
  overflow-wrap: break-word;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 0.12em;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ui);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus {
  top: 0.5rem;
}

/* ---------- The mark ---------- */

.mark {
  display: block;
  overflow: visible;
}
.mark .s1 {
  stroke: var(--teal);
}
.mark .s2 {
  stroke: var(--mustard);
}
.mark .s3 {
  stroke: var(--sage);
}
.mark .s4 {
  stroke: var(--coral);
}
.mark .cap {
  fill: var(--coral);
  stroke: none;
}
.mark .today {
  fill: var(--today);
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap.wide {
  max-width: calc(58rem + 2 * var(--gutter));
}

@media (min-width: 40rem) {
  :root {
    --gutter: 2rem;
  }
}

.site-header {
  padding-block: 1.25rem;
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
}
.lockup .mark {
  width: 2.05rem;
  height: auto;
  flex: none;
  /* the flat stroke's underside sits on the wordmark's baseline */
  transform: translateY(0.12rem);
}
.wordmark {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-family: var(--ui);
  font-size: 1.0625rem;
  font-weight: 500;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-block: 0.4rem;
  display: inline-block;
}
.site-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.site-nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--coral);
}

main {
  padding-block: 1.5rem 5rem;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.25rem 3rem;
  color: var(--ink-soft);
}
.site-footer .colophon {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin: 0 0 1.25rem;
  font-size: 1.0625rem;
}
.site-footer .wordmark {
  font-size: 1.625rem;
}
.site-footer ul {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--ui);
  font-size: 1.0625rem;
}
.site-footer .fine {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

/* ---------- Type ---------- */

h1,
h2 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
h1 {
  font-size: clamp(2.75rem, 1.9rem + 4.4vw, 4.5rem);
  line-height: 1.02;
}
h2 {
  font-size: clamp(2rem, 1.6rem + 1.8vw, 2.75rem);
  line-height: 1.08;
  margin-top: 4.5rem;
  margin-bottom: 1.25rem;
}
h3 {
  font-family: var(--ui);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 2rem 0 0.5rem;
}
p,
ul,
ol,
dl {
  margin: 0 0 1.1em;
}
p {
  text-wrap: pretty;
}
li + li {
  margin-top: 0.4em;
}
.site-nav li,
.site-footer li {
  margin: 0;
}
strong {
  font-weight: 650;
}

.lede {
  font-size: clamp(1.3125rem, 1.15rem + 0.6vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink-soft);
  margin-top: 1.5rem;
}

.quiet {
  color: var(--ink-soft);
}
.small {
  font-size: 1.0625rem;
}

/* Mono labels: dates, eyebrows, captions-as-metadata. */
.eyebrow,
.label {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--ink-soft);
}

/* ---------- Landing ---------- */

.hero {
  padding-top: clamp(1rem, 5vw, 3.5rem);
}
.hero .wrap {
  display: grid;
  gap: 2rem;
}
.hero h1 {
  font-size: clamp(4rem, 2rem + 11vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin-top: 0.75rem;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}
/* a "today" dot, the same full stop that ends the mark */
.eyebrow::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--coral);
  flex: none;
}
.hero .lede {
  max-width: 32rem;
}
.soon-note {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  margin: 0;
}
.hero-mark {
  order: -1;
  width: min(46vw, 13rem);
}
@media (min-width: 54rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
    gap: 3rem;
  }
  .hero-mark {
    order: 0;
    width: 100%;
    max-width: 24rem;
    justify-self: end;
  }
}

/* The mark writes itself once, in the order a life happens. */
@media (prefers-reduced-motion: no-preference) {
  .mark-hero path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: write 0.7s cubic-bezier(0.45, 0, 0.3, 1) both;
  }
  .mark-hero .s1 {
    animation-delay: 0.25s;
    animation-duration: 0.75s;
    animation-timing-function: cubic-bezier(0.5, 0, 0.7, 0.6);
  }
  .mark-hero .s2 {
    animation-delay: 1s;
    animation-duration: 0.65s;
    animation-timing-function: linear;
  }
  .mark-hero .s3 {
    animation-delay: 1.65s;
    animation-duration: 0.18s;
    animation-timing-function: linear;
  }
  .mark-hero path.s4 {
    animation-delay: 1.83s;
    animation-duration: 0.2s;
    animation-timing-function: cubic-bezier(0.2, 0.6, 0.4, 1);
  }
  .mark-hero .cap {
    opacity: 0;
    animation: appear 0.01s linear 2s both;
  }
  .mark-hero .today {
    transform-box: fill-box;
    transform-origin: center;
    animation: stop 0.35s cubic-bezier(0.3, 1.5, 0.5, 1) 2.3s both;
  }
}
@keyframes write {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes appear {
  to {
    opacity: 1;
  }
}
@keyframes stop {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

/* Something said aloud… */
.spoken,
.life {
  margin: 0;
}
.spoken .label,
.life .label {
  display: block;
  margin-bottom: 0.75rem;
}
.spoken blockquote {
  margin: 0;
  font-style: italic;
  font-size: clamp(1.3125rem, 1.2rem + 0.7vw, 1.5625rem);
  line-height: 1.5;
  color: var(--ink);
}
.spoken blockquote p {
  margin: 0;
}

/* …then set down as a life. Bars sit on a 1950–1975 axis (4% per year). */
.life {
  margin-top: 2.5rem;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--paper-raised);
  border-radius: 10px;
}
.eras {
  list-style: none;
  margin: 0;
  padding: 0;
}
.era {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 1rem;
  margin: 0;
  padding-bottom: 1rem;
}
.era-name {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.15;
}
.era-when {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.track {
  grid-column: 1 / -1;
  display: block;
  margin-top: 0.4rem;
  height: 0.875rem;
  background: repeating-linear-gradient(to right, var(--rule) 0 1px, transparent 1px 20%);
}
.bar {
  display: block;
  height: 100%;
  border-radius: 999px;
}
.residence .bar {
  background: var(--teal);
}
.relationship .bar {
  background: var(--coral);
}
.education .bar {
  background: var(--sage);
}
.e-mobile .bar {
  margin-left: 44%;
  width: 36%;
}
.e-ruth .bar {
  margin-left: 44%;
  width: 56%;
  border-radius: 999px 0 0 999px;
}
.e-school .bar {
  margin-left: 80%;
  width: 12%;
}
.unsure .bar {
  background: var(--sage-wash);
  border: 2px dashed var(--sage-ink);
}
@media (max-width: 26rem) {
  .era {
    grid-template-columns: 1fr;
  }
}
.axis {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--ink-faint);
  padding-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.life .ask {
  margin: 1rem 0 0;
  font-size: 1.0625rem;
  color: var(--ink-soft);
}
.life + .small {
  margin-top: 0.75rem;
}

/* What you end up with: three eras and one that hasn't happened yet. */
.makes {
  margin: 0;
}
.make {
  position: relative;
  padding: 1.1rem 0 1.1rem 1.5rem;
  border-top: 1px solid var(--rule);
}
.make:last-child {
  border-bottom: 1px solid var(--rule);
}
.make::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.3rem;
  bottom: 1.3rem;
  width: 0.4rem;
  border-radius: 999px;
}
.k1::before {
  background: var(--teal);
}
.k2::before {
  background: var(--mustard);
}
.k3::before {
  background: var(--sage);
}
.k4::before {
  border: 2px dashed var(--coral-ink);
}
.makes dt {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.75rem;
  line-height: 1.15;
}
.makes dd {
  margin: 0.3rem 0 0;
}
.makes .later dd {
  color: var(--ink-soft);
}

.promises {
  list-style: none;
  padding: 0;
}
.promises li {
  margin: 0;
  padding-block: 1rem;
  border-top: 1px solid var(--rule);
}
.promises li:last-child {
  border-bottom: 1px solid var(--rule);
}
.promises strong {
  display: block;
  font-family: var(--ui);
  font-size: 1.1875rem;
  font-weight: 700;
}

.closing {
  margin-top: 5rem;
}
.closing h2 {
  font-size: clamp(2.5rem, 1.6rem + 4vw, 4rem);
  line-height: 1;
}
.closing .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* ---------- Long-form document (privacy) ---------- */

.draft-banner {
  background: var(--danger-paper);
  color: var(--ink);
  border-left: 4px solid var(--danger);
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
  font-size: 1.0625rem;
}
.draft-banner strong {
  color: var(--danger);
}

.doc h1 {
  font-size: clamp(2.75rem, 2rem + 3.5vw, 4rem);
}
.doc h2 {
  margin-top: 3.5rem;
  font-size: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
}
.doc .updated {
  margin-top: 1rem;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.toc {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  font-size: 1.0625rem;
}
.toc {
  border-radius: 10px;
  border-color: transparent;
}
.toc h2 {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
}
.toc ol {
  margin: 0;
  padding-left: 1.4rem;
}
.toc li + li {
  margin-top: 0.2em;
}

.processors {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}
.processors li {
  margin: 0 0 1rem;
  padding: 1rem 1.25rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
}
.processors li {
  border-radius: 10px;
  border-color: transparent;
}
.processors h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1875rem;
}
.processors dt {
  font-family: var(--ui);
}
.processors dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  font-size: 1.0625rem;
}
.processors dt {
  font-weight: 600;
  margin-top: 0.4rem;
}
.processors dd {
  margin: 0;
}
@media (min-width: 34rem) {
  .processors dl {
    grid-template-columns: 8.5rem minmax(0, 1fr);
    column-gap: 1rem;
  }
  .processors dt,
  .processors dd {
    margin-top: 0.3rem;
  }
}

.todo {
  background: var(--danger-paper);
  color: var(--danger);
  font-family: var(--mono);
  font-weight: 500;
  padding: 0 0.3em;
  border-radius: 3px;
  font-size: 0.85em;
}

/* ---------- Forms & delete flow ---------- */

.panel {
  margin-top: 2.5rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--paper-raised);
  border-radius: 10px;
}
.panel > :first-child {
  margin-top: 0;
}
.panel > :last-child {
  margin-bottom: 0;
}
.panel h2 {
  margin-top: 0;
  font-size: 2rem;
}

.steps {
  padding-left: 1.6rem;
}

label {
  display: block;
  font-family: var(--ui);
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.hint {
  display: block;
  font-family: var(--reading);
  font-weight: 400;
  font-size: 1.0625rem;
  color: var(--ink-soft);
}

input[type="email"],
input[type="text"] {
  display: block;
  width: 100%;
  max-width: 26rem;
  font: inherit;
  font-family: var(--ui);
  font-size: 1.25rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink-soft);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  min-height: 3.25rem;
}
input:focus-visible {
  outline-offset: 1px;
  border-color: var(--focus);
}

.btn {
  display: inline-block;
  font: inherit;
  font-family: var(--ui);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 3.25rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  text-align: center;
  max-width: 100%;
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn:disabled:hover {
  background: var(--ink);
  border-color: var(--ink);
}
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--paper);
}
.btn-danger:hover,
.btn-danger:disabled:hover {
  background: var(--danger);
  border-color: var(--danger);
}
.btn-link {
  font: inherit;
  font-family: var(--ui);
  font-size: 1.0625rem;
  background: none;
  border: 0;
  padding: 0.25rem 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.field {
  margin-bottom: 1.25rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.notice {
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--paper);
  margin-bottom: 1.25rem;
}
.notice-error {
  border-color: var(--danger);
  background: var(--danger-paper);
}
.notice-ok {
  border-color: var(--ok);
  background: var(--ok-paper);
}
.notice > :last-child {
  margin-bottom: 0;
}

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.5em;
  vertical-align: -0.12em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: [hidden] must win over any display rule */
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    /* biome-ignore-start lint/complexity/noImportantStyles: reduced motion overrides every animation */
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    /* biome-ignore-end lint/complexity/noImportantStyles: reduced motion overrides every animation */
  }
}

/* ---------- 404 ---------- */

.lost {
  padding-top: clamp(2rem, 8vw, 6rem);
}

.nowrap {
  white-space: nowrap;
}

.draft-banner > :last-child {
  margin-bottom: 0;
}
