/* FitDailo website, dark and scroll-driven. Brand colours are the app icon's: sunflower, rose, cream on black. */
@font-face {
  font-family: "Barlow Condensed";
  src: url("/assets/BarlowCondensed-ExtraBoldItalic.ttf") format("truetype");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000;
  --tile: #151516;
  --text: #f5f5f7;
  --dim: #a1a1a6;
  --line: #2c2c2e;
  --track: #48484c;
  --idle: #1c1c1e;
  --sun: #ffc93f;
  --rose: #ff7a8a;
  --rose-tint: rgba(255, 122, 138, 0.22);
  --ink: #111;
  --gutter: 22px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", system-ui, sans-serif;
  --numeral: "Barlow Condensed", "Arial Narrow", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
:lang(zh-Hant) body { line-height: 1.75; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--sun); outline-offset: 4px; border-radius: 6px; }
::selection { background: var(--sun); color: var(--ink); }

[id] { scroll-margin-top: 52px; }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.grad { background: linear-gradient(92deg, var(--sun) 8%, #ffa765 52%, var(--rose) 96%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Bar across the top */
.bar { position: fixed; inset: 0 0 auto 0; z-index: 20; background: rgba(0, 0, 0, 0.72); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; display: block; }
.brand span { font: italic 800 25px/1 var(--numeral); }
.bar nav { display: flex; align-items: center; gap: 26px; font-size: 13.5px; }
.bar nav a { text-decoration: none; color: var(--dim); transition: color 0.2s; }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--text); }
.langs { display: inline-flex; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 99px; padding: 2px; }
.bar nav .langs a { padding: 3px 11px; border-radius: 99px; font-size: 12.5px; color: var(--dim); }
.bar nav .langs a[aria-current] { background: var(--text); color: #000; font-weight: 600; }

/* Opening: one photograph. On a wide screen she runs on the right and the sentence sits on the left;
   on a phone she is above and the sentence below. */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }
