/* Still — a quiet place to breathe.
   One dark, soft theme, tuned for Safari on iOS as a home-screen app. */

:root {
  --bg-deep: #050f11;
  --ink: #eaf3ee;
  --dim: #90aaa4;
  --dim-2: #61807a;
  --line: rgba(200, 232, 220, 0.14);
  --accent: #a9e5c9;
  --warm: #f3c9a2;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --pad: 22px;
  --radius: 26px;
  --ease: cubic-bezier(0.22, 0.68, 0.2, 1);
}

* { box-sizing: border-box; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* ── background light ─────────────────────────────────────── */
.aurora {
  position: fixed;
  inset: -12% -12% -12% -12%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, #0d2a2c 0%, transparent 60%),
    linear-gradient(180deg, #08181a 0%, #050f11 55%, #04100f 100%);
  overflow: hidden;
}

.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.5;
}

.aurora-a {
  width: 62vmax;
  height: 62vmax;
  left: -22vmax;
  top: -12vmax;
  background: radial-gradient(circle, rgba(96, 178, 156, 0.55), transparent 68%);
  animation: drift-a 34s var(--ease) infinite alternate;
}

.aurora-b {
  width: 54vmax;
  height: 54vmax;
  right: -20vmax;
  bottom: -16vmax;
  background: radial-gradient(circle, rgba(243, 201, 162, 0.28), transparent 70%);
  animation: drift-b 42s var(--ease) infinite alternate;
}

.aurora-c {
  width: 48vmax;
  height: 48vmax;
  left: 18vmax;
  bottom: 6vmax;
  background: radial-gradient(circle, rgba(62, 122, 148, 0.4), transparent 70%);
  animation: drift-c 38s var(--ease) infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vmax, 5vmax, 0) scale(1.08); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to { transform: translate3d(-5vmax, -4vmax, 0) scale(0.95); }
}
@keyframes drift-c {
  from { transform: translate3d(0, 0, 0) scale(0.96); }
  to { transform: translate3d(-4vmax, -6vmax, 0) scale(1.1); }
}

/* ── shell ────────────────────────────────────────────────── */
#app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-areas: "screen";
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding:
    calc(env(safe-area-inset-top) + 20px)
    calc(env(safe-area-inset-right) + var(--pad))
    calc(env(safe-area-inset-bottom) + 20px)
    calc(env(safe-area-inset-left) + var(--pad));
}

.screen {
  grid-area: screen;
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3.4vh, 30px);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), visibility 0.45s;
}

.screen::-webkit-scrollbar { display: none; }

.screen.is-active {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ── home ─────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim-2);
}

.brand-mark { width: 21px; height: 21px; color: var(--accent); }

.home-orb {
  display: grid;
  place-items: center;
  margin-block: auto;
  align-self: center;
  width: 132px;
  height: 132px;
  position: relative;
  opacity: 0.9;
}

.home-orb span {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, rgba(224, 255, 242, 0.92), rgba(150, 224, 196, 0.72) 44%, rgba(70, 148, 134, 0.35) 70%, rgba(16, 54, 52, 0.22) 100%);
  box-shadow: 0 0 54px rgba(140, 220, 190, 0.26), inset 0 0 26px rgba(255, 255, 255, 0.16);
  animation: ambient 11s ease-in-out infinite;
}

.home-orb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(200, 240, 222, 0.16);
}

@keyframes ambient {
  0%, 100% { transform: scale(0.86); }
  45% { transform: scale(1); }
  55% { transform: scale(1); }
}

.home-copy { margin-top: 0; }

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 9.4vw, 46px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.018em;
}

.lede {
  margin: 12px 0 0;
  max-width: 28ch;
  color: var(--dim);
  font-size: 16px;
  line-height: 1.5;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.control { display: flex; flex-direction: column; gap: 9px; }

.control-label {
  font-size: 11px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--dim-2);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  padding: 9px 15px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.15s var(--ease);
}

.chip em {
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--dim-2);
  margin-left: 5px;
}

.chip[aria-pressed="true"] {
  background: rgba(169, 229, 201, 0.14);
  border-color: rgba(169, 229, 201, 0.4);
  color: #eafff6;
}

.chip[aria-pressed="true"] em { color: rgba(169, 229, 201, 0.72); }
.chip:active { transform: scale(0.97); }

.primary {
  appearance: none;
  border: 0;
  width: 100%;
  padding: 17px 22px;
  border-radius: 999px;
  font: inherit;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #06231d;
  background: linear-gradient(142deg, #c3eed8 0%, #9cdec2 52%, #d3ecc6 100%);
  box-shadow: 0 14px 34px -16px rgba(150, 222, 194, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.18s var(--ease), filter 0.18s var(--ease);
}

.primary:active { transform: scale(0.985); filter: brightness(0.96); }

.quiet {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--dim);
  text-decoration: underline;
  text-decoration-color: rgba(144, 170, 164, 0.35);
  text-underline-offset: 3px;
  cursor: pointer;
  touch-action: manipulation;
}

.home-foot {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  color: var(--dim-2);
}

.stats { margin: 0; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dot { color: var(--dim-2); }

.install-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(243, 201, 162, 0.2);
  border-radius: 16px;
  background: rgba(243, 201, 162, 0.06);
  font-size: 12.5px;
  line-height: 1.35;
  color: #e6d9c8;
}

.install-hint .quiet { flex: none; font-size: 12px; white-space: nowrap; }

.install-hint p { margin: 0; }
.install-hint strong { font-weight: 600; }

/* ── breathing ────────────────────────────────────────────── */
.screen-breathe {
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.breathe-time {
  margin: 4px 0 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.16em;
  color: var(--dim-2);
}

.stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 4vh, 36px);
  width: 100%;
  min-height: 0;
}

