/* Poise — vellum + ink. Mirrors the app theme in src/theme/index.ts */

:root {
  --vellum: #f2eee9;
  --card: #fdfcf0;
  --ink: #04152b;
  --ink-light: #1a2a40;
  --ink-60: rgba(4, 21, 43, 0.6);
  --ink-30: rgba(4, 21, 43, 0.3);
  --ink-15: rgba(4, 21, 43, 0.15);
  --ink-08: rgba(4, 21, 43, 0.08);
  --amber: #a8741f;
  --amber-soft: #e1c294;
  --success: #5a7a3e;

  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --hand: 'Caveat', cursive;

  --measure: 720px;
}

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

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

body {
  background-color: var(--vellum);
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--ink);
  color: var(--vellum);
}

a {
  color: var(--ink);
  text-decoration-color: var(--ink-30);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

a:hover {
  text-decoration-color: var(--ink);
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Eyebrow / labels ---------- */

.eyebrow {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-60);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(242, 238, 233, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-15);
}

.site-header__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.04em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wordmark__seal {
  width: 22px;
  height: 22px;
  flex: none;
}

.nav {
  display: flex;
  gap: 26px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav a {
  text-decoration: none;
  color: var(--ink-60);
}

.nav a:hover {
  color: var(--ink);
}

/* ---------- Hero ---------- */

.hero {
  padding: 96px 0 72px;
  position: relative;
}

.hero__eyebrow {
  margin-bottom: 28px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  max-width: 14ch;
}

.hero h1 em {
  font-style: italic;
  font-weight: 500;
}

.hero__accent {
  font-family: var(--hand);
  font-weight: 600;
  font-size: clamp(30px, 4.4vw, 46px);
  color: var(--amber);
  line-height: 1;
  display: inline-block;
  transform: rotate(-3deg);
  margin: 18px 0 4px;
}

.hero__lede {
  margin-top: 30px;
  font-size: 21px;
  color: var(--ink-60);
  max-width: 52ch;
}

.hero__actions {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

/* ---------- Buttons ---------- */

/* Mirrors src/components/ui/Button.tsx: 4px corners, 2px ink border,
   hard 2px offset shadow (no blur), Space Grotesk bold, wide tracking.
   Hover presses the button into its own shadow. */
.btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 4px;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.18s ease, color 0.18s ease;
}

.btn:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.btn--solid {
  background: var(--ink);
  color: var(--vellum);
}

.btn--ghost {
  background: var(--card);
  color: var(--ink);
}

/* App Store badge — branded placeholder. Swap for Apple's official
   badge artwork before public release (per Apple marketing guidelines). */
.btn--store {
  padding: 0 22px;
}

.btn__apple {
  width: 21px;
  height: 25px;
  flex: none;
}

.btn__store-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  text-align: left;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 17px;
}

.btn__store-text small {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 3px;
}

/* ---------- Rule / ornament ---------- */

.rule {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink-30);
}

.rule::before,
.rule::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--ink-15);
}

.rule__mark {
  font-size: 15px;
  letter-spacing: 0.3em;
}

/* ---------- Showcase: example challenge cards ---------- */

.showcase {
  padding: 80px 0 8px;
}

.showcase__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.08;
  margin-top: 14px;
}

.showcase__title em {
  font-style: italic;
}

.showcase__lede {
  margin-top: 16px;
  font-size: 19px;
  color: var(--ink-60);
  max-width: 46ch;
}

/* ---------- Features ---------- */

.features {
  padding: 24px 0 96px;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.feature {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 30px 28px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.feature:hover {
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.feature__num {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--amber);
}

.feature h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 25px;
  margin: 14px 0 10px;
}

.feature p {
  color: var(--ink-60);
  font-size: 17px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--ink-15);
  padding: 48px 0 64px;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-start;
}

.site-footer .wordmark {
  font-size: 22px;
}

.footer-links {
  display: flex;
  gap: 28px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink-60);
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-meta {
  margin-top: 26px;
  font-size: 15px;
  color: var(--ink-30);
  font-family: var(--sans);
  letter-spacing: 0.02em;
}

/* ---------- Legal documents ---------- */

.doc {
  padding: 72px 0 96px;
}

.doc__head {
  max-width: var(--measure);
  margin: 0 auto 48px;
}

.doc__back {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-60);
}

.doc__back:hover {
  color: var(--ink);
}

.doc h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.06;
  margin: 22px 0 14px;
}

.doc__updated {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-30);
}

.doc__body {
  max-width: var(--measure);
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--ink-15);
  border-radius: 18px;
  padding: 56px clamp(28px, 6vw, 64px);
}

.doc__body h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 27px;
  line-height: 1.2;
  margin: 44px 0 14px;
  padding-top: 6px;
}

.doc__body h2:first-child {
  margin-top: 0;
}

.doc__body h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin: 28px 0 10px;
}

.doc__body p {
  margin: 0 0 16px;
  color: var(--ink);
}

.doc__body ul {
  margin: 0 0 18px;
  padding-left: 22px;
}

.doc__body li {
  margin-bottom: 9px;
}

.doc__body strong {
  font-weight: 600;
}

.doc__body em {
  font-style: italic;
}

.doc__body a {
  word-break: break-word;
}

.doc__body hr {
  border: none;
  border-top: 1px solid var(--ink-15);
  margin: 40px 0;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 22px;
  font-size: 16px;
}

.doc table th,
.doc table td {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--ink-15);
  vertical-align: top;
}

.doc table th {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink-08);
  color: var(--ink-60);
}

.doc__note {
  max-width: var(--measure);
  margin: 24px auto 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-30);
  letter-spacing: 0.02em;
}

/* ---------- Reveal on load ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    animation: none;
    opacity: 1;
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  body {
    font-size: 18px;
  }
  .nav {
    gap: 18px;
    font-size: 12px;
  }
  .hero {
    padding: 64px 0 56px;
  }
  .features__grid {
    grid-template-columns: 1fr;
  }
  .doc__body {
    padding: 36px 24px;
  }
}

@media (max-width: 460px) {
  .nav a:not(:last-child) {
    display: none;
  }
}
