/* EARNED – the website speaks the app's language: OLED black stage, graphite surfaces, chalk type.
   Colour only where it means something (recovery / weight zones), exactly like in the app. */
:root {
  --black: #000; --graphite: #141518; --steel: #24252a; --iron: #3a3c42; --fog: #8e9097; --chalk: #ececee;
  --go: #46c97a; --wait: #e8a23a; --stop: #e5534b;
  --display: "Archivo Variable", "Archivo", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --script: "Satisfy", "Segoe Script", "Brush Script MT", cursive;
  --body: "Archivo Variable", "Archivo", -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1180px; --ease: cubic-bezier(.2, .7, .15, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--black); color: var(--chalk); font: 400 17px/1.6 var(--body); font-stretch: 100%; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--chalk); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(100% - 48px, var(--max)); margin-inline: auto; }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0 0 18px; font-family: var(--display); color: var(--chalk); }
h1, h2 { font-family: var(--script); font-weight: 400; font-stretch: normal; letter-spacing: 0; }
h1 { font-size: clamp(54px, 7.6vw, 124px); line-height: 1.02; padding-bottom: .06em; }
h2 { font-size: clamp(40px, 5vw, 76px); line-height: 1.05; padding-bottom: .05em; }
h3 { font-size: 22px; font-weight: 700; font-stretch: 85%; line-height: 1.2; }
p { margin: 0 0 16px; max-width: 62ch; }
.lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--fog); line-height: 1.55; }
.muted { color: var(--fog); } .small { font-size: 15px; } .tiny { font-size: 13px; color: var(--fog); }

/* ---------- header / footer ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(0,0,0,.82); backdrop-filter: saturate(140%) blur(12px); }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 24px; letter-spacing: .02em; text-decoration: none; }
.nav { display: flex; gap: 26px; margin-left: auto; font-size: 15px; }
.nav a { text-decoration: none; color: var(--fog); transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--chalk); }
.foot { margin-top: 140px; padding: 44px 0 56px; border-top: 1px solid var(--steel); color: var(--fog); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 18px 32px; justify-content: space-between; align-items: baseline; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; } .foot a { text-decoration: none; } .foot a:hover { color: var(--chalk); }

/* ---------- buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: 999px;
  border: 1px solid var(--iron); background: transparent; color: var(--chalk); font: 600 16px var(--body); text-decoration: none; cursor: pointer; transition: border-color .2s, background .2s; }
.btn:hover { border-color: var(--fog); }
.btn.primary { background: var(--chalk); color: var(--black); border-color: var(--chalk); }
.btn.primary:hover { background: #fff; }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn.danger { color: var(--stop); } .btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.store { text-align: left; line-height: 1.1; } .store small { display: block; font-size: 11px; font-weight: 500; opacity: .7; }

/* ---------- the stage: text left, the phone stays and changes screens (scrolling = the user's action) ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 64px; align-items: start; }
.stage-text > * { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; }
.stage-text .intro { min-height: calc(100vh - 68px); padding-bottom: 8vh; }
.chapter { opacity: .32; transition: opacity .6s var(--ease); }
.chapter.on { opacity: 1; }
.chapter h2 { margin-bottom: 22px; }
.chapter p { color: var(--fog); font-size: 19px; }
.chapter .facts { list-style: none; padding: 0; margin: 10px 0 0; color: var(--chalk); font-size: 16px; }
.chapter .facts li { padding: 10px 0; border-top: 1px solid var(--steel); max-width: 46ch; }
.stage-phone { position: sticky; top: calc(50vh - 320px); height: 640px; display: grid; place-items: center; }

.phone { position: relative; width: 320px; height: 620px; border-radius: 52px; background: var(--black);
  box-shadow: 0 0 0 9px #0d0d0f, 0 0 0 10px var(--iron), 0 50px 120px -40px rgba(255,255,255,.08); overflow: hidden; }
.phone::before { content: ""; position: absolute; top: 12px; left: 50%; width: 92px; height: 26px; margin-left: -46px; border-radius: 20px; background: #000; z-index: 3; box-shadow: 0 0 0 1px #111; }
.screen { position: absolute; inset: 0; padding: 56px 18px 22px; display: flex; flex-direction: column; gap: 12px;
  opacity: 0; transform: translateY(14px) scale(.985); transition: opacity .55s var(--ease), transform .55s var(--ease); pointer-events: none; }
.screen.on { opacity: 1; transform: none; }
.ui-h { font-family: var(--display); font-stretch: 80%; font-weight: 800; font-size: 30px; line-height: 1; margin: 6px 2px 4px; }
.ui-card { background: var(--graphite); border-radius: 20px; padding: 14px; }
.ui-k { font-size: 12px; color: var(--fog); }
.ui-v { font-family: var(--display); font-stretch: 80%; font-weight: 800; font-size: 26px; line-height: 1.05; }
.ui-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ui-bar { height: 6px; border-radius: 4px; background: var(--steel); overflow: hidden; }
.ui-bar > i { display: block; height: 100%; width: 0; background: var(--chalk); border-radius: 4px; transition: width 1.1s var(--ease) .2s; }
.screen.on .ui-bar > i { width: var(--w); }

/* home: readiness ring */
.ring { width: 150px; height: 150px; margin: 6px auto 2px; }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--steel); } .ring .val { stroke: var(--chalk); stroke-linecap: round; stroke-dasharray: 402; stroke-dashoffset: 402; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1.4s var(--ease) .25s; }
.screen.on .ring .val { stroke-dashoffset: 72; }

