/* top1habits.com home. The app's own paper, ink, green and fonts; no outside fonts or scripts. */
@font-face { font-family: "Poppins"; src: url("fonts/poppins-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #FAF7F0;        /* the app's paper */
  --surface: #F1ECE1;   /* one step darker */
  --sand: #ECE6DA;
  --ink: #1A1A1A;
  --muted: #5F584D;     /* secondary notes only */
  --accent: #2E9E5B;    /* the app's green: the action */
  --accent-ink: #1F7A44;
  --orange: #DF7128;
  --indigo: #4B5BD6;
  --teal: #1A9C9C;

  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --t-display: clamp(46px, 6.4vw, 104px);
  --t-1: clamp(40px, 5.6vw, 92px);
  --t-2: clamp(24px, 2.4vw, 36px);
  --t-lead: 20px;
  --t-body: 18px;
  --t-ui: 16px;
  --t-small: 14px;

  --gutter: clamp(16px, 3.4vw, 48px);
  --gap: clamp(112px, 13vw, 200px);
  --radius: 12px;
  --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(--ink); font-family: var(--font); font-size: var(--t-body); line-height: 1.55; overflow-x: hidden; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- Bar: wordmark, three links, one action. */
.bar { display: flex; align-items: center; gap: 28px; padding: 20px var(--gutter); }
.wordmark { font-weight: 800; font-size: var(--t-body); letter-spacing: -0.02em; text-decoration: none; margin-right: auto; }
.bar-links { display: flex; gap: 24px; font-size: var(--t-ui); }
.bar-links a { text-decoration: none; }
.bar-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.bar-soon { font-size: var(--t-small); font-weight: 700; text-decoration: none; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; transition: transform 160ms var(--ease); }
.bar-soon:hover { transform: translateY(-1px); }
.bar-soon:active { transform: translateY(1px); }
@media (max-width: 720px) { .bar-links { display: none; } }

/* ---- Hero: the habit in the headline steps up and ticks. */
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(32px, 5vw, 80px); align-items: center; padding: clamp(24px, 5vw, 64px) var(--gutter) 0; min-height: calc(100svh - 76px); }
.hero-title { font-size: var(--t-display); font-weight: 800; line-height: 1.0; letter-spacing: -0.045em; }
.hero-title.long { font-size: calc(var(--t-display) * 0.82); }
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-title .li { display: inline-flex; align-items: center; white-space: nowrap; }
.tick { flex: none; width: 0.86em; height: 0.86em; margin-right: 0.2em; padding: 0; border: 0; background: none; cursor: pointer; transform: translateY(0.04em); transition: transform 160ms var(--ease); }
.tick:hover { transform: translateY(0.04em) rotate(-4deg); }
.tick:active { transform: translateY(0.06em) scale(0.94); }
.tick svg { width: 100%; height: 100%; overflow: visible; }
.tick .box { fill: #fff; stroke: var(--ink); stroke-width: 3.4; stroke-linejoin: round; transition: fill 220ms var(--ease); }
.tick .mark { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; transition: stroke-dashoffset 280ms var(--ease); }
.tick[aria-pressed="true"] .box { fill: var(--orange); }
.tick[aria-pressed="true"] .mark { stroke-dashoffset: 0; }
#size.swap { animation: swap 420ms var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(0.3em); } to { opacity: 1; transform: none; } }

.steps { display: flex; align-items: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.chip { min-height: 48px; padding: 0 20px; border: 3px solid var(--ink); border-radius: 999px; background: #fff; font-weight: 700; font-size: var(--t-ui); cursor: pointer; transition: transform 140ms var(--ease), background 140ms; }
.chip:hover:not(:disabled) { transform: translateY(-2px); }
.chip:active:not(:disabled) { transform: translateY(1px); }
.chip:disabled { opacity: 0.4; cursor: default; }
.chip-up { background: var(--ink); color: var(--bg); }
.readout { font-size: var(--t-small); color: var(--muted); padding: 0 4px; }
.readout b { color: var(--ink); }

.lede { max-width: 34ch; margin-top: 28px; font-size: var(--t-lead); }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 32px; flex-wrap: wrap; }
.soon { display: inline-flex; align-items: center; min-height: 56px; padding: 0 26px; background: var(--ink); color: var(--bg); border-radius: 999px; font-weight: 700; font-size: var(--t-ui); text-decoration: none; transition: transform 160ms var(--ease); }
.soon:hover { transform: translateY(-2px); }
.soon:active { transform: translateY(1px); }
.soon-green { background: var(--accent); color: #fff; }
.more { font-weight: 700; font-size: var(--t-ui); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.more:hover { color: var(--accent-ink); }

.hero-phone { position: relative; margin: 0; justify-self: center; width: min(100%, 360px); }
.screen { width: 100%; height: auto; aspect-ratio: 390 / 844; border-radius: 9% / 4.2%; background: var(--surface); object-fit: cover; }
.hero-phone figcaption { margin-top: 14px; font-size: var(--t-small); color: var(--muted); max-width: 30ch; }
.hero-percy { position: absolute; left: -96px; bottom: 64px; width: 110px; height: auto; }
@media (max-width: 1100px) { .hero-percy { display: none; } }

/* ---- Why: the problem stays put while its proof passes beside it. */
.why { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 64px); padding: 72px var(--gutter) 0; }
.why-pin { position: sticky; top: 0; height: 80svh; display: flex; align-items: center; z-index: 1; }
.statement { font-size: clamp(24px, 2.2vw, 32px); line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; max-width: 36ch; }
.why-proof { display: flex; flex-direction: column; gap: 10svh; padding: 6svh 0 12svh; }
.old { margin: 0; width: min(92%, 480px); }
.old-card { background: var(--sand); border-radius: var(--radius); padding: 28px 28px 30px; }
.old-label { font-size: var(--t-ui); font-weight: 700; color: var(--muted); }
.old-num { font-size: clamp(56px, 7vw, 96px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; margin-top: 6px; }
.old-note { margin-top: 14px; font-size: var(--t-ui); }
.old figcaption, .why-shot figcaption { margin-top: 12px; font-size: var(--t-small); color: var(--muted); }
.why-percy { width: 170px; height: auto; align-self: flex-end; margin-right: 10%; }
.why-shot { margin: 0; width: min(64%, 360px); align-self: center; }

/* ---- How: one habit's four sizes as one bar, widths from their real minutes. */
.how { padding: var(--gap) var(--gutter) 0; }
.how h2 { font-size: var(--t-1); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin-bottom: 64px; }
.ladder { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.seg { display: flex; flex-direction: column; min-width: 12%; }
.seg-1 { flex: 2 1 0; } .seg-2 { flex: 10 1 0; } .seg-3 { flex: 20 1 0; } .seg-4 { flex: 30 1 0; }
.seg .dur { display: block; height: 22vh; min-height: 150px; padding: 20px; border-radius: 6px; color: #fff; font-weight: 800; font-size: var(--t-2); letter-spacing: -0.02em; line-height: 1.1; }
.seg-1 .dur { background: var(--orange); }
.seg-2 .dur { background: var(--teal); }
.seg-3 .dur { background: var(--indigo); }
.seg-4 .dur { background: var(--accent); }
.seg p { margin-top: 18px; font-size: var(--t-ui); max-width: 22ch; padding-right: 8px; }

/* ---- Try: the heading is an input; its answer is the app's real starter habits. */
.try { padding: var(--gap) var(--gutter) 0; min-height: 88svh; display: flex; flex-direction: column; }
.try-label { font-size: var(--t-body); font-weight: 700; }
.try-input { margin-top: 10px; width: 100%; border: 0; padding: 0; background: none; font: inherit; font-size: clamp(40px, 7vw, 120px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; color: var(--ink); caret-color: var(--accent); outline: none; text-overflow: ellipsis; }
.try-input:focus-visible { outline: 3px solid var(--accent); outline-offset: 10px; border-radius: 6px; }
.try-answer { margin-top: 40px; max-width: 760px; }
.try-area { font-size: var(--t-body); font-weight: 700; }
.try-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.try-list li { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 18px 20px; }
.try-habit { font-weight: 800; font-size: var(--t-lead); letter-spacing: -0.01em; }
.try-cue { font-size: var(--t-small); color: var(--muted); }
.try-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.try-sizes span { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--surface); }
.try-sizes span.now { background: var(--ink); color: var(--bg); font-weight: 700; }
.try-examples { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.try-examples button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--sand); font-weight: 700; font-size: var(--t-ui); cursor: pointer; transition: transform 140ms var(--ease), background 140ms; }
.try-examples button:hover { background: var(--surface); transform: translateY(-2px); }
.try-examples button:active { transform: translateY(1px); }

/* ---- Features: rows hang from one axis; each carries a real screen at its own size. */
.features { padding: var(--gap) var(--gutter) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.features-title { grid-column: 5 / 13; font-size: var(--t-1); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.row { grid-column: 5 / 13; display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; margin-top: 96px; }
.row-text { max-width: 34ch; }
.row h3 { font-size: var(--t-2); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.row p { margin-top: 14px; }
.row-pic { flex: none; height: auto; object-fit: cover; object-position: top; border-radius: 16px; background: var(--surface); }
.pic-a { width: 300px; aspect-ratio: 4 / 5; }
.pic-b { width: 380px; aspect-ratio: 3 / 4; object-position: 0 46%; }
.pic-c { width: 320px; aspect-ratio: 1 / 1; }
.pic-d { width: 270px; aspect-ratio: 4 / 5; }
.pic-e { width: 340px; aspect-ratio: 3 / 4; object-position: 0 32%; }

/* ---- FAQ: big questions, open answers beside them. */
.faq { margin-top: var(--gap); padding: clamp(72px, 8vw, 120px) var(--gutter); background: var(--surface); }
.qa { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; margin-top: 80px; scroll-margin-top: 24px; }
.qa-head { margin-top: 0; }
.q { grid-column: 1 / 7; font-size: var(--t-2); font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; }
.qa-head .q { color: var(--muted); }
.a { grid-column: 8 / 13; max-width: 40ch; font-size: var(--t-body); padding-top: 0.35em; }
.a a { text-underline-offset: 4px; }

/* ---- Close: the colours flip. */
.close { background: var(--ink); color: var(--bg); min-height: 72svh; padding: clamp(64px, 9vw, 140px) var(--gutter) 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 64px; }
.close-title { font-size: clamp(56px, 10vw, 168px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.92; }
.close-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.close-foot p { font-size: var(--t-lead); max-width: 30ch; }

/* ---- Footer: an invitation, then the name, cropped. */
.foot { background: var(--ink); color: var(--bg); padding: 56px var(--gutter) 0; overflow: hidden; }
.foot-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.foot-line { font-size: var(--t-2); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; max-width: 14ch; }
.foot-btn { display: inline-flex; align-items: center; min-height: 52px; margin-top: 24px; padding: 0 22px; background: var(--bg); color: var(--ink); border-radius: 999px; font-weight: 700; text-decoration: none; transition: transform 160ms var(--ease); }
.foot-btn:hover { transform: translateY(-2px); }
.foot-links { display: flex; flex-direction: column; gap: 10px; font-size: var(--t-ui); }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot-legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 64px; font-size: var(--t-small); color: #CFC8BA; }
.foot-name { font-size: 15.5vw; font-weight: 800; letter-spacing: -0.06em; line-height: 0.8; white-space: nowrap; transform: translateY(18%); margin-top: 12px; }

/* ---- Motion: the headline's lines rise from behind their baselines; sections rise in once. */
@media (prefers-reduced-motion: no-preference) {
  .hero-title .li { animation: line 900ms var(--ease) both; }
  .hero-title .line + .line .li { animation-delay: 110ms; }
  .steps, .lede, .hero-actions { animation: fade 700ms var(--ease) 520ms both; }
  .hero-phone { animation: fade 900ms var(--ease) 380ms both; }
  .rise { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
  .rise.in { opacity: 1; transform: none; }
}
@keyframes line { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---- Phone. */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 16px; gap: 48px; }
  .hero-title { font-size: clamp(38px, 11.4vw, 64px); }
  .hero-title.long { font-size: clamp(32px, 9.2vw, 54px); }
  .hero-phone { width: min(78%, 320px); }
  .why { grid-template-columns: 1fr; }
  .why-pin { height: auto; position: static; padding: 0; }
  .statement { font-size: 24px; }
  .why-proof { gap: 72px; padding: 32px 0 0; }
  .old { width: 86%; }
  .why-shot { width: 64%; align-self: flex-start; }
  .ladder { flex-direction: column; }
  .seg { min-width: 0; flex: none !important; }
  .seg .dur { height: auto; padding: 16px 18px; }
  .seg-1 .dur { min-height: 72px; } .seg-2 .dur { min-height: 110px; } .seg-3 .dur { min-height: 170px; } .seg-4 .dur { min-height: 230px; }
  .seg p { margin: 10px 0 18px; max-width: none; }
  .how h2 { margin-bottom: 36px; font-size: clamp(38px, 11vw, 64px); }
  .try { min-height: 0; }
  .try-input { font-size: 11vw; }
  .features { display: block; }
  .features-title { min-height: 0; margin-bottom: 8px; font-size: clamp(38px, 11vw, 64px); }
  .row { flex-direction: column; margin-top: 72px; gap: 20px; }
  .row-pic { width: 100%; }
  .pic-a { width: 100%; } .pic-b { width: 78%; align-self: flex-end; } .pic-c { width: 70%; } .pic-d { width: 64%; align-self: flex-end; } .pic-e { width: 86%; }
  .qa { display: block; margin-top: 56px; }
  .a { margin-top: 12px; padding-top: 0; }
  .close { min-height: 0; gap: 72px; }
  .close-title { font-size: clamp(52px, 15vw, 96px); }
  .close-foot { flex-direction: column; align-items: stretch; }
  .close-foot .soon { justify-content: center; }
  .foot { padding-top: 88px; }
  .foot-links { flex-direction: row; gap: 20px; }
  .foot-name { font-size: 22vw; }
}
