/* Hilltop's home page in the app's look (Hilltop Flat, Ridge green).
   The ring opening, the week told on an iPhone, the ridge, then Start your group.
   The other pages use style.css, which shares these colours, fonts, nav, footer and buttons. */

@font-face { font-family: "Figtree"; src: url("/assets/fonts/figtree.ttf") format("truetype"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/assets/fonts/instrument-serif-italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --ground: #F6F7F9; --surface: #FFFFFF; --line-strong: #D9DCE3; --track: #E6E8EE;
  --ink: #121214; --ink2: #5A5E67; --ink3: #6A6E78;
  --primary: #1F5D4C; --primary-pressed: #184A3D; --on-primary: #FFFFFF; --primary-tint: #EAF4F0;
  --wordmark: #1F5D4C; /* the logo for now: the word "Hilltop", Ridge green on light, white on dark */
  --nav: #121214; --on-nav: #FFFFFF;
  --bar: #121214; --on-bar: #FFFFFF; --bar-ink: #8E9098;
  --on-pastel: #121214; --you: #121214; --on-you: #FFFFFF;
  --on-photo: #FFFFFF; --on-photo2: rgba(255,255,255,.82);
  --slate: #7FAAC6;
  --p-sky: #D3E4F7; --p-peach: #FBD9CF; --p-rose: #F7D6E4; --p-sand: #F1E3CF; --p-butter: #FBE7B5; --p-lilac: #E3DAF6;
  --frame: #121214; --frame-edge: #2A2B2F; --frame-button: #2A2B2F;
  --phone-shadow: 0 30px 60px rgba(18,18,20,.16), 0 8px 18px rgba(18,18,20,.10);
  --font: "Figtree", -apple-system, "Segoe UI", system-ui, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --nav-h: 68px;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #000000; --surface: #1C1C1E; --line-strong: #48484A; --track: #2C2C2E;
    --ink: #F4F5F7; --ink2: #AEB0B7; --ink3: #9496A0;
    --primary: #7FD1B5; --primary-pressed: #A6D3C2; --on-primary: #0B2520; --primary-tint: #15302A;
    --wordmark: #FFFFFF;
    --nav: #F4F5F7; --on-nav: #121214;
    --bar: #2C2C2E; --on-bar: #F4F5F7; --bar-ink: #9A9CA5;
    --you: #F4F5F7; --on-you: #121214;
    --frame: #1C1C1E; --frame-edge: #3A3A3C; --frame-button: #3A3A3C;
    --phone-shadow: 0 0 0 1px rgba(255,255,255,.06);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 17px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--ground); }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, figure { margin: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 999px; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 40; padding: 10px 16px; border-radius: 999px; background: var(--nav); color: var(--on-nav); font-weight: 600; }
.skip:focus { top: 12px; }

/* Buttons: one green action, black for the nav, white with an outline for the rest */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: 999px; border: 0; cursor: pointer;
  font: 600 16px var(--font);
  transition: transform .12s ease-out, background-color .15s ease, box-shadow .15s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-pressed); }
.btn.outline { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.outline:hover { box-shadow: inset 0 0 0 1px var(--ink3); }
.btn.black { background: var(--nav); color: var(--on-nav); }
.btn.off { background: var(--track); color: var(--ink2); cursor: default; }
.btn.off:active { transform: none; }

/* Nav: the wordmark, two links, one action */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px); padding-left: var(--gutter-l); padding-right: var(--gutter-r); background: var(--ground); }
.nav-in { max-width: 1160px; margin: 0 auto; height: var(--nav-h); display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: var(--wordmark); }
/* The Twin hills mark beside the word (Oct 31), the same shape as the app's. */
.brand-mark { width: 30px; height: 18px; flex: none; }
.nav-links { margin-left: auto; display: flex; gap: 24px; font-size: 15px; font-weight: 500; color: var(--ink2); }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; background: var(--nav); color: var(--on-nav); font-weight: 600; font-size: 15px; transition: transform .12s ease-out; }
.nav-cta:active { transform: scale(.97); }

