/* ═══════════════════════════════════════════════════════════════
   CallaLily.ai — design system
   Direction: "Nocturne" — the black calla (Zantedeschia
   'Schwarzwalder'). Aubergine dark ground, ivory spathe, one
   molten-gold spadix accent. Things bloom out of the dark.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Ground */
  --ink:        #16111B;   /* aubergine-black, page */
  --ink-2:      #1F1826;   /* raised surface */
  --ink-3:      #2A2131;   /* hover / input */
  --plum:       #3E2748;   /* depth in gradients */

  /* Ink on ground */
  --ivory:      #F4EFE6;   /* spathe white — primary text */
  --mist:       #A2939D;   /* muted lilac-grey — secondary */
  --dim:        #6E6076;   /* tertiary, captions */

  /* Accents — spend these sparingly */
  --spadix:     #E3AA46;   /* the golden spadix. THE accent. */
  --spadix-dim: #8A6522;
  --stem:       #8CA678;   /* chartreuse stem — growth/success only */

  --line:       rgba(244,239,230,.10);
  --line-2:     rgba(244,239,230,.18);

  /* Type */
  --display: 'Bodoni Moda', 'Didot', Georgia, serif;
  --body:    'Instrument Sans', 'Inter', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Rhythm */
  --gut: clamp(1.25rem, 4vw, 2.5rem);
  --max: 1240px;
  --r:   14px;             /* one radius, used consistently */

  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 350;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient bloom glow behind everything */
body::before {
  content: '';
  position: fixed;
  inset: -20% 0 auto -20%;
  width: 140%;
  height: 90vh;
  background:
    radial-gradient(50% 55% at 22% 18%, rgba(62,39,72,.55), transparent 70%),
    radial-gradient(40% 45% at 78% 8%, rgba(227,170,70,.09), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); position: relative; z-index: 1; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 var(--gut); position: relative; z-index: 1; }

/* ── Typography ───────────────────────────────────────────────── */

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.02;
  margin: 0;
}

.h-hero {
  font-size: clamp(2.9rem, 8.2vw, 6.4rem);
  font-weight: 400;
}
.h-hero em {
  font-style: italic;
  font-weight: 500;
  color: var(--spadix);
}
.h-1 { font-size: clamp(2.2rem, 5vw, 3.9rem); }
.h-2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.h-3 { font-family: var(--body); font-size: 1.06rem; font-weight: 500; letter-spacing: -.01em; }

.eyebrow {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--spadix);
  display: block;
  margin-bottom: 1.1rem;
}
.eyebrow.muted { color: var(--dim); }

.lede {
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  color: var(--mist);
  line-height: 1.55;
  max-width: 46ch;
}
.muted  { color: var(--mist); }
.dimmed { color: var(--dim); font-size: .86rem; }

a { color: inherit; }

/* ── Buttons ──────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .95rem 1.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--body);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .3s var(--ease), background .3s var(--ease),
              border-color .3s var(--ease), color .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-gold {
  background: var(--spadix);
  color: #221802;
  font-weight: 600;
  box-shadow: 0 0 0 0 rgba(227,170,70,.4);
}
.btn-gold:hover { background: #F0BC5F; box-shadow: 0 10px 40px -12px rgba(227,170,70,.6); }

.btn-ghost { border-color: var(--line-2); color: var(--ivory); background: transparent; }
.btn-ghost:hover { border-color: var(--ivory); background: rgba(244,239,230,.05); }

.btn-quiet { padding: .6rem 1.1rem; font-size: .88rem; color: var(--mist); }
.btn-quiet:hover { color: var(--ivory); }

.btn-lg { padding: 1.15rem 2.2rem; font-size: 1.02rem; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-block { width: 100%; }

/* Keyboard focus — visible, on brand */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--spadix);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ── Nav ──────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(22,17,27,.72);
  backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: -.035em;
}
.brand .dot-ai { color: var(--spadix); font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; align-self: flex-end; margin-bottom: .42rem; }
.nav-links { display: flex; gap: 2rem; font-size: .92rem; color: var(--mist); }
.nav-links a { text-decoration: none; transition: color .25s; }
.nav-links a:hover { color: var(--ivory); }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ── Hero ─────────────────────────────────────────────────────── */

