/* Sapps — site styles. Palette and type come from the Affirm! app itself. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif Devanagari";
  src: url("fonts/noto-serif-devanagari.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --mist: #eef6f2;
  --mist-deep: #e2efea;
  --lilac-mist: #e6e1f2;
  --pine: #22433c;      /* headings, ink */
  --moss: #3d5a54;      /* body text */
  --teal: #6bb6a5;      /* the app's primary */
  --teal-ink: #1f6f60;  /* teal dark enough for text and buttons */
  --night: #1e1a3a;
  --night-2: #2a2450;
  --lavender: #9b8cc7;
  --gold: #e0a93a;
  --paper: #fbfdfc;

  --serif: "Fraunces", "Noto Serif Devanagari", Georgia, serif;
  --deva: "Noto Serif Devanagari", "Fraunces", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;

  --measure: 34rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --radius-card: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--moss);
  background: var(--mist);
  background-image:
    radial-gradient(60rem 40rem at 85% -10%, rgba(155, 140, 199, 0.28), transparent 60%),
    radial-gradient(50rem 36rem at -10% 100%, rgba(107, 182, 165, 0.26), transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--teal-ink); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--pine);
  font-weight: 560;
  line-height: 1.08;
  font-variation-settings: "SOFT" 50, "opsz" 96;
  margin: 0;
}
p { margin: 0 0 1em; max-width: var(--measure); }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--pine); color: #fff; padding: 0.5rem 0.9rem; border-radius: 8px; z-index: 10; }
.skip:focus { left: 0.5rem; }