/* training: sets get checked one after another */
.set { display: grid; grid-template-columns: 22px 1fr 1fr 44px; gap: 8px; align-items: center; }
.set .n { color: var(--fog); font-size: 13px; text-align: center; }
.set .f { height: 40px; border-radius: 12px; border: 1px solid var(--steel); display: grid; place-items: center; font-weight: 700; }
.set .ck { height: 40px; border-radius: 12px; background: var(--steel); display: grid; place-items: center; transition: background .35s; }
.set .ck svg { opacity: .35; transition: opacity .35s; }
.screen.on .set .ck { animation: tick .35s var(--ease) forwards; animation-delay: var(--d); }
.screen.on .set .ck svg { animation: tickmark .35s var(--ease) forwards; animation-delay: var(--d); }
@keyframes tick { to { background: var(--go); } } @keyframes tickmark { to { opacity: 1; } }

/* nutrition */
.plate { height: 150px; border-radius: 20px; background: var(--graphite); display: grid; place-items: center; overflow: hidden; }
.macro { display: grid; grid-template-columns: 70px 1fr 50px; gap: 10px; align-items: center; font-size: 13px; }

/* recovery: body map */
.body { width: 150px; margin: 2px auto; }
.body .m { transition: fill .6s var(--ease); fill: var(--steel); }
.screen.on .body .m { fill: var(--c); transition-delay: var(--d); }
.wk { display: flex; gap: 6px; margin-top: 10px; } .wk i { flex: 1; height: 8px; border-radius: 4px; background: var(--steel); } .wk i.done { background: var(--chalk); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }

/* progress: the weight curve draws itself */
.chart path.curve { fill: none; stroke: var(--chalk); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; transition: stroke-dashoffset 1.8s var(--ease) .2s; }
.screen.on .chart path.curve { stroke-dashoffset: 0; }
.chart .pt { fill: var(--black); stroke: var(--chalk); stroke-width: 2; opacity: 0; transition: opacity .3s; transition-delay: var(--d); }
.screen.on .chart .pt { opacity: 1; }
.chart text { fill: var(--fog); font: 600 10px var(--body); }
.cells { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--steel); padding-top: 10px; text-align: center; }
.cells div + div { border-left: 1px solid var(--steel); }
.cells b { display: block; font-size: 16px; }
.plus { width: 34px; height: 34px; border-radius: 50%; background: var(--chalk); color: var(--black); display: grid; place-items: center; font-size: 22px; font-weight: 700; line-height: 1; } .cells span { font-size: 11px; color: var(--fog); }