/* ---------- The ring: twelve seats around the words ---------- */
.ring-stage { height: 220vh; height: 220svh; position: relative; }
.ring-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  padding-top: var(--nav-h); padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  display: grid; align-content: center; justify-items: center; gap: 28px;
}
.ring {
  position: relative;
  width: min(560px, 88vw, calc(100vh - 330px));
  width: min(560px, 88vw, calc(100svh - 330px));
  min-width: 290px; max-width: 100%; aspect-ratio: 1;
  container-type: inline-size;
}
.ring > svg { display: block; width: 100%; height: 100%; overflow: visible; touch-action: manipulation; }
/* The track and the green line get their widths from the script: dashes on a non-scaling stroke measure wrong. */
.ring .track { fill: none; stroke: var(--line-strong); stroke-width: 2.6; stroke-dasharray: 1; }
.ring .arc { fill: none; stroke: var(--primary); stroke-width: 5.2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.ring .ripple { fill: none; stroke: var(--primary); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.seat { cursor: pointer; }
.seat .dot { fill: var(--ink3); }
.seat .edge { fill: var(--ground); }
.seat text { font: 600 21px var(--font); text-anchor: middle; dominant-baseline: central; fill: var(--on-pastel); pointer-events: none; }
.seat.you .bg { fill: var(--you); }
.seat.you text { fill: var(--on-you); font-size: 17px; }
.seat.you .halo { fill: none; stroke: var(--primary); stroke-width: 2.5px; vector-effect: non-scaling-stroke; }

.ring-center { position: absolute; inset: 18%; display: grid; place-content: center; justify-items: center; text-align: center; gap: 2.6cqi; pointer-events: none; }
.ring-event { display: inline-flex; align-items: center; gap: 8px; font-size: max(13px, 2.6cqi); font-weight: 500; color: var(--ink2); }
.gdot { width: 8px; height: 8px; border-radius: 999px; background: var(--slate); flex: none; }
.ring h1 { font-size: 11.4cqi; line-height: .96; letter-spacing: -0.015em; }
.ring h1 span { display: block; }
.ring-count { display: inline-flex; align-items: center; gap: 6px; font-size: max(14px, 2.7cqi); font-weight: 600; color: var(--ink2); font-variant-numeric: tabular-nums; }
.ring-count svg { width: 1.05em; height: 1.05em; color: var(--primary); display: none; }
.ring.full .ring-count { color: var(--ink); }
.ring.full .ring-count svg { display: block; }

.ring-below { display: grid; justify-items: center; gap: 22px; max-width: 540px; text-align: center; }
.ring-below .sub { font-size: 18px; text-wrap: pretty; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.code { margin: 0; }
.cells { position: relative; display: flex; gap: 8px; }
.cells input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; font-size: 16px; caret-color: transparent; cursor: text; }
.cell {
  width: 44px; height: 52px; border-radius: 14px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  display: grid; place-items: center; font: 600 20px var(--font); color: var(--ink);
  transition: box-shadow .15s ease, background-color .15s ease;
}
.cells.focused .cell.active { box-shadow: inset 0 0 0 2px var(--ink); }
.cells.done .cell { box-shadow: inset 0 0 0 2px var(--primary); background: var(--primary-tint); }
.join-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px; font-size: 15px; color: var(--ink2); }
.cue { position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink3); transition: opacity .3s ease; }
.cue svg { width: 16px; height: 16px; }
.cue.gone { opacity: 0; }

/* ---------- The week: the real app on an iPhone, pinned while you scroll ---------- */
.week-stage { position: relative; height: 470vh; height: 470svh; }
.week-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  padding: calc(var(--nav-h) + 8px) var(--gutter-r) 0 var(--gutter-l);
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
}
.split { max-width: 1080px; width: 100%; margin: 0 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 72px; align-items: center; }
.words { display: grid; gap: 36px; align-content: center; }
.week-stage h2 { font-weight: 700; font-size: clamp(30px, 4.4vw, 60px); line-height: 1.02; letter-spacing: -0.035em; max-width: 11em; text-wrap: balance; }
.chapters { display: grid; }
.chapter { grid-area: 1 / 1; display: grid; gap: 12px; align-content: start; opacity: 0; transform: translateY(14px); visibility: hidden; transition: opacity .3s ease, transform .4s cubic-bezier(.2,.7,.2,1), visibility 0s linear .4s; }
.chapter.on { opacity: 1; transform: none; visibility: visible; transition: opacity .3s ease .08s, transform .4s cubic-bezier(.2,.7,.2,1) .08s, visibility 0s; }
.chapter h3 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.05; letter-spacing: -0.01em; }
.chapter p { font-size: 18px; max-width: 28em; }