.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem); position: relative; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 340px; margin: 0 auto; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .95rem .4rem .6rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: 1.8rem;
}
.badge .pip {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--spadix);
  box-shadow: 0 0 0 0 rgba(227,170,70,.7);
  animation: pip 2.6s infinite;
}
@keyframes pip {
  0%   { box-shadow: 0 0 0 0 rgba(227,170,70,.6); }
  70%  { box-shadow: 0 0 0 9px rgba(227,170,70,0); }
  100% { box-shadow: 0 0 0 0 rgba(227,170,70,0); }
}

/* ── SIGNATURE: the unfurling calla ───────────────────────────── */

.calla { width: 100%; height: auto; overflow: visible; }
.calla .spathe,
.calla .stem-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: unfurl 2.6s var(--ease) forwards;
}
.calla .spathe   { stroke: var(--ivory); stroke-width: 1.4; }
.calla .spathe-2 { stroke: var(--mist);  stroke-width: 1; opacity: .55; animation-delay: .25s; }
.calla .stem-line{ stroke: var(--stem);  stroke-width: 1.6; animation-delay: .5s; }
.calla .spadix-shape {
  fill: var(--spadix);
  transform-origin: 50% 100%;
  transform: scaleY(0);
  animation: rise 1.5s var(--ease) 1.1s forwards;
}
.calla .halo { fill: var(--spadix); opacity: 0; animation: halo 4s ease-in-out 1.9s infinite; }

@keyframes unfurl { to { stroke-dashoffset: 0; } }
@keyframes rise   { to { transform: scaleY(1); } }
@keyframes halo   { 0%,100% { opacity: .04; } 50% { opacity: .13; } }

/* ── Sections ─────────────────────────────────────────────────── */

.section { padding: clamp(3.5rem, 8vw, 7rem) 0; position: relative; }
.section-line { border-top: 1px solid var(--line); }
.section-head { max-width: 620px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head .lede { margin-top: 1.1rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ── The five stages (a real sequence, so it's numbered) ──────── */

.stages { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
@media (min-width: 780px) { .stages { grid-template-columns: repeat(5, 1fr); } }

.stage {
  background: var(--ink);
  padding: 2rem 1.5rem 2.2rem;
  transition: background .45s var(--ease);
  position: relative;
}
.stage:hover { background: var(--ink-2); }
.stage-mark {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .18em;
  color: var(--spadix-dim);
  display: block;
  margin-bottom: 1.6rem;
}
.stage-name { font-family: var(--display); font-size: 1.55rem; margin-bottom: .5rem; }
.stage-sub  { font-family: var(--mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin-bottom: .9rem; }
.stage p { color: var(--mist); font-size: .93rem; margin: 0; line-height: 1.5; }
.stage:hover .stage-mark { color: var(--spadix); }

/* ── Cards ────────────────────────────────────────────────────── */

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }

.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.8rem;
  transition: border-color .4s var(--ease), transform .4s var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.card h3 { margin-bottom: .55rem; }
.card p  { color: var(--mist); font-size: .94rem; margin: 0; }

/* ── Forms ────────────────────────────────────────────────────── */

.field { margin-bottom: 1.15rem; }
.label {
  display: block;
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: .55rem;
}
.input, .textarea, select.input {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: .9rem 1rem;
  color: var(--ivory);
  font-family: var(--body);
  font-size: 1rem;
  transition: border-color .3s, background .3s;
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--spadix);
  background: var(--ink-3);
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--dim); }

.panel {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1.6rem, 4vw, 2.6rem);
}

.auth-shell { max-width: 440px; margin: clamp(3rem, 8vw, 6rem) auto; padding: 0 var(--gut); }

.notice {
  border-radius: 10px;
  padding: .85rem 1rem;
  font-size: .9rem;
  margin-bottom: 1.2rem;
  border: 1px solid;
}
.notice-error { background: rgba(190,70,70,.1);  border-color: rgba(216,96,96,.35); color: #F0B4B4; }
.notice-ok    { background: rgba(140,166,120,.1); border-color: rgba(140,166,120,.35); color: var(--stem); }

/* ── Harmony sliders ──────────────────────────────────────────── */

.harmony { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.4rem 1.8rem; }
.slider-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.slider-val { font-family: var(--mono); font-size: .72rem; color: var(--spadix); }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 2px; background: var(--line-2);
  border-radius: 2px; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--spadix);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 1px var(--spadix);
  transition: transform .2s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--spadix); border: 3px solid var(--ink); cursor: pointer;
}

/* ── Bloom result ─────────────────────────────────────────────── */