/* ---------- studios band ---------- */
.band { padding-top: 120px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 64px; align-items: center; }
.panel { background: var(--graphite); border-radius: 28px; padding: 26px; }
.course { display: grid; grid-template-columns: 104px 1fr auto; gap: 14px; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--steel); }
.course:first-of-type { border-top: 0; }
.course time { font-family: var(--display); font-stretch: 80%; font-weight: 800; font-size: 22px; }
.course small { color: var(--fog); }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 110px; margin-top: 18px; }
.bars i { flex: 1; height: 4px; border-radius: 4px 4px 2px 2px; background: var(--iron); transition: height .9s var(--ease); }
.bars i.now { background: var(--chalk); }
.in .bars i { height: var(--h); }
.in .bars i:nth-child(n) { transition-delay: calc(var(--i) * 30ms); }

/* ---------- download ---------- */
.download { padding-top: 140px; }
.download h2 { max-width: 12ch; }

/* ---------- studios page ---------- */
.steps { list-style: none; padding: 0; margin: 40px 0 0; counter-reset: s; display: grid; gap: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 90px 1fr; gap: 24px; padding: 30px 0; border-top: 1px solid var(--steel); }
.steps li::before { content: counter(s); font-family: var(--display); font-stretch: 70%; font-weight: 800; font-size: 64px; line-height: .8; color: var(--iron); }
.steps h3 { margin-bottom: 6px; }
.deflist { margin: 40px 0 0; display: grid; grid-template-columns: 220px 1fr; gap: 0 32px; }
.deflist dt, .deflist dd { margin: 0; padding: 18px 0; border-top: 1px solid var(--steel); }
.deflist dt { font-weight: 700; } .deflist dd { color: var(--fog); }