.phone-wrap { height: 100%; min-height: 0; display: grid; place-items: center; perspective: 1400px; padding-block: 8px 12px; }
.phone { position: relative; height: min(100%, 760px); aspect-ratio: 1 / 2.09; container-type: inline-size; will-change: transform; }
/* Sized from the phone's own width (cqi), so the frame keeps its shape at any size. */
.phone-body { position: relative; width: 100%; height: 100%; background: var(--frame); border-radius: 17cqi; padding: 3.4cqi; box-shadow: inset 0 0 0 1.5px var(--frame-edge), var(--phone-shadow); }
.side { position: absolute; width: 1.4cqi; background: var(--frame-button); border-radius: 2cqi; }
.side.b1 { left: -1.1cqi; top: 22%; height: 7%; }
.side.b2 { left: -1.1cqi; top: 31%; height: 11%; }
.side.b3 { left: -1.1cqi; top: 44%; height: 11%; }
.side.b4 { right: -1.1cqi; top: 34%; height: 15%; }
.screen { position: relative; width: 100%; height: 100%; border-radius: 13.6cqi; overflow: hidden; background: #000; isolation: isolate; }
.island { position: absolute; z-index: 5; top: 2.5cqi; left: 50%; transform: translateX(-50%); width: 30cqi; height: 8.4cqi; border-radius: 999px; background: #000; }
.shot { position: absolute; inset: 0; opacity: 0; }
.shot.on { opacity: 1; z-index: 2; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot .dark { display: none; }
/* After the default above, so it wins: the app's dark screenshots in dark mode. */
@media (prefers-color-scheme: dark) {
  .shot .light { display: none; }
  .shot .dark { display: block; }
}
.tap { position: absolute; z-index: 4; width: 15cqi; height: 15cqi; margin: -7.5cqi 0 0 -7.5cqi; border-radius: 999px; background: rgba(255,255,255,.42); opacity: 0; pointer-events: none; }

/* The chapter bar is shaped like the app's own tab bar */
.bar-wrap { display: grid; justify-items: center; padding: 14px 0 max(22px, env(safe-area-inset-bottom, 0px)); }
.bar { display: flex; gap: 4px; padding: 6px; border-radius: 999px; background: var(--bar); }
.bar button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px;
  background: transparent; color: var(--bar-ink); font: 600 14px var(--font); cursor: pointer;
  transition: background-color .25s ease, color .25s ease;
}
.bar button svg { width: 18px; height: 18px; flex: none; }
.bar button:hover { color: var(--on-bar); }
.bar button.on { background: var(--on-bar); color: var(--bar); }
.bar button:active { transform: scale(.97); }

/* ---------- The explaining sections: how it works, leaders, safety, features, questions ---------- */
.section { padding: 152px var(--gutter-r) 0 var(--gutter-l); }
.frame { max-width: 1080px; margin: 0 auto; }
.big { font-weight: 700; font-size: clamp(30px, 4vw, 52px); line-height: 1.04; letter-spacing: -0.03em; text-wrap: balance; }
.lead { margin-top: 16px; font-size: 19px; max-width: 34em; text-wrap: pretty; }
.aside { margin-top: 24px; font-size: 16px; color: var(--ink2); }
.aside a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.steps { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { background: var(--surface); border-radius: 24px; padding: 24px; display: grid; gap: 8px; align-content: start; }
.step-visual { height: 92px; display: flex; align-items: center; }
.step h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.step p { font-size: 16px; color: var(--ink2); }
.group-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px; background: var(--ground); font-weight: 600; font-size: 15px; }
.group-avatar { width: 40px; height: 40px; border-radius: 999px; background: var(--slate); color: var(--on-pastel); display: grid; place-items: center; font: 700 14px var(--font); }
.chip-meta { font-weight: 500; color: var(--ink2); }
.mini-cells { display: flex; gap: 6px; }
.mini-cells span { width: 36px; height: 46px; border-radius: 12px; background: var(--ground); box-shadow: inset 0 0 0 1px var(--line-strong); display: grid; place-items: center; font: 600 18px var(--font); }
.faces { display: flex; align-items: center; }
.faces img, .faces .more { width: 46px; height: 46px; border-radius: 999px; border: 3px solid var(--surface); margin-left: -12px; object-fit: cover; }
.faces img:first-child { margin-left: 0; }
.faces .more { display: grid; place-items: center; background: var(--track); color: var(--ink2); font: 600 14px var(--font); }

.leaders .frame { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 80px; align-items: center; }
.points { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 16px; max-width: 30em; }
.points li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; font-size: 18px; }
.points svg { width: 20px; height: 20px; margin-top: 4px; color: var(--primary); }
.phone.static { height: 620px; }

.facts { margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; padding: 36px; border-radius: 24px; background: var(--surface); }
.facts dt { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.facts dd { margin: 8px 0 0; font-size: 16px; color: var(--ink2); }

.features .frame { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 2fr); gap: 64px; align-items: start; }
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 40px; }
.feature-list h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.feature-list p { margin-top: 6px; font-size: 16px; color: var(--ink2); }