.hero-photo { position: absolute; top: 0; left: 0; width: 138%; max-width: none; height: 100%; object-fit: cover; object-position: 50% 37%; transform: scale(calc(1.06 - var(--hp, 0) * 0.06)); transform-origin: 46% 40%; animation: settle 2.4s var(--ease) both; }
@keyframes settle { from { opacity: 0; scale: 1.07; } to { opacity: 1; scale: 1; } }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, 0.7) 84%, #000 100%), linear-gradient(90deg, rgba(0, 0, 0, 0.62) 0, rgba(0, 0, 0, 0.3) 38%, rgba(0, 0, 0, 0) 60%); }
.hero-copy { position: relative; z-index: 1; width: 100%; padding-bottom: clamp(44px, 9vh, 104px); }
.hero h1 { max-width: 11em; font-size: clamp(38px, 4.7vw, 72px); font-weight: 700; line-height: 1.05; letter-spacing: -0.022em; }
:lang(zh-Hant) .hero h1 { line-height: 1.18; letter-spacing: -0.01em; }
.hero h1 span { display: block; }
.hero .lead { max-width: 29em; margin-top: clamp(18px, 2.4vw, 26px); font-size: clamp(16px, 1.45vw, 19px); color: #e2e2e6; }
.hero .soon { margin-top: 20px; font-size: 15px; font-weight: 600; }
.hero .note { margin-top: 6px; font-size: 13px; color: #b9b9be; }

/* A phone with a real screen in it */
.phone { --w: min(310px, 70vw); position: relative; width: var(--w); flex: none; padding: calc(var(--w) * 0.028); border-radius: calc(var(--w) * 0.172); background: linear-gradient(150deg, #4a4a4d, #18181a 38%, #0c0c0d 62%, #3a3a3d); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 50px 120px rgba(0, 0, 0, 0.6); }
.phone .screen { position: relative; aspect-ratio: 780 / 1696; border-radius: calc(var(--w) * 0.146); overflow: hidden; background: #000; }
.phone .screen::after { content: ""; position: absolute; left: 50%; top: calc(var(--w) * 0.03); width: calc(var(--w) * 0.29); height: calc(var(--w) * 0.083); transform: translateX(-50%); border-radius: 99px; background: #000; }
.phone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.phone img + img { opacity: 0; }
.js .phone.swap img { opacity: 0; transition: opacity 0.55s var(--ease); }
.js .phone.swap img.on { opacity: 1; }

/* The line: pinned while the days fill in */
.timeline { position: relative; height: 380vh; }
.timeline .pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding-top: 52px; }
.timeline .pin > .wrap { width: 100%; }
.says { position: relative; min-height: clamp(190px, 30vh, 270px); text-align: center; }
.says h2 { max-width: 15em; }
.says > div { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; opacity: 0; transform: translateY(18px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.says > div.on { opacity: 1; transform: none; }
.says h2, .screens h2, .details h2, .yours h2 { font-size: clamp(31px, 5vw, 64px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
:lang(zh-Hant) .says h2, :lang(zh-Hant) .screens h2, :lang(zh-Hant) .details h2, :lang(zh-Hant) .yours h2 { line-height: 1.24; letter-spacing: -0.005em; font-size: clamp(29px, 4.6vw, 58px); }
.says p { max-width: 30em; margin-top: 14px; color: var(--dim); font-size: clamp(16px, 1.5vw, 19px); }
.count { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin-top: clamp(26px, 5vh, 56px); }
.count b { font: italic 800 clamp(84px, 13vw, 168px)/0.8 var(--numeral); min-width: 1.1em; text-align: right; }
.count span { font-size: 15px; color: var(--dim); }
.strip { display: grid; grid-template-columns: repeat(47, 1fr); gap: clamp(2px, 0.5vw, 7px); align-items: end; height: clamp(70px, 11vw, 130px); margin-top: 30px; }
.strip i { display: block; position: relative; height: 76%; border-radius: 99px; background: var(--track); transition: background-color 0.25s, height 0.3s var(--ease), box-shadow 0.25s, opacity 0.25s; }
.strip .p { background: var(--rose); }
.strip .a { background: var(--idle); }
.strip .w { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rose); }
.strip .w.m { background: var(--rose-tint); }
.strip .t { background: var(--text); height: 100%; }
.strip .d::before { content: ""; position: absolute; left: 50%; top: -13px; width: min(100%, 8px); aspect-ratio: 1; border-radius: 50%; background: var(--sun); transform: translateX(-50%) scale(1); transition: transform 0.35s var(--ease); }
/* With the script running, the days are switched on as the page scrolls */
.js .strip i:not(.on) { background: var(--idle); height: 76%; }
.js .strip i:not(.on).d::before { transform: translateX(-50%) scale(0); }
.js .strip i.on.today { background: var(--text); height: 100%; }
.js .strip i.on:not(.today).t { background: var(--track); height: 76%; }
.js .strip .w { box-shadow: inset 0 0 0 1.5px transparent; background: var(--idle); }
.js .strip .w.show { box-shadow: inset 0 0 0 1.5px var(--rose); background: transparent; }
.js .strip .w.m { background: var(--idle); }
.js .strip .w.m.show { background: transparent; }
.js .likely .strip .w.m.show { background: var(--rose-tint); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-top: 26px; font-size: 13.5px; color: var(--dim); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend li::before { content: ""; width: 7px; height: 18px; border-radius: 99px; background: var(--track); }
.legend .p::before { background: var(--rose); }
.legend .d::before { width: 8px; height: 8px; background: var(--sun); }
.legend .t::before { background: var(--text); }
.legend .w::before { background: var(--rose-tint); box-shadow: inset 0 0 0 1.5px var(--rose); }

/* Screens: the words scroll, the phone stays and changes */
.screens { padding-block: clamp(40px, 8vw, 96px); }
.screens .cols { display: grid; grid-template-columns: 1fr minmax(0, 420px); column-gap: 48px; }
.step { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; }
.step p { max-width: 24em; margin-top: 18px; color: var(--dim); font-size: clamp(17px, 1.5vw, 20px); }
.step .phone { display: none; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; justify-content: center; }
.stage .phone { --w: min(330px, 34vh, 30vw); }

/* Two charts, side by side */
.connect { padding-block: clamp(72px, 11vw, 140px) clamp(48px, 7vw, 88px); text-align: center; }
.connect h2, .news h2 { font-size: clamp(31px, 5vw, 64px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
:lang(zh-Hant) .connect h2, :lang(zh-Hant) .news h2 { line-height: 1.24; letter-spacing: -0.005em; font-size: clamp(29px, 4.6vw, 58px); }
.connect .sub { max-width: 34em; margin: 18px auto 0; color: var(--dim); font-size: clamp(16px, 1.5vw, 19px); }
.pair { display: flex; justify-content: center; align-items: flex-start; gap: clamp(18px, 5vw, 72px); margin-top: clamp(40px, 6vw, 72px); }
.pair figure + figure { margin-top: clamp(28px, 5vw, 72px); }
.pair .phone { --w: min(300px, 40vw); }
.pair figcaption { margin-top: 18px; font-size: 15px; color: var(--dim); }

/* Details */
.details { padding-block: clamp(64px, 10vw, 128px); }
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: clamp(30px, 5vw, 56px); }
.tile { grid-column: span 2; background: var(--tile); border-radius: 28px; padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; justify-content: flex-end; min-height: 250px; }
.tile.wide { grid-column: span 3; }
.tile b { font: italic 800 clamp(72px, 9vw, 116px)/0.86 var(--numeral); display: flex; align-items: baseline; gap: 8px; }
.tile b small { font: 600 17px/1 var(--sans); color: var(--dim); }
.tile h3 { font-size: clamp(25px, 3vw, 36px); font-weight: 700; line-height: 1.14; letter-spacing: -0.015em; }
:lang(zh-Hant) .tile h3 { line-height: 1.3; letter-spacing: 0; }
.tile p { margin-top: 14px; color: var(--dim); font-size: 16px; max-width: 24em; }
.tile.sun b { color: var(--sun); }
.tile.rose b { color: var(--rose); }
.dots { display: grid; grid-template-columns: repeat(3, 15px); gap: 17px; margin-bottom: 22px; }
.dots i { width: 15px; height: 15px; border-radius: 50%; background: var(--track); }
.dots i.k { background: var(--sun); box-shadow: 0 0 0 5px rgba(255, 201, 63, 0.18); }

/* Release notes */
.news { padding-block: clamp(32px, 6vw, 72px) clamp(72px, 10vw, 128px); }
.release { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; column-gap: 32px; margin-top: clamp(28px, 4vw, 48px); padding-top: 26px; border-top: 1px solid var(--line); }
.release header b { display: block; font: italic 800 clamp(64px, 8vw, 104px)/0.86 var(--numeral); color: var(--sun); }
.release header span { display: block; margin-top: 12px; font-size: 14px; color: var(--dim); }
.release li { position: relative; padding-left: 22px; margin-bottom: 12px; font-size: clamp(16px, 1.5vw, 19px); color: #d2d2d7; }
.release li::before { content: ""; position: absolute; left: 2px; top: 0.66em; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); }
.news .more { margin-top: 22px; }
.news .more a { font-weight: 600; text-decoration-color: var(--sun); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.page.news .release:first-of-type { margin-top: 44px; }

/* What happens to the data */
.yours { background: var(--sun); color: var(--ink); padding-block: clamp(64px, 10vw, 128px); }
.yours ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; margin-top: clamp(28px, 4vw, 52px); }
.yours li { padding-block: 18px 22px; border-top: 1.5px solid var(--ink); font-size: clamp(19px, 2vw, 24px); font-weight: 600; line-height: 1.4; }
.yours p { margin-top: 28px; }
.yours a { font-weight: 600; text-underline-offset: 5px; text-decoration-thickness: 2px; }

/* Foot */
.foot { padding-block: 40px 56px; font-size: 13.5px; color: var(--dim); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot nav a { color: var(--text); text-decoration: none; }
.foot nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot p { margin-top: 22px; max-width: 46em; }

/* Privacy and support: one readable column */
.page { padding-top: clamp(104px, 14vh, 148px); padding-bottom: clamp(56px, 9vw, 112px); }
.page h1 { font-size: clamp(36px, 5.4vw, 64px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
:lang(zh-Hant) .page h1 { line-height: 1.24; letter-spacing: -0.005em; }
.page .updated { margin-top: 12px; font-size: 15px; color: var(--dim); }
.page section { max-width: 38em; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); }
.page h2 { font-size: 22px; font-weight: 700; line-height: 1.35; }
.page p, .page ul { margin-top: 12px; color: #d2d2d7; }
.page li { position: relative; padding-left: 20px; margin-top: 8px; }
.page li::before { content: ""; position: absolute; left: 2px; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }
.page .path { font-weight: 600; color: var(--text); }
.page a { text-decoration-color: var(--sun); text-underline-offset: 4px; }

/* Things that come in once, when they are first seen */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .bar nav .sec { display: none; }
  .hero { text-align: center; }
  .hero-photo { width: 100%; object-position: 45% 30%; }
  .hero::after { background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0) 16%, rgba(0, 0, 0, 0) 44%, rgba(0, 0, 0, 0.72) 68%, #000 100%); }
  .hero h1, .hero .lead { max-width: none; margin-inline: auto; }
  .screens .cols { display: block; }
  .stage { display: none; }
  .step { min-height: 0; padding-block: 44px; }
  .step .phone { display: block; --w: min(280px, 72vw); margin-top: 32px; }
  .tiles { grid-template-columns: 1fr; }
  .tile, .tile.wide { grid-column: auto; min-height: 200px; }
  .yours ul { grid-template-columns: 1fr; }
  .timeline { height: 340vh; }
  .pair .phone { --w: 42vw; }
  .release { display: block; }
  .release header { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
  .release header span { margin: 0 0 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero-photo { transform: none; animation: none; }
  .strip i, .strip .d::before, .says > div, .js .phone.swap img { transition: none; }
}
