/* Lorecodex — shared design tokens + base styles */

:root {
  /* Ink colors — Lorcana palette */
  --ink-amber:    #F3B300;
  --ink-amethyst: #80387B;
  --ink-emerald:  #288A34;
  --ink-ruby:     #D2092F;
  --ink-sapphire: #0389C3;
  --ink-steel:    #9FA9B3;

  /* Dark parchment (matches Capture screen) */
  --dark-bg:       #0f0b09;
  --dark-bg-2:     #1a1410;
  --dark-bg-3:     #241c17;
  --dark-line:     rgba(243, 231, 211, 0.10);
  --dark-line-2:   rgba(243, 231, 211, 0.18);
  --dark-text:     #f5ecd9;
  --dark-text-2:   rgba(245, 236, 217, 0.72);
  --dark-text-3:   rgba(245, 236, 217, 0.48);

  /* Warm cream (matches Settings screen) */
  --cream:         #f5ece0;
  --cream-2:       #ede1cf;
  --cream-3:       #e3d4bb;
  --ink-body:      #2b2319;
  --ink-body-2:    #5a4d3d;
  --ink-body-3:    #8a7c68;

  /* Type scale */
  --font-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --font-body:    "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--dark-bg);
  color: var(--dark-text);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: inherit; text-decoration: none; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 32px; }

/* ─── Ink chip / pill ─────────────────────────────────────── */
.ink-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--dark-text-2);
}
.ink-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

/* ─── Ink gem (rotated square with glow) ─────────────────── */
.gem {
  display: inline-block;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  position: relative;
}
.gem::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  filter: blur(8px);
  opacity: 0.6;
  transform: scale(1.4);
}
.gem::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  border-radius: 1px;
}

/* ─── Subtle noise/grain overlay for dark bg ─────────────── */
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(243,179,0,.04), transparent 40%),
    radial-gradient(1px 1px at 70% 80%, rgba(210,9,47,.03), transparent 40%),
    radial-gradient(1px 1px at 80% 20%, rgba(3,137,195,.03), transparent 40%);
  opacity: 1;
  z-index: 0;
}

/* ─── Button ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  text-decoration: none;
}
.btn-primary {
  background: #fff;
  color: #1a1410;
  box-shadow: 0 10px 30px -10px rgba(255,255,255,.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px -10px rgba(255,255,255,.4);
}
.btn-ghost {
  background: transparent;
  color: var(--dark-text);
  border-color: var(--dark-line-2);
}
.btn-ghost:hover { background: rgba(255,255,255,.05); }

/* ─── Ink bar (six stripes) ─────────────────────────────── */
.ink-bar {
  display: flex;
  height: 3px;
  width: 100%;
  border-radius: 2px;
  overflow: hidden;
}
.ink-bar > span { flex: 1; }
.ink-bar .b-amber    { background: var(--ink-amber); }
.ink-bar .b-amethyst { background: var(--ink-amethyst); }
.ink-bar .b-emerald  { background: var(--ink-emerald); }
.ink-bar .b-ruby     { background: var(--ink-ruby); }
.ink-bar .b-sapphire { background: var(--ink-sapphire); }
.ink-bar .b-steel    { background: var(--ink-steel); }

/* ─── Device frame (iPhone) ─────────────────────────────── */
.device {
  width: 320px;
  aspect-ratio: 460 / 940;
  border-radius: 46px;
  padding: 10px;
  background: linear-gradient(180deg, #2a2420, #14100d);
  box-shadow:
    0 60px 120px -40px rgba(0,0,0,.7),
    0 30px 60px -30px rgba(0,0,0,.5),
    inset 0 0 0 1px rgba(255,255,255,.06);
  position: relative;
}
.device-inner {
  width: 100%; height: 100%;
  border-radius: 38px;
  overflow: hidden;
  background: #000;
  position: relative;
}
.device-inner img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ─── Section ─────────────────────────────────────────── */
.section { padding: 96px 0; position: relative; }
.section-dark { background: var(--dark-bg); color: var(--dark-text); }
.section-cream { background: var(--cream); color: var(--ink-body); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dark-text-3);
  margin-bottom: 18px;
}
.section-cream .eyebrow { color: var(--ink-body-3); }
.eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: currentColor;
  opacity: .6;
}

/* ─── Animations ─────────────────────────────────────── */
@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(45deg); }
  50%      { transform: translate(6px, -10px) rotate(45deg); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate(0, 0) rotate(45deg); }
  50%      { transform: translate(-8px, 6px) rotate(45deg); }
}
@keyframes shimmer {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}
@keyframes ink-pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50%      { box-shadow: 0 0 24px 2px currentColor; opacity: 0.85; }
}

.float-a { animation: drift   7s ease-in-out infinite; }
.float-b { animation: drift-2 9s ease-in-out infinite; }
.shimmer { animation: shimmer 4s ease-in-out infinite; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ─── Utility ─────────────────────────────────── */
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; }
.serif { font-family: var(--font-display); }

/* Headings */
.h-xl  { font-size: clamp(54px, 8vw, 120px); line-height: 0.95; letter-spacing: -0.02em; }
.h-lg  { font-size: clamp(40px, 5.5vw, 72px); line-height: 1.02; letter-spacing: -0.015em; }
.h-md  { font-size: clamp(28px, 3vw, 44px);   line-height: 1.08; }
.h-sm  { font-size: 22px; line-height: 1.15; }

.lede  { font-size: clamp(16px, 1.4vw, 19px); line-height: 1.5; color: var(--dark-text-2); max-width: 52ch; }
.section-cream .lede { color: var(--ink-body-2); }
