/* Doba's page. Colours, radii and type follow the app's design tokens
   (android/core/designsystem theme/Tokens.kt, Typography.kt, Motion.kt). */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("assets/fonts/plus-jakarta-sans.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #15131f;
  --ink-soft: #4e4b60;
  --background: #f4f3f9;
  --night: #1e1e36;
  --night-deep: #16152b;
  --night-ink: #f3f2f8;
  --night-soft: #bdbad0;
  --hub: #f29a0e;

  --radius-md: 14px;
  --radius-lg: 24px;
  --gutter: 20px;

  --decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
  --standard: cubic-bezier(0.2, 0, 0, 1);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 500 1.0625rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2 {
  font-weight: 800;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 10.5vw, 4.5rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(2rem, 7.4vw, 3.125rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus, var(--ink));
  outline-offset: 3px;
}

.defs {
  position: absolute;
}

/* ── Bands: one per place, in its tracker's tint ─────────────────────────────── */

.band {
  background: var(--tint);
  overflow: hidden;
}

.band-inner {
  display: flex;
  flex-direction: column;
}

.copy {
  width: 100%;
  max-width: 37rem;
  margin-inline: auto;
  padding: clamp(56px, 13vw, 88px) var(--gutter) 0;
}

.copy > p {
  max-width: 34rem;
  color: var(--ink-soft);
}

.money {
  --tint: #e9e5ff;
  --main: #6b4eff;
  --on-main: #ffffff;
  --on-soft: #4a30d9;
  --leaf-a: #8c72ff;
  --leaf-b: #6a48f5;
}

.water {
  --tint: #e2edff;
  --main: #1f74e0;
  --on-main: #ffffff;
  --on-soft: #1c5cc8;
  --leaf-a: #4a8dee;
  --leaf-b: #2369d9;
}

.habits {
  --tint: #e4f1e8;
  --main: #2f855a;
  --on-main: #ffffff;
  --on-soft: #1f6340;
  --leaf-a: #4dbe88;
  --leaf-b: #2e9e69;
}

/* Graphite with a lime highlight, as in the app. */
.workout {
  --tint: #eef7da;
  --main: #1e1f24;
  --on-main: #a8dc3c;
  --on-soft: #4b7a0c;
  --leaf-a: #a8da62;
  --leaf-b: #86c23a;
}

/* ── The scene of a band ─────────────────────────────────────────────────────── */

.scene {
  position: relative;
  width: 100%;
  margin-top: 36px;
}

.scene canvas {
  display: block;
  width: 100%;
  height: 384px;
}

.scene.short canvas {
  height: 268px;
}

.scene-head {
  position: absolute;
  inset: 20px 20px auto;
  pointer-events: none;
}

.over {
  color: var(--on-soft);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.figure {
  margin-top: 4px;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 2.75rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.figure .tail {
  margin-left: 6px;
  color: var(--ink-soft);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sub {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.25rem;
}

/* ── Hero: the day, at night ─────────────────────────────────────────────────── */

.hero {
  --tint: var(--night);
  --focus: var(--night-ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--night-ink);
}

.hero .band-inner {
  flex: 1;
}

.hero .copy {
  padding-top: clamp(28px, 9vw, 64px);
}

.hero .scene {
  margin-top: auto;
  padding-top: 8px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding: 14px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  text-decoration: none;
}

.mark {
  width: 40px;
  height: 40px;
  overflow: visible;
}

.word {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang,
.top-get {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--night-ink);
  font: 600 0.9375rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--standard);
}

.top-get {
  display: none;
}

.lang:hover,
.top-get:hover {
  background: rgb(255 255 255 / 0.08);
}

.lead {
  margin-top: 20px;
  color: var(--night-soft) !important;
  font-size: 1.125rem;
}

.get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 28px;
}

.fine {
  color: var(--night-soft) !important;
  font-size: 0.875rem;
}

.aside {
  margin-top: 28px;
  color: var(--night-soft) !important;
  font-size: 0.875rem;
}

/* As in the app: a place opens its tracker. */
.places a {
  position: absolute;
  left: var(--x);
  width: var(--w);
  border-radius: var(--radius-md);
  outline-offset: -4px;
}

.places .sky {
  top: 104px;
  bottom: 64px;
}

.places .ground {
  bottom: 0;
  height: 64px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-md);
  font: 700 1rem/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--standard), filter 0.2s var(--standard);
  -webkit-tap-highlight-color: transparent;
}