.orb-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: min(78vw, 300px);
  aspect-ratio: 1;
}

.halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(178, 240, 214, 0.34), rgba(243, 201, 162, 0.1) 54%, transparent 72%);
  filter: blur(7px);
  opacity: 0.45;
  transform: scale(0.62);
  will-change: transform, opacity;
}

.orb {
  position: relative;
  width: min(52vw, 202px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 27%, rgba(219, 255, 241, 0.96), rgba(154, 226, 198, 0.78) 42%, rgba(88, 164, 150, 0.44) 67%, rgba(18, 58, 56, 0.3) 100%);
  box-shadow:
    0 0 70px rgba(140, 220, 190, 0.3),
    0 0 140px rgba(140, 220, 190, 0.12),
    inset 0 0 46px rgba(255, 255, 255, 0.2);
  transform: scale(0.62);
  will-change: transform;
}

.orb-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(200, 232, 220, 0.09);
  stroke-width: 1.3;
}

.ring-fill {
  fill: none;
  stroke: rgba(190, 240, 218, 0.6);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-dasharray: 760.3;
  stroke-dashoffset: 760.3;
}

.stage-text { display: grid; gap: 7px; place-items: center; }

.phase {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(21px, 5.6vw, 25px);
  letter-spacing: 0.005em;
  color: var(--ink);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.phase-hint {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--dim-2);
  transition: opacity 0.35s var(--ease);
}

.phase.swap, .phase-hint.swap { opacity: 0; }

.breathe-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding-bottom: 4px;
}

.progress {
  width: min(64%, 220px);
  height: 2px;
  border-radius: 2px;
  background: rgba(200, 232, 220, 0.12);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(169, 229, 201, 0.75), rgba(243, 201, 162, 0.75));
}

/* ── reveal ───────────────────────────────────────────────── */
.screen-reveal { gap: 16px; padding-bottom: 4px; }

.reveal-head {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding-top: 2px;
}

.tick { width: 30px; height: 30px; color: var(--accent); }

.reveal-head h1 { font-size: clamp(29px, 7.8vw, 37px); }

.sub { margin: 0; color: var(--dim); font-size: 15px; }

.card {
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(11, 31, 33, 0.62);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
}

.card-fact {
  background: linear-gradient(158deg, rgba(243, 201, 162, 0.11), rgba(169, 229, 201, 0.055));
  border-color: rgba(243, 201, 162, 0.2);
}

.eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 13px;
  font-size: 10.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: rgba(243, 201, 162, 0.72);
}

.eyebrow-date { color: rgba(144, 170, 164, 0.8); letter-spacing: 0.08em; text-transform: none; font-size: 11.5px; }

.animal-name {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 9px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.emoji { font-size: 19px; }

.fact { margin: 0; font-size: 16px; line-height: 1.55; color: #dcece5; }

.aside { margin: 13px 0 0; font-size: 11.5px; color: var(--dim-2); letter-spacing: 0.02em; }

.card-photo { padding: 0; overflow: hidden; }

.photo-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #0b2426;
  overflow: hidden;
}

.photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.8s var(--ease), transform 14s ease-out;
}

.photo-frame img.is-ready { opacity: 1; transform: scale(1); }

.photo-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #0d2729 28%, #143a3b 50%, #0d2729 72%);
  background-size: 220% 100%;
  animation: shimmer 1.8s linear infinite;
  transition: opacity 0.4s ease;
}

.photo-frame.is-loaded .photo-skeleton { opacity: 0; }

@keyframes shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.photo-badge {
  position: absolute;
  left: 15px;
  bottom: 13px;
  font-size: 21px;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.55));
}

.photo-body { display: grid; gap: 8px; padding: 16px 18px 20px; }

.credit { margin: 2px 0 0; font-size: 10.5px; color: rgba(144, 170, 164, 0.72); }

.reveal-actions { display: grid; gap: 14px; justify-items: center; margin-top: 2px; }
.reveal-actions .primary { justify-self: stretch; }

/* ── entrance choreography ────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.screen-reveal.is-active .reveal-head { animation: rise 0.6s var(--ease) both; }
.screen-reveal.is-active .card-fact { animation: rise 0.7s 0.09s var(--ease) both; }
.screen-reveal.is-active .card-photo { animation: rise 0.7s 0.2s var(--ease) both; }
.screen-reveal.is-active .reveal-actions { animation: rise 0.7s 0.3s var(--ease) both; }

/* ── misc ─────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  position: relative;
  z-index: 2;
  padding: 24px;
  color: var(--ink);
}

button:focus-visible { outline: 2px solid rgba(169, 229, 201, 0.7); outline-offset: 3px; }

@media (min-height: 780px) {
  .orb-wrap { width: min(72vw, 330px); }
  .orb { width: min(48vw, 218px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
