/* ========================================
   Trust Domain Names — "The Ledger"
   Custom design layer on top of Tailwind
   ======================================== */

:root {
  --vellum: #F8F7F3;
  --ink: #1C1B16;
  --seal: #B23A21;
  --faded: #6F6A5C;
  --night: #141310;
  --rule: rgba(28, 27, 22, 0.14);
  --rule-light: rgba(248, 247, 243, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Paper grain (tactile registry paper) ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Display type ---------- */
.display {
  font-size: clamp(2.9rem, 7.4vw, 6.6rem);
  line-height: 0.99;
  letter-spacing: -0.022em;
  font-weight: 560;
  font-optical-sizing: auto;
}

.h2 {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  font-weight: 560;
}

.prose-ledger {
  max-width: 62ch;
  line-height: 1.75;
}

/* Section mark: the registry's "§" */
.section-mark {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--seal);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

/* ---------- Header ---------- */
#navbar { background: transparent; }

#navbar.scrolled {
  background: rgba(248, 247, 243, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.nav-link {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--faded);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.nav-link:hover { color: var(--ink); border-bottom-color: var(--seal); }

/* ---------- Hero load choreography (one orchestrated moment) ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise {
  opacity: 0;
  animation: rise 0.9s cubic-bezier(0.22, 0.61, 0.21, 1) forwards;
}
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.18s; }
.rise-3 { animation-delay: 0.32s; }
.rise-4 { animation-delay: 0.46s; }
.rise-5 { animation-delay: 0.62s; }

/* ---------- Wax seal stamp ---------- */
.stamp {
  animation: spin 70s linear infinite;
  transform-origin: 50% 50%;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Ticker ---------- */
.ticker {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  align-items: baseline;
  gap: 4.5rem;
  padding: 0.85rem 2.25rem 0.85rem 0;
  width: max-content;
  animation: tick 52s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick {
  to { transform: translateX(-50%); }
}
.tk {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.7rem;
}
.tk b { font-weight: 500; color: var(--ink); }
.tk i {
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--faded);
}
.tk i.st-sold { color: var(--seal); }

/* ---------- Ledger rows (services) ---------- */
.ledger-row {
  display: block;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  position: relative;
  transition: background 0.3s ease;
}
.ledger-row:last-of-type { border-bottom: 1px solid var(--rule); }
.ledger-row:hover { background: rgba(28, 27, 22, 0.03); }
.ledger-row .dot {
  width: 7px;
  height: 7px;
  background: var(--seal);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
}
.ledger-row:hover .dot { opacity: 1; transform: scale(1); }
.ledger-row .row-title { transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.21, 1); }
.ledger-row:hover .row-title { transform: translateX(6px); }

/* ---------- Stat ledger lines ---------- */
.stat-line { border-top: 1px solid var(--rule); }

/* ---------- Process steps ---------- */
.step { border-top: 1px solid var(--rule); }
.step-num {
  font-family: Fraunces, Georgia, serif;
  font-style: italic;
  color: var(--seal);
  font-size: 1.35rem;
  line-height: 1;
}

/* ---------- Buttons & links ---------- */
.btn-primary {
  display: inline-block;
  background: var(--ink);
  color: var(--vellum);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 1rem 1.9rem;
  text-decoration: none;
  transition: background 0.3s ease;
}
.btn-primary:hover { background: var(--seal); }

.btn-primary-light {
  display: inline-block;
  background: var(--vellum);
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 1rem 1.9rem;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease;
}
.btn-primary-light:hover { background: var(--seal); color: var(--vellum); }

.link-line {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--seal);
  padding-bottom: 2px;
  transition: color 0.25s ease;
}
.link-line:hover { color: var(--seal); }

.mail-giant {
  font-size: clamp(1.7rem, 5.4vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 560;
  color: var(--vellum);
  text-decoration: none;
  background-image: linear-gradient(var(--seal), var(--seal));
  background-size: 0% 3px;
  background-repeat: no-repeat;
  background-position: 0 96%;
  transition: background-size 0.45s cubic-bezier(0.22, 0.61, 0.21, 1);
  word-break: break-all;
}
.mail-giant:hover { background-size: 100% 3px; }

/* ---------- Focus visibility ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

/* ---------- Selection ---------- */
::selection { background: rgba(178, 58, 33, 0.22); color: var(--ink); }
.night-sel ::selection { background: rgba(178, 58, 33, 0.55); color: var(--vellum); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--vellum); }
::-webkit-scrollbar-thumb { background: rgba(28, 27, 22, 0.28); }
::-webkit-scrollbar-thumb:hover { background: var(--seal); }

/* ---------- Mobile menu ---------- */
#mobileMenu {
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#mobileMenu.menu-closed {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; animation: none; }
  .stamp { animation: none; }
  .ticker-track { animation: none; }
  .ledger-row .row-title,
  .ledger-row .dot,
  .mail-giant { transition: none; }
}