.button:hover {
  filter: brightness(1.08);
}

.button:active {
  transform: scale(0.97);
}

.primary {
  background: var(--hub);
  color: var(--ink);
}

.act {
  margin-top: 28px;
  background: var(--main);
  color: var(--on-main);
}

/* ── A tracker's words ───────────────────────────────────────────────────────── */

.tracker {
  --focus: var(--on-soft);
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--on-soft) !important;
  font-weight: 700;
}

.leaf {
  width: 15px;
  height: 21px;
}

.leaf-a {
  fill: var(--leaf-a);
}

.leaf-b {
  fill: var(--leaf-b);
}

.tracker h2 + p {
  margin-top: 16px;
}

.does {
  margin-top: 24px;
  max-width: 30rem;
  font-weight: 600;
}

.does li {
  padding: 11px 0;
  border-top: 1px solid rgb(21 19 31 / 0.12);
}

.does li:last-child {
  border-bottom: 1px solid rgb(21 19 31 / 0.12);
}

/* ── The rest ────────────────────────────────────────────────────────────────── */

.rest {
  background: var(--background);
}

.rest-inner {
  max-width: 1120px;
  margin-inline: auto;
  padding: clamp(64px, 14vw, 120px) var(--gutter);
}

.rest dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 28px clamp(28px, 5vw, 64px);
  margin-top: clamp(32px, 6vw, 56px);
}

.rest dt {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.rest dd {
  margin-top: 4px;
  max-width: 26rem;
  color: var(--ink-soft);
}

/* ── Download ────────────────────────────────────────────────────────────────── */

.end {
  --tint: var(--night-deep);
  --focus: var(--night-ink);
  color: var(--night-ink);
}

.end-inner {
  max-width: 1120px;
  margin-inline: auto;
  padding: clamp(64px, 14vw, 120px) var(--gutter) 56px;
}

.end h2 + p {
  max-width: 32rem;
  margin: 16px 0 28px;
  color: var(--night-soft);
}

.steps {
  display: grid;
  gap: 10px;
  max-width: 32rem;
  margin: 40px 0 32px;
  counter-reset: step;
}

.steps li {
  display: flex;
  gap: 14px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  flex: none;
  width: 1.6rem;
  color: var(--hub);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ── Wider screens ───────────────────────────────────────────────────────────── */

@media (min-width: 600px) {
  :root {
    --gutter: 32px;
  }

  .top-get {
    display: inline-flex;
  }

  /* The scene keeps a phone's width, as it is drawn for one; its land fades out at the sides. */
  .scene {
    max-width: 480px;
    margin-inline: auto;
  }

  .scene canvas {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 13%, #000 87%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 13%, #000 87%, transparent);
  }

  .scene-head {
    inset: 20px 64px auto;
  }
}

@media (min-width: 900px) {
  .band-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 480px;
    column-gap: clamp(32px, 6vw, 96px);
    align-items: end;
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  .copy {
    align-self: center;
    margin: 0;
    padding: 104px 0;
  }

  .hero .copy {
    padding: 48px 0 96px;
  }

  .scene,
  .hero .scene {
    margin: 0;
  }

  /* Every other place stands on the left. */
  .tracker:nth-of-type(even) .band-inner {
    grid-template-columns: 480px minmax(0, 1fr);
  }

  .tracker:nth-of-type(even) .scene {
    order: -1;
  }
}

/* ── Arriving ────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  /* The mark grows as in the app's welcome: the hub, then a leaf at a time, clockwise. */
  .grow,
  .hub {
    transform-origin: 0 0;
    animation: grow 0.7s var(--decelerate) both;
    animation-delay: calc(0.25s + var(--i, 0) * 0.11s);
  }

  .hub {
    animation-delay: 0.05s;
    animation-duration: 0.4s;
  }

  .word,
  .hero .copy > * {
    animation: arrive 0.7s var(--decelerate) both;
  }

  .word {
    animation-delay: 0.5s;
  }

  .hero h1 {
    animation-delay: 0.3s;
  }

  .hero .lead {
    animation-delay: 0.4s;
  }

  .hero .get {
    animation-delay: 0.5s;
  }

  .hero .aside {
    animation-delay: 0.6s;
  }
}

@keyframes grow {
  from {
    transform: scale(0);
  }
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button {
    transition: none;
  }
}
