/* Nolim — coming soon. Tokens follow nolim-brain/docs/design/DESIGN.md ("wax and paper"). */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/fonts/literata-latin-opsz-normal.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/fonts/literata-latin-opsz-italic.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #F6F2EA;
  --sheet: #FFFDF8;
  --fold: #EDE7DC;
  --line: #E1D9CC;
  --line-firm: #CFC5B5;
  --ink: #1A2030;
  --ink-2: #4A5163;
  --ink-3: #5F6472;
  --wax: #C2522A;
  --on-wax: #FFFFFF;
  --wax-deep: #A3411D;
  --shadow: 0 1px 2px rgba(26, 32, 48, 0.06), 0 24px 48px -20px rgba(26, 32, 48, 0.22);
  --grain-opacity: 0.05;

  --font-display: "Literata", ui-serif, Georgia, serif;
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --ease-enter: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11151E;
    --sheet: #181D28;
    --fold: #20263A;
    --line: #2C3345;
    --line-firm: #3A4258;
    --ink: #EEE8DC;
    --ink-2: #B5AFA4;
    --ink-3: #99948B;
    --wax: #E07448;
    --on-wax: #11151E;
    --wax-deep: #E07448;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.6);
    --grain-opacity: 0.035;
  }
}

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

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

body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Barely-there paper grain (DESIGN.md §3). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

.wrap {
  position: relative;
  min-height: 100dvh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
}
.brand img {
  display: block;
  width: auto;
  height: 28px;
}
.soon {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
  border: 1px solid var(--line-firm);
  border-radius: 999px;
  padding: 4px 12px;
}

a:focus-visible {
  outline: 2px solid var(--wax);
  outline-offset: 2px;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: center;
  padding: clamp(24px, 5vw, 64px) 0 clamp(48px, 7vw, 96px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  color: var(--ink-3);
  margin-bottom: 20px;
}

h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.75rem, 4.5vw + 1rem, 5rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  max-width: 13ch;
  text-wrap: balance;
}
h1 em { font-style: italic; font-weight: 500; }

.lead {
  margin-top: 28px;
  max-width: 34rem;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink-2);
}

/* Ledger of seals: rule lines, not cards. */
.ledger {
  list-style: none;
  padding: 0;
  margin-top: 40px;
  max-width: 36rem;
  border-top: 1px solid var(--line);
}
.ledger li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.ledger-title { font-weight: 500; color: var(--ink); line-height: 1.45; }
.ledger-text { font-size: 0.9375rem; color: var(--ink-2); line-height: 1.55; margin-top: 2px; }

.seal-mark {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
}
.seal-mark.sealed { background: var(--wax); }
.seal-mark.at-rest { border: 1.5px solid var(--ink); }
.seal-mark.public { border: 1.5px dashed var(--ink-2); }

.fine {
  margin-top: 20px;
  max-width: 36rem;
  font-size: 0.875rem;
  color: var(--ink-3);
  line-height: 1.6;
}

/* The letter */
.letter {
  position: relative;
  justify-self: center;
  width: min(100%, 380px);
  aspect-ratio: 4 / 5;
}
.sheet {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.sheet-back {
  background: var(--fold);
  transform: rotate(-5deg) translate(-10px, 6px);
}
.sheet-front {
  background: var(--sheet);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
  padding: clamp(24px, 3vw, 36px);
  display: flex;
  flex-direction: column;
}
.sheet-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-3);
}
.sheet-address {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 1.6vw + 0.6rem, 1.625rem);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.sheet-lines {
  margin-top: 32px;
  display: grid;
  gap: 14px;
}
.sheet-lines span {
  display: block;
  height: 1px;
  background: var(--line-firm);
}
.sheet-lines + .sheet-lines { margin-top: 26px; }
.sheet-lines .short { width: 55%; }
.sheet-lines .shorter { width: 35%; }
.sheet-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.wax-body { fill: var(--wax); }
.wax-ring { fill: none; stroke: var(--on-wax); stroke-opacity: 0.35; stroke-width: 1.5; }
.wax-n {
  fill: none;
  stroke: var(--on-wax);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}
.sheet-sealed {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--wax-deep);
}

/* Footer */
.bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--ink-3);
}
.bottom span:last-child { margin-left: auto; }

/* Motion: one quiet entrance, then stillness. */
@media (prefers-reduced-motion: no-preference) {
  .copy > * { animation: rise 700ms var(--ease-enter) both; }
  .copy > :nth-child(2) { animation-delay: 60ms; }
  .copy > :nth-child(3) { animation-delay: 120ms; }
  .copy > :nth-child(4) { animation-delay: 180ms; }
  .copy > :nth-child(5) { animation-delay: 240ms; }
  .sheet-back { animation: back-in 900ms var(--ease-enter) 120ms both; }
  .sheet-front { animation: front-in 900ms var(--ease-enter) 200ms both; }
  .wax { animation: press 520ms cubic-bezier(0.3, 1.4, 0.5, 1) 900ms both; transform-origin: center; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes back-in {
  from { opacity: 0; transform: rotate(0deg) translate(0, 24px); }
  to { opacity: 1; transform: rotate(-5deg) translate(-10px, 6px); }
}
@keyframes front-in {
  from { opacity: 0; transform: rotate(0deg) translateY(32px); }
  to { opacity: 1; transform: rotate(2deg); }
}
@keyframes press {
  from { opacity: 0; transform: scale(1.35); }
  to { opacity: 1; transform: scale(1); }
}

/* Phones and narrow windows: one column. */
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .letter { width: min(78%, 300px); margin: 8px 0; }
  h1 { max-width: none; }
}
@media (max-width: 560px) {
  .top { padding: 20px 0; }
  .bottom { flex-direction: column; gap: 6px; }
  .bottom span:last-child { margin-left: 0; }
}
