/* AlfredsNote.com · page styles. Every value comes from tokens.css; rules are in ../../DESIGN.md. */
@import url("./tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--blotter-deep);
  color: var(--paper);
  font-family: var(--serif);
  font-size: var(--t-body);
  line-height: 1.6;
  padding-inline: var(--gutter);
  padding-block: 0 var(--s8);
}

/* The lamp: fixed. Paper scrolls through it. */
.lamp {
  position: fixed; inset: 0 0 auto 0; height: 110vh; z-index: 0; pointer-events: none;
  background: var(--lamp-light), linear-gradient(var(--blotter), var(--blotter-deep) 85%);
  animation: warm-up var(--warm-up) both;
}
@keyframes warm-up { from { filter: brightness(.55); } to { filter: brightness(1); } }
@media (prefers-reduced-motion: reduce) { .lamp { animation: none; } }

.desk { position: relative; z-index: 1; max-width: 680px; margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s8); padding-top: var(--s7); }

/* On the desk */
.eyebrow { font: 500 var(--t-label) var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--brass); margin: 0; }
h1 { font-weight: 400; font-size: var(--t-display); line-height: 1.08; letter-spacing: -.01em; margin: var(--s3) 0 var(--s4); text-wrap: balance; }
h1 em { font-style: italic; }
.hero { display: grid; gap: var(--s5); }
.hero .sub { margin: 0; max-width: 56ch; }

/* Paper */
.sheet, .slip {
  background-color: var(--paper); background-image: var(--laid); color: var(--ink);
  border-radius: var(--radius); box-shadow: var(--sheet-shadow);
}
.sheet { padding: var(--s6) var(--s5); }
@media (min-width: 720px) { .sheet { padding: var(--s7); } }
.sheet > :first-child { margin-top: 0; }
.sheet > :last-child { margin-bottom: 0; }
h2 { font-weight: 400; font-size: var(--t-h2); line-height: 1.2; margin: 0 0 var(--s4); text-wrap: balance; }
h3 { font-weight: 400; font-size: var(--t-h3); line-height: 1.25; margin: var(--s6) 0 var(--s3); }
p { margin: 0 0 var(--s4); max-width: var(--measure); }
.label { font: 500 var(--t-label) var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.fine { font-size: var(--t-fine); line-height: 1.5; color: var(--ink-soft); margin: 0; }
.sheet a { color: var(--ink); text-underline-offset: 3px; }
.sheet a.btn { color: var(--paper); text-decoration: none; }
.sheet a:focus-visible, summary:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.plain-list { margin: 0 0 var(--s4); padding-left: 1.15em; display: grid; gap: var(--s2); }
.plain-list li::marker { color: var(--ink-soft); }
.excuses { list-style: none; margin: 0 0 var(--s5); padding: 0; display: grid; }
.excuses li { padding: var(--s2) 0; border-bottom: var(--rule); font-style: italic; }
.excuses li:first-child { border-top: var(--rule); }

/* The form: a slip of paper with one writing line */
.slip { padding: var(--s5) var(--s4) var(--s4); display: grid; gap: var(--s3); max-width: 460px; }
.sheet .slip { box-shadow: none; border: 1px solid rgba(27,42,58,.2); margin-top: var(--s5); }
.line-input {
  width: 100%; font: 400 var(--t-body) var(--serif); color: var(--ink);
  background: transparent; border: 0; border-bottom: var(--rule); border-radius: 0; padding: 6px 0 8px;
}
.line-input::placeholder { color: rgba(27,42,58,.45); font-style: italic; }
.line-input:focus-visible { outline: none; border-bottom: 2px solid var(--brass); }
.line-input[aria-invalid="true"] { border-bottom: 2px solid var(--pencil); }
.btn {
  width: 100%; font: 500 var(--t-data) var(--mono); letter-spacing: .02em; text-align: center; text-decoration: none;
  color: var(--paper); background: var(--ink); border: 0; border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
  transition: background 120ms;
}
.btn:hover { background: var(--ink-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.btn[disabled] { opacity: .55; cursor: default; }
.err { font: 500 13px var(--mono); color: var(--pencil); margin: 0; }
.err:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* The record: numbered because the order is real */
.record { list-style: none; margin: 0 0 var(--s5); padding: 0; counter-reset: line; }
.record li { counter-increment: line; display: grid; gap: 2px var(--s5); padding: var(--s3) 0; border-bottom: var(--rule); }
.record li:first-child { border-top: var(--rule); }
@media (min-width: 640px) { .record li { grid-template-columns: 170px 1fr; align-items: baseline; } }
.record .name { font: 500 var(--t-label) var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.record .name::before { content: counter(line) " · "; }

/* Price card: second stock, the one thing set off square */
.card { background: var(--ledger); color: var(--ink); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: var(--s5); margin: var(--s5) 0 var(--s6); max-width: 540px; transform: rotate(-.6deg); }
.card table { width: 100%; border-collapse: collapse; }
.card td { padding: 10px 0; border-bottom: 1px dotted rgba(27,42,58,.4); vertical-align: baseline; }
.card tr:last-child td { border-bottom: 0; }
.card .what { font-size: 16px; line-height: 1.35; }
.card .what small { display: block; font-size: var(--t-fine); color: var(--ink-soft); }
.card .price { font: 400 14.5px var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; padding-left: var(--s4); }

/* Straight answers */
.answer { border-bottom: var(--rule); padding: var(--s3) 0; }
.answer:first-of-type { border-top: var(--rule); }
.answer summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: var(--s4); }
.answer summary::-webkit-details-marker { display: none; }
.answer summary::after { content: "+"; font: 400 18px var(--mono); color: var(--ink-soft); }
.answer[open] summary::after { content: "\2212"; }
.answer p { margin: var(--s2) 0 0; }

footer { font: 400 13px/1.7 var(--mono); color: var(--paper-dim); }
footer a { color: var(--paper-dim); text-underline-offset: 3px; }
footer a:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* Legal and policy pages: one long sheet, plain and scannable */
.legal h1 { font-size: 34px; color: var(--ink); margin: var(--s2) 0 var(--s2); }
.legal .updated { font: 400 13px var(--mono); color: var(--ink-soft); margin-bottom: var(--s6); }
.legal h2 { font-size: var(--t-h3); margin: var(--s7) 0 var(--s3); padding-top: var(--s4); border-top: var(--rule); }
.legal h3 { font: 500 var(--t-label) var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin: var(--s5) 0 var(--s2); }
.legal ul { margin: 0 0 var(--s4); padding-left: 1.15em; display: grid; gap: var(--s2); max-width: var(--measure); }
.legal .summary { border: 1px solid rgba(27,42,58,.25); border-radius: var(--radius); padding: var(--s4); margin: 0 0 var(--s5); }
.legal .summary p:last-child { margin-bottom: 0; }
.legal .caps { font-size: 14.5px; line-height: 1.55; }
.table-wrap { overflow-x: auto; margin: 0 0 var(--s4); }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; min-width: 480px; }
.legal th { text-align: left; font: 500 var(--t-label) var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); padding: 8px 12px 8px 0; border-bottom: 1.5px solid var(--ink); }
.legal td { padding: 10px 12px 10px 0; border-bottom: 1px dotted rgba(27,42,58,.4); vertical-align: top; }