/* ---------- legal ---------- */
.legal { padding: 72px 0 0; max-width: 760px; }
.legal h1 { font-size: clamp(48px, 7vw, 88px); }
.legal h2 { font-size: 24px; font-stretch: 85%; margin-top: 44px; line-height: 1.2; }
.legal h3 { font-size: 18px; margin-top: 26px; }
.legal ul { padding-left: 20px; margin: 0 0 16px; max-width: 62ch; } .legal li { margin-bottom: 6px; }
.legal address { font-style: normal; }
mark.ph { background: #3b2c05; color: #ffcf6e; border-radius: 4px; padding: 0 4px; font-weight: 600; }

/* ---------- account area ---------- */
label { display: block; font-size: 14px; color: var(--fog); margin: 0 0 6px; }
input, select, textarea { width: 100%; background: var(--graphite); color: var(--chalk); border: 1px solid var(--steel); border-radius: 14px; padding: 13px 14px; font: 16px var(--body); }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fog); }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; } .row > * { flex: 1 1 160px; }
.note { border: 1px solid var(--steel); background: var(--graphite); border-radius: 14px; padding: 13px 16px; font-size: 15px; color: var(--fog); }
.note.ok { border-color: #1f4d33; color: #93e2b3; } .note.bad { border-color: #5a2422; color: #f2a29d; }
.auth { max-width: 440px; margin: 80px auto 0; }
.auth h1 { font-size: clamp(48px, 7vw, 76px); }
.dash { padding-top: 44px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; justify-content: space-between; margin-bottom: 26px; }
.dash-head h1 { font-size: clamp(40px, 6vw, 64px); margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--steel); margin-bottom: 26px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--fog); padding: 12px 14px; font: 600 15px var(--body); cursor: pointer; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--chalk); border-bottom-color: var(--chalk); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--graphite); border-radius: 22px; padding: 22px; }
.list { border-radius: 22px; overflow: hidden; background: var(--graphite); }
.item { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-top: 1px solid var(--steel); }
.item:first-child { border-top: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.unread .title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--chalk); margin-right: 9px; vertical-align: middle; }
.item.click { cursor: pointer; } .item.click:hover { background: var(--steel); }
.thumb { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; background: var(--steel); flex: none; }
.stat { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 44px; line-height: 1; }
.pill { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--iron); color: var(--fog); }
.pill.ok { color: var(--go); border-color: #1f4d33; } .pill.warn { color: var(--wait); border-color: #5a4313; }
.mailview { background: var(--graphite); border-radius: 22px; padding: 22px; }
.mailview pre { white-space: pre-wrap; font: 16px/1.6 var(--body); margin: 16px 0 0; }
.mailview iframe { width: 100%; min-height: 440px; border: 0; background: #fff; border-radius: 12px; margin-top: 16px; }
.hidden { display: none !important; }

/* ---------- small screens: phone stays on top, text scrolls below it ---------- */
@media (max-width: 920px) {
  .stage { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .stage-text { display: contents; }
  .stage-text .intro { order: 0; min-height: auto; padding: 40px 0 28px; justify-content: flex-start; }
  .stage-phone { order: 1; position: sticky; top: 68px; height: 410px; z-index: 5; background: var(--black); overflow: hidden; display: block; margin-inline: -24px; }
  .phone { transform: scale(.62); transform-origin: top center; margin: 8px auto 0; }
  .stage-text .chapter:not(.intro) { order: 2; min-height: 74vh; justify-content: center; padding: 28px 0; }
  .band { grid-template-columns: 1fr; gap: 36px; }
  .deflist { grid-template-columns: 1fr; } .deflist dd { border-top: 0; padding-top: 0; }
  .nav { gap: 16px; } .nav a.optional { display: none; }
  .top { background: var(--black); backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .screen.on .set .ck { background: var(--go); } .screen.on .set .ck svg { opacity: 1; }
}

/* ---------- live preview: the real app in a phone frame ---------- */
.live { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 64px; align-items: center; min-height: calc(100vh - 68px); padding: 40px 0; }
.live-text h1 { font-size: clamp(50px, 7.4vw, 116px); }
.device { --s: .82; width: calc(390px * var(--s)); height: calc(844px * var(--s)); border-radius: calc(54px * var(--s)); background: #000;
  box-shadow: 0 0 0 9px #0d0d0f, 0 0 0 10px var(--iron), 0 60px 140px -50px rgba(255,255,255,.1); overflow: hidden; position: relative; }
.device iframe { position: absolute; top: 0; left: 0; width: 390px; height: 844px; border: 0; transform: scale(var(--s)); transform-origin: top left; background: #000; }
.live-big .device { --s: .9; }
.tips { list-style: none; padding: 0; margin: 8px 0 0; } .tips li { padding: 12px 0; border-top: 1px solid var(--steel); max-width: 52ch; }
.try { padding-top: 60px; }
.shop { margin-top: 36px; border-top: 1px solid var(--steel); }
.shop-item { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; padding: 26px 0; border-bottom: 1px solid var(--steel); }
.shop-item h3 { font-size: 28px; font-stretch: 80%; margin-bottom: 6px; }
.faq details { border-top: 1px solid var(--steel); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid var(--steel); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 19px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary { margin-bottom: 10px; }
.faq p { color: var(--fog); margin: 0; }
@media (max-width: 920px) {
  .live { grid-template-columns: 1fr; gap: 32px; min-height: auto; padding: 32px 0 0; }
  .device { --s: .78; margin: 0 auto; }
  .live-big .device { --s: .78; }
}

/* ---------- motion: headlines write themselves, sections glide in, the phone rises and floats ---------- */
.write { clip-path: inset(-25% 100% -25% 0); transition: clip-path 1.5s cubic-bezier(.6,.05,.25,1); }
.write.in { clip-path: inset(-25% -2% -25% 0); }
.fade { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.fade.in { opacity: 1; transform: none; }
.device { animation: rise 1.1s var(--ease) .15s both; }
@media (hover: hover) and (min-width: 921px) {
  .device { animation: rise 1.1s var(--ease) .15s both, drift 7s ease-in-out 1.4s infinite alternate; }
  .device:hover, .device:focus-within { animation-play-state: running, paused; }   /* stands still while you use the app */
}
@keyframes rise { from { opacity: 0; transform: translateY(48px) scale(.96); } }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-10px); } }
.btn { transition: border-color .2s, background .2s, transform .25s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.nav a { position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.deflist dt, .shop-item, .faq details, .tips li { transition: background .25s; }
@media (prefers-reduced-motion: reduce) {
  .write, .fade { clip-path: none !important; opacity: 1 !important; transform: none !important; }
  .device { animation: none !important; }
}