.wrap { width: min(72rem, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- site header ---------- */
.site-head { padding-block: 1.25rem; }
.site-head .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.wordmark {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 640;
  letter-spacing: -0.01em;
  color: var(--pine);
  text-decoration: none;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 72;
}
.site-nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.site-nav a { color: var(--moss); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--pine); text-decoration: underline; }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.75rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font: 600 1rem/1.2 var(--sans);
  padding: 0.95rem 1.35rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn svg { width: 1.15rem; height: 1.15rem; flex: none; }
.btn-primary { background: var(--pine); color: #fff; }
.btn-primary:hover { background: #1a352f; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--pine); border-color: rgba(34, 67, 60, 0.35); }
.btn-ghost:hover { border-color: var(--pine); }
.btn[aria-disabled="true"] { opacity: 0.7; cursor: default; }
.btn-note { display: block; width: 100%; font-size: 0.9rem; color: var(--moss); margin-top: 0.15rem; }

/* ---------- studio home ---------- */
.studio-intro { padding-block: clamp(3rem, 10vw, 7rem) clamp(2rem, 6vw, 4rem); }
.studio-intro h1 {
  font-size: clamp(2.6rem, 7.5vw, 5.4rem);
  max-width: 14ch;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 80, "opsz" 144;
}
.studio-intro p { font-size: 1.2rem; margin-top: 1.5rem; }

.shelf { padding-bottom: clamp(3rem, 8vw, 6rem); }
.shelf h2 { font-size: 1.35rem; margin-bottom: 1.25rem; font-variation-settings: "opsz" 24; }
.app-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem 1.75rem;
  align-items: center;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(34, 67, 60, 0.1);
  border-radius: 28px;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.app-row img { width: clamp(72px, 12vw, 104px); height: auto; border-radius: 24px; box-shadow: 0 10px 26px rgba(47, 90, 80, 0.2); }
.app-row h3 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.app-row p { margin: 0.35rem 0 0; }
.app-row .more { font-weight: 600; color: var(--teal-ink); }
.app-row:hover { background: rgba(255, 255, 255, 0.85); }
.app-row:hover .more { text-decoration: underline; }
.app-row .peek { grid-column: 1 / -1; display: flex; gap: 0.75rem; overflow: hidden; margin-top: 0.5rem; }
.app-row .peek img { width: 120px; border-radius: 16px; box-shadow: none; flex: none; }

.upcoming { margin-top: 1.5rem; font-size: 0.98rem; }

/* ---------- Affirm! hero ---------- */
.hero { padding-block: clamp(2rem, 6vw, 4.5rem) clamp(3rem, 8vw, 6rem); }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.app-id { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.25rem; }
.app-id img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 8px 20px rgba(47, 90, 80, 0.2); }
.app-id span { font-size: 0.95rem; }
.hero h1 {
  font-size: clamp(3.4rem, 10vw, 6.6rem);
  letter-spacing: -0.025em;
  font-variation-settings: "SOFT" 60, "opsz" 144;
  font-weight: 600;
}
.hero .lede { font-size: clamp(1.15rem, 2.2vw, 1.35rem); margin-top: 1rem; color: var(--moss); }
.facts { margin-top: 1.1rem; font-size: 0.92rem; color: var(--moss); }

/* ---------- the deck (signature) ---------- */
.deck-stage {
  position: relative;
  background: linear-gradient(165deg, var(--night-2), var(--night) 70%);
  border-radius: 34px;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2rem);
  color: #e9e6f5;
  box-shadow: 0 30px 70px rgba(30, 26, 58, 0.35);
  overflow: hidden;
  isolation: isolate;
}
.deck-stage::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(22rem 16rem at 50% 55%, rgba(115, 86, 194, 0.35), transparent 70%),
    radial-gradient(18rem 14rem at 0% 100%, rgba(107, 182, 165, 0.22), transparent 70%);
  z-index: -1;
}
.deck-title { font-family: var(--serif); color: #fff; font-size: clamp(1.35rem, 2.6vw, 1.7rem); text-align: center; margin: 0; font-weight: 520; font-variation-settings: "opsz" 36; }
.deck-hint { text-align: center; color: #bdb6dc; font-size: 0.98rem; margin: 0.35rem auto 0; max-width: 26rem; min-height: 1.6em; }

.deck {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1rem);
  margin-block: clamp(1.5rem, 4vw, 2.25rem);
  min-height: clamp(15rem, 34vw, 19rem);
  perspective: 1200px;
}
.card {
  --w: clamp(6.2rem, 13vw, 8.4rem);
  width: var(--w);
  aspect-ratio: 5 / 7;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(.2, .7, .2, 1), width 0.5s ease, opacity 0.4s ease;
  border-radius: 18px;
  font: inherit;
  color: inherit;
}
.card:nth-child(1) { transform: rotate(-7deg) translateY(10px); }
.card:nth-child(3) { transform: rotate(7deg) translateY(10px); }
.card:hover:not([disabled]) { transform: translateY(-8px); }
.card:nth-child(1):hover:not([disabled]) { transform: rotate(-7deg) translateY(-2px); }
.card:nth-child(3):hover:not([disabled]) { transform: rotate(7deg) translateY(-2px); }

.face {
  position: absolute; inset: 0;
  border-radius: inherit;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.face.back {
  background: linear-gradient(160deg, #5b48b0, #3a2d86);
  border: 1.5px solid rgba(200, 190, 255, 0.45);
  box-shadow: 0 16px 34px rgba(10, 6, 30, 0.5);
  display: grid; place-items: center;
}
.face.back::after {
  content: "";
  position: absolute; inset: 9px;
  border: 1px solid rgba(220, 212, 255, 0.28);
  border-radius: 12px;
}
.face.back svg { width: 34%; color: #d8d0ff; opacity: 0.9; }
.face.front {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, var(--c1, #7356c2), var(--c2, #45318c));
  box-shadow: 0 22px 44px rgba(10, 6, 30, 0.55);
  padding: 1.1rem 1.05rem;
  display: flex; flex-direction: column;
  text-align: left;
  color: #fff;
}
.chip {
  align-self: flex-start;
  font: 600 0.72rem/1 var(--sans);
  padding: 0.38rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}
.quote-mark { font-family: var(--serif); font-size: 2.6rem; line-height: 0.6; opacity: 0.45; margin-top: 1.1rem; }
.affirmation {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.28;
  margin-top: 0.35rem;
  font-variation-settings: "opsz" 24, "SOFT" 30;
}
.affirmation:lang(hi) { font-family: var(--deva); font-size: 1.02rem; line-height: 1.55; }
.card.chosen .face.front { padding: 1.5rem 1.4rem; }
.card.chosen .quote-mark { font-size: 3.4rem; margin-top: 1.6rem; }
.card.chosen .affirmation { font-size: clamp(1.35rem, 2.4vw, 1.6rem); line-height: 1.24; }
.card.chosen .affirmation:lang(hi) { font-size: clamp(1.2rem, 2.1vw, 1.38rem); line-height: 1.6; }

/* drawn state */
.deck.drawn .card:not(.chosen) { opacity: 0; width: 0; pointer-events: none; }
.deck.drawn { gap: 0; }
.card.chosen { --w: clamp(13.5rem, 30vw, 16rem); transform: rotateY(180deg) !important; cursor: default; }
.card.golden .face.front {
  background: linear-gradient(160deg, #f3cf72, #c98a22);
  color: #3b2706;
  box-shadow: 0 0 0 2px #ffe7a3, 0 24px 50px rgba(224, 169, 58, 0.45);
}
.card.golden .chip { background: rgba(255, 255, 255, 0.45); }
.golden-seal {
  display: none;
  position: absolute; top: -14px; right: -14px;
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff0c4, var(--gold) 70%);
  box-shadow: 0 6px 16px rgba(160, 110, 20, 0.45);
  place-items: center; color: #fff; font-size: 1.2rem;
  transform: rotateY(180deg);
  backface-visibility: hidden;
}
.card.golden .golden-seal { display: grid; }

.deck-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.6rem 1rem; min-height: 2.6rem; }
.deck-controls[hidden] { display: none; }
.seg[hidden] { display: none; }
.seg { display: inline-flex; background: rgba(255, 255, 255, 0.08); border-radius: 999px; padding: 3px; }
.seg button {
  font: 600 0.88rem/1 var(--sans);
  color: #d6d0f0;
  background: none; border: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: #fff; color: var(--night); }
.seg button[lang="hi"] { font-family: var(--deva); font-weight: 500; }
.again {
  font: 600 0.9rem/1 var(--sans);
  color: #fff; background: none;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  cursor: pointer;
}
.again:hover { border-color: #fff; }

/* ---------- night band: screenshots ---------- */
.night {
  background: var(--night);
  color: #cfc9e8;
  padding-block: clamp(3rem, 8vw, 5.5rem);
  position: relative;
  overflow: hidden;
}
.night h2 { color: #fff; font-size: clamp(2rem, 4.5vw, 3rem); max-width: 18ch; }
.night p { color: #bdb6dc; }
.shots {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2rem var(--gutter) 1rem;
  margin-inline: calc(-1 * var(--gutter));
  scrollbar-width: thin;
  scrollbar-color: #4a4378 transparent;
}
.shots figure { margin: 0; flex: 0 0 clamp(11rem, 26vw, 15rem); scroll-snap-align: start; }
.shots img { border-radius: 20px; width: 100%; height: auto; aspect-ratio: 9 / 16; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); }
.shots figcaption { font-size: 0.9rem; margin-top: 0.7rem; color: #bdb6dc; }

/* ---------- features ---------- */
.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section > .wrap > h2 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 2rem; max-width: 20ch; }
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2.25rem 3rem;
  list-style: none; padding: 0; margin: 0;
}
.features li { border-top: 2px solid var(--sw, var(--teal)); padding-top: 1rem; }
.features h3 { font-size: 1.3rem; margin-bottom: 0.4rem; font-variation-settings: "opsz" 30, "SOFT" 40; }
.features p { margin: 0; }

/* ---------- install ---------- */
.install { background: rgba(255, 255, 255, 0.55); border-block: 1px solid rgba(34, 67, 60, 0.1); }
.install .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); }
.install h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.steps li { counter-increment: s; position: relative; padding-left: 3rem; margin-bottom: 1.3rem; }
.steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: -0.1rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center;
  font: 600 1rem/1 var(--serif);
  color: var(--pine);
  background: var(--mist-deep);
  border: 1px solid rgba(34, 67, 60, 0.18);
}
.steps strong { color: var(--pine); }
.spec { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.7rem 1.5rem; font-size: 0.98rem; align-content: start; }
.spec dt { color: var(--pine); font-weight: 600; }
.spec dd { margin: 0; overflow-wrap: anywhere; }
.hash { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.82rem; line-height: 1.5; }
.callout { margin-top: 1.5rem; padding: 1rem 1.2rem; border-left: 3px solid var(--teal); background: rgba(107, 182, 165, 0.12); border-radius: 0 12px 12px 0; font-size: 0.97rem; }
.callout p { margin: 0; }

/* ---------- privacy band ---------- */
.privacy .wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.privacy h2 { font-size: clamp(2rem, 4.5vw, 3rem); }

/* ---------- footer ---------- */
.site-foot { padding-block: 2.5rem 3rem; font-size: 0.93rem; border-top: 1px solid rgba(34, 67, 60, 0.12); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; }
.site-foot p { margin: 0; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero .wrap, .install .wrap, .privacy .wrap { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(3.2rem, 15vw, 4.6rem); }
}
@media (max-width: 520px) {
  .site-nav { gap: 0.9rem; font-size: 0.9rem; }
  .btn { width: 100%; justify-content: center; }
  .app-row { grid-template-columns: 1fr; }
  .app-row .peek img { width: 96px; }
  .spec { grid-template-columns: 1fr; gap: 0.2rem; }
  .spec dd { margin-bottom: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover:not([disabled]) { transform: none; }
}