.faq-list { margin-top: 36px; display: grid; gap: 10px; max-width: 760px; }
.faq details { background: var(--surface); border-radius: 18px; padding: 6px 24px; }
.faq summary { list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 600; font-size: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 20px; height: 20px; flex: none; color: var(--ink3); transition: transform .2s ease; }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq summary:focus-visible { outline-offset: 6px; border-radius: 8px; }
.faq details p { padding-bottom: 16px; font-size: 17px; color: var(--ink2); max-width: 40em; }
.faq + .ridge { padding-top: 152px; }

@media (max-width: 960px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features .frame { grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- The ridge ---------- */
.ridge { padding: 24px var(--gutter-r) 40px var(--gutter-l); }
.photo-card { position: relative; max-width: 1160px; margin: 0 auto; border-radius: 28px; overflow: hidden; aspect-ratio: 16 / 9; max-height: 760px; width: 100%; background: #1C1C1E; }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0) 35%, rgba(0,0,0,.72) 100%); }
.photo-card figcaption { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: clamp(24px, 4vw, 56px); display: grid; gap: 12px; max-width: 860px; }
.verse { color: var(--on-photo); font-size: clamp(24px, 3.3vw, 42px); line-height: 1.12; text-wrap: balance; }
.verse-ref { color: var(--on-photo2); font-size: 15px; font-weight: 500; }

/* ---------- Start your group ---------- */
.start { padding: 136px var(--gutter-r) 112px var(--gutter-l); text-align: center; display: grid; justify-items: center; gap: 20px; }
.start h2 { font-weight: 700; font-size: clamp(32px, 4.4vw, 60px); line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
.start p { font-size: 18px; max-width: 30em; }
.start .ctas { margin-top: 8px; }

/* ---------- Footer ---------- */
.footer { max-width: 1160px; margin: 0 auto; padding: 32px var(--gutter-r) max(40px, env(safe-area-inset-bottom, 0px)) var(--gutter-l); display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; color: var(--ink2); font-size: 15px; }
.footer .brand { color: var(--wordmark); }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-left: auto; }
.footer nav a:hover { color: var(--ink); }
.footer .credit { flex-basis: 100%; font-size: 14px; color: var(--ink3); }
.footer .credit a { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
  :root { --nav-h: 60px; }
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
  .ring-sticky { gap: 22px; }
  .ring-below .sub { font-size: 17px; }
  .ring-below .ctas { width: 100%; max-width: 360px; flex-direction: column; align-items: stretch; }
  .ring-below .ctas .btn { width: 100%; }
  .cells { justify-content: center; }
  .cell { width: 46px; }
  .cue { display: none; }
  .split { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 14px; align-items: stretch; }
  .words { gap: 12px; text-align: center; justify-items: center; }
  .week-stage h2 { font-size: 26px; max-width: none; }
  .chapter { justify-items: center; gap: 4px; }
  .chapter h3 { font-size: 24px; }
  .chapter p { font-size: 15px; line-height: 1.45; max-width: 30em; }
  .bar { gap: 0; padding: 5px; }
  .bar button { flex-direction: column; gap: 2px; min-height: 48px; padding: 4px 10px; font-size: 12px; }
  .photo-card { aspect-ratio: 4 / 5; }
  .start { padding-top: 96px; padding-bottom: 80px; }
  .start .ctas { flex-direction: column; width: 100%; max-width: 360px; align-items: stretch; }
  .footer nav { margin-left: 0; }
  .section { padding-top: 104px; }
  .faq + .ridge { padding-top: 104px; }
  .lead { font-size: 17px; }
  .steps { grid-template-columns: 1fr; margin-top: 32px; }
  .step-visual { height: 76px; }
  .leaders .frame { grid-template-columns: 1fr; gap: 48px; justify-items: center; }
  .leaders .frame > div:first-child { justify-self: stretch; }
  .points li { font-size: 17px; }
  .phone.static { height: 500px; }
  .facts { grid-template-columns: 1fr; padding: 24px; gap: 22px; }
  .feature-list { grid-template-columns: 1fr; gap: 24px; }
  .faq details { padding: 6px 18px; }
  .faq summary { font-size: 17px; min-height: 48px; }
}
/* Too short to pin: everything flows, and the ring fills by itself once it's on screen */
@media (max-height: 620px) {
  .ring-stage, .week-stage { height: auto; }
  .ring-sticky, .week-sticky { position: relative; height: auto; }
  .ring-sticky { padding-block: calc(var(--nav-h) + 24px) 32px; }
  .ring { width: min(420px, 88vw); }
  .phone { height: 520px; }
  .cue { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .cell, .cue, .nav-cta, .chapter, .chapter.on, .bar button, .faq summary svg { transition: none; }
}
