/* Fitila — fitila.app
   Design tokens, Halo signature and layout lifted from the iOS app
   (www/index.html) so the site and the product read as one thing. */

:root {
  --bg-deepest: #1a0f0a;
  --bg-deep: #221610;
  --bg-card: #2a1c14;
  --bg-card-soft: #322218;
  --amber-bright: #f5b86d;
  --amber: #e0934a;
  --amber-deep: #b86d2c;
  --terracotta: #8a4a2a;
  --terracotta-deep: #5c2f1a;
  --cream: #f4e4ce;
  --cream-soft: #d8c4a6;
  --cream-dim: #8a7560;
  --shadow-warm: 0 8px 32px rgba(184, 109, 44, 0.12);
  --shadow-deep: 0 12px 48px rgba(0, 0, 0, 0.4);
  --rule: rgba(244, 228, 206, 0.08);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(184, 109, 44, 0.10) 0%, transparent 55%),
    var(--bg-deepest);
  color: var(--cream-soft);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
}

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

/* ---- masthead ---------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 0 0;
  flex-wrap: wrap;
}

.mark {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 28px;
  color: var(--amber);
  margin: 0;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.masthead nav { display: flex; gap: 20px; font-size: 14px; }
.masthead nav a { color: var(--cream-dim); text-decoration: none; }
.masthead nav a:hover { color: var(--amber); }

/* ---- typography -------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--cream);
  font-weight: 600;
  line-height: 1.25;
}

h1 { font-size: clamp(34px, 7vw, 46px); font-style: italic; margin: 0 0 10px; }
h2 { font-size: clamp(24px, 4.5vw, 30px); margin: 52px 0 14px; }
h3 { font-size: 20px; margin: 30px 0 8px; }

p { margin: 0 0 15px; }
ul { margin: 0 0 18px; padding-left: 22px; }
li { margin-bottom: 8px; }
strong { color: var(--cream); font-weight: 600; }
a { color: var(--amber); text-underline-offset: 3px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

code {
  background: var(--bg-card);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 14px;
}

.lede {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 21px;
  font-style: italic;
  color: var(--cream-soft);
  line-height: 1.6;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin: 0;
}

/* ---- the Halo ---------------------------------------------------------- */

.halo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0 8px;
  position: relative;
}

.halo-wrapper {
  position: relative;
  width: 240px;
  height: 240px;
  max-width: 72vw;
  max-height: 72vw;
  display: flex;
  align-items: center;
  justify-content: center;
}

.halo-svg { position: absolute; inset: 0; transform: rotate(-90deg); }

.halo-track {
  fill: none;
  stroke: rgba(244, 228, 206, 0.05);
  stroke-width: 2;
}

.halo-arc {
  fill: none;
  stroke: url(#haloGradient);
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 800ms ease;
  filter: drop-shadow(0 0 8px rgba(224, 147, 74, 0.4));
}

.halo-glow {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(245, 184, 109, 0.25) 0%,
    rgba(224, 147, 74, 0.12) 40%,
    transparent 70%
  );
  animation: breathe 5s ease-in-out infinite;
  transition: opacity 1.5s ease;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.85; }
}

.lamp-icon {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lamp-svg { width: 100%; height: 100%; }

.flame { transform-origin: 50% 100%; animation: flicker 2.4s ease-in-out infinite; }

@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(0deg); opacity: 1; }
  25% { transform: scale(0.98, 1.04) rotate(-1deg); opacity: 0.92; }
  50% { transform: scale(1.02, 0.98) rotate(0.5deg); opacity: 1; }
  75% { transform: scale(0.97, 1.02) rotate(0.8deg); opacity: 0.95; }
}

.halo-wrapper.pulsing { animation: pulse-strong 1.7s ease-out; }

@keyframes pulse-strong {
  0% { transform: scale(1); }
  22% { transform: scale(1.055); }
  100% { transform: scale(1); }
}

.status-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-top: 26px;
}

.status-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 23px;
  color: var(--cream);
  margin-top: 4px;
  transition: opacity 400ms ease;
}

/* ---- tending controls -------------------------------------------------- */

.tend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 26px 0 6px;
}

.tend-btn {
  background: var(--bg-card);
  border: 1px solid rgba(224, 147, 74, 0.20);
  color: var(--cream-soft);
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, transform 120ms ease;
}

.tend-btn:hover { border-color: rgba(224, 147, 74, 0.55); background: var(--bg-card-soft); }
.tend-btn:active { transform: scale(0.97); }
.tend-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.tend-hint {
  text-align: center;
  font-size: 13px;
  color: var(--cream-dim);
  margin: 4px 0 0;
  min-height: 20px;
}

/* ---- cards ------------------------------------------------------------- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 22px;
  margin: 0 0 16px;
  box-shadow: var(--shadow-warm);
}

.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.card-grid { display: grid; gap: 16px; }
@media (min-width: 620px) { .card-grid { grid-template-columns: 1fr 1fr; } }

.quiet { color: var(--cream-dim); font-size: 14px; }

/* ---- try it (TestFlight) ----------------------------------------------- */
/* A QR is the right answer on desktop, where there is no way to get from a
   laptop browser onto a phone. On a phone it is absurd — you are already
   holding the device — so the button shows there instead. Never both. */

.try {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 26px 22px;
  margin: 26px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.try h3 { margin: 0; }
.try p { margin: 0; max-width: 42ch; }

.try-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--amber-bright), var(--amber-deep));
  color: #2a1c14;
  font-weight: 600;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 999px;
}

.try-qr, .try-qr-caption {
  display: none;
  background: rgba(244, 228, 206, 0.04);
  border-radius: 14px;
  padding: 14px;
  line-height: 0;
}
.qr-svg { width: 148px; height: 148px; display: block; }

@media (min-width: 620px) {
  .try-qr { display: block; }
  .try-qr-caption { display: block; }
  .try-btn { display: none; }
}

/* ---- footer ------------------------------------------------------------ */

footer {
  margin-top: 64px;
  padding: 26px 0 60px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--cream-dim);
}

footer nav { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---- motion preferences ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .halo-glow, .flame, .halo-wrapper.pulsing { animation: none; }
  .halo-arc { transition: none; }
  * { scroll-behavior: auto; }
}