.bloom-stage {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0;
  opacity: 0;
  transform: translateY(14px);
  animation: settle .8s var(--ease) forwards;
}
.bloom-stage .stage-mark { color: var(--spadix); margin-bottom: 1rem; }
.bloom-stage:nth-child(1) { animation-delay: .05s; }
.bloom-stage:nth-child(2) { animation-delay: .18s; }
.bloom-stage:nth-child(3) { animation-delay: .31s; }
.bloom-stage:nth-child(4) { animation-delay: .44s; }
.bloom-stage:nth-child(5) { animation-delay: .57s; }
@keyframes settle { to { opacity: 1; transform: none; } }

.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .7rem; }
.swatch { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.swatch-chip { height: 86px; }
.swatch-meta { padding: .6rem .7rem; background: var(--ink-2); }
.swatch-name { font-size: .8rem; display: block; }
.swatch-hex  { font-family: var(--mono); font-size: .68rem; color: var(--dim); text-transform: uppercase; }

.mark-well {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--ivory);
  border-radius: var(--r);
  padding: 2rem;
}
.mark-well svg { width: 100%; height: 100%; max-width: 190px; }

.type-spec { border-left: 2px solid var(--spadix); padding-left: 1.1rem; }
.type-spec .sample-display { font-size: 2.6rem; line-height: 1.1; margin-bottom: .3rem; }
.type-spec .sample-body { font-size: .98rem; color: var(--mist); }

.kv { display: grid; gap: .9rem; }
.kv-row { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; align-items: start; }
.kv-row dt { font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding-top: .25rem; }
.kv-row dd { margin: 0; color: var(--ivory); }
@media (max-width: 620px) { .kv-row { grid-template-columns: 1fr; gap: .3rem; } }

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: .3rem .8rem;
  color: var(--mist);
  margin: 0 .35rem .4rem 0;
}

/* ── Loading: the flower breathing ────────────────────────────── */

.blooming { display: grid; place-items: center; padding: 4rem 0; gap: 1.4rem; text-align: center; }
.blooming svg { width: 92px; animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .5; } 50% { transform: scale(1.07); opacity: 1; } }
.blooming .status { font-family: var(--mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--spadix); }

/* ── Dashboard ────────────────────────────────────────────────── */

.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.credits { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; color: var(--mist); text-transform: uppercase; }
.credits b { color: var(--spadix); font-size: 1.5rem; font-family: var(--display); letter-spacing: 0; }

.bloom-tile {
  display: block;
  text-decoration: none;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color .35s, transform .35s var(--ease);
}
.bloom-tile:hover { border-color: var(--spadix-dim); transform: translateY(-3px); }
.tile-strip { display: flex; height: 7px; }
.tile-strip span { flex: 1; }
.tile-body { padding: 1.3rem; }
.tile-title { font-family: var(--display); font-size: 1.35rem; margin-bottom: .3rem; }

.empty {
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  padding: clamp(2.5rem, 6vw, 4.5rem) 2rem;
  text-align: center;
}

/* ── Pricing ──────────────────────────────────────────────────── */

.tier { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r); padding: 2rem; display: flex; flex-direction: column; }
.tier-featured { border-color: var(--spadix); background: linear-gradient(180deg, rgba(227,170,70,.07), transparent 55%), var(--ink-2); }
.tier-price { font-family: var(--display); font-size: 3.2rem; line-height: 1; margin: .6rem 0 1.4rem; }
.tier-price span { font-family: var(--body); font-size: .9rem; color: var(--dim); letter-spacing: 0; }
.tier ul { list-style: none; padding: 0; margin: 0 0 1.8rem; display: grid; gap: .65rem; font-size: .93rem; color: var(--mist); }
.tier li::before { content: '—'; color: var(--spadix); margin-right: .6rem; }
.tier .btn { margin-top: auto; }

/* ── Footer ───────────────────────────────────────────────────── */

.foot { border-top: 1px solid var(--line); padding: 3rem 0; margin-top: 4rem; }
.foot-in { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; font-size: .85rem; color: var(--dim); }

/* ── Scroll reveal ────────────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.seen { opacity: 1; transform: none; }

/* ── Respect reduced motion ───────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .calla .spathe, .calla .stem-line { stroke-dashoffset: 0; }
  .calla .spadix-shape { transform: scaleY(1); }
  .reveal { opacity: 1; transform: none; }
}
