/* BJJ Timer website. Colours, type and shapes follow the app (mobile/src/theme.ts). */

:root {
  --bg: #0c0c10;
  --surface: #17171d;
  --surface-high: #26262f;
  --border: #2c2c36;
  --text: #ffffff;
  --dim: #8e8e9a;
  --accent: #e5383b;
  --accent-dim: #3a1418;
  --accent-text: #f2a7a8;
  --prepare: #1f5fd6;
  --round: #15924a;
  --warning: #f5a70a;
  --rest: #d02a2a;
  --done: #141419;
  --header-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', Meiryo, sans-serif;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

html.running body {
  overflow: hidden;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.kicker {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lang-ja .kicker {
  letter-spacing: 0.08em;
}

.fine {
  margin: 14px 0 0;
  color: var(--dim);
  font-size: 14px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

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

.btn:active {
  transform: scale(0.98);
}

.btn-small {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.stores-center {
  justify-content: center;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 190px;
  height: 58px;
  padding: 0 20px 0 16px;
  border-radius: 14px;
  background: #000;
  border: 1px solid #3a3a46;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.store:hover {
  border-color: #6b6b78;
}

.store:active {
  transform: scale(0.98);
}

.store svg {
  width: 28px;
  height: 28px;
  flex: none;
  fill: currentColor;
}

.store span {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.store small {
  font-size: 11.5px;
  font-weight: 500;
  color: #d4d4dc;
  letter-spacing: 0.02em;
}

.store strong {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.is-android .store-play {
  order: -1;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(12, 12, 16, 0.72);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand img {
  border-radius: 9px;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}

.nav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--dim);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.lang-menu {
  position: relative;
}

.lang-menu summary {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu summary svg {
  width: 18px;
  height: 18px;
  color: var(--dim);
}

.lang-menu ul {
  position: absolute;
  right: 0;
  top: 46px;
  margin: 0;
  padding: 6px;
  min-width: 170px;
  list-style: none;
  background: #1c1c24;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
}

.lang-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.lang-menu a:hover {
  background: var(--surface-high);
}

.lang-menu a[aria-current] {
  color: var(--accent);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 56px 0 88px;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  pointer-events: none;
}

.glow-a {
  width: 520px;
  height: 520px;
  left: -160px;
  top: -140px;
  background: var(--prepare);
}

.glow-b {
  width: 460px;
  height: 460px;
  right: -120px;
  top: 80px;
  background: var(--round);
  opacity: 0.26;
}

.glow-c {
  width: 380px;
  height: 380px;
  left: 30%;
  bottom: -220px;
  background: var(--rest);
  opacity: 0.2;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}

.hero h1 {
  margin: 14px 0 0;
  font-size: clamp(42px, 6.2vw, 76px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.lang-ja .hero h1 {
  font-size: clamp(34px, 4.8vw, 58px);
  line-height: 1.22;
  letter-spacing: -0.01em;
}

/* Break Japanese at phrase boundaries, not in the middle of a word. */
.lang-ja h1,
.lang-ja h2,
.lang-ja h3,
.lang-ja .lead,
.lang-ja .section-lead,
.lang-ja .try-it span {
  word-break: auto-phrase;
}

.lead {
  margin: 22px 0 0;
  max-width: 34em;
  color: #c9c9d3;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
}

.hero-cta {
  display: none;
  margin-top: 26px;
}

/* ---------- timer card (the app's setup screen) ---------- */

.timer-card {
  position: relative;
  width: 100%;
  max-width: 470px;
  margin-left: auto;
  padding: 24px 20px 20px;
  border-radius: 34px;
  background: linear-gradient(180deg, #131319 0%, #0e0e13 100%);
  border: 1px solid var(--border);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* "Try it" note with a hand-drawn arrow, so the card reads as live rather than a screenshot. */
.try-it {
  position: absolute;
  top: 74px;
  right: calc(100% + 2px);
  width: 230px;
  margin: 0;
  pointer-events: none;
}

.try-it span {
  display: block;
  max-width: 200px;
  color: #ececf2;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  transform: rotate(-4deg);
  transform-origin: left bottom;
  opacity: 0;
  animation: try-fade 0.5s 0.35s ease-out forwards;
}

.try-arrow {
  display: block;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.try-arrow path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.try-arrow .try-line {
  animation: try-draw 0.8s 0.6s ease-out forwards;
}

.try-arrow .try-head {
  animation: try-draw 0.25s 1.35s ease-out forwards;
}

.try-arrow-side {
  width: 220px;
  height: 100px;
  margin-top: 4px;
}

.try-arrow-down {
  display: none;
  width: 44px;
  height: 46px;
}

@keyframes try-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes try-fade {
  to {
    opacity: 1;
  }
}

.tc-head {
  padding: 0 4px;
}

.tc-title {
  margin: 2px 0 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tc-section {
  margin: 20px 0 8px 4px;
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lang-ja .tc-section {
  letter-spacing: 0.04em;
}

.chips {
  display: flex;
  gap: 10px;
  margin: 0 -20px;
  padding: 0 20px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 11px 15px;
  border-radius: 16px;
  background: var(--surface);
  border: 1.5px solid var(--surface);
  text-align: left;
  scroll-snap-align: start;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.chip-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.chip-detail {
  margin-top: 2px;
  color: var(--dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chip[aria-pressed='true'],
.belt[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.chip[aria-pressed='true'] .chip-detail,
.belt[aria-pressed='true'] .belt-time {
  color: var(--accent-text);
}

.belts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.belt {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 9px;
  border-radius: 14px;
  background: var(--surface);
  border: 1.5px solid var(--surface);
  transition: border-color 0.12s ease, background 0.12s ease;
}

.swatch {
  position: relative;
  display: flex;
  justify-content: flex-end;
  width: 78%;
  height: 10px;
  margin-bottom: 8px;
  border-radius: 3px;
  background: var(--belt);
  border: 1px solid rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.swatch span {
  width: 34%;
  height: 100%;
  margin-right: 12%;
  background: var(--bar);
}

.belt-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.belt-time {
  color: var(--dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.rows {
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.row:last-child {
  border-bottom: 0;
}

.row-labels {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.row-label {
  font-size: 16.5px;
  font-weight: 600;
}

.row-hint {
  margin-top: 2px;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.35;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-high);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.1s ease, opacity 0.1s ease;
}

.step svg {
  width: 20px;
  height: 20px;
  fill: var(--text);
}

.step:active,
.step.held {
  background: var(--accent);
}

.step:disabled {
  opacity: 0.3;
  cursor: default;
}

.row-value {
  min-width: 64px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.switch {
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: var(--surface-high);
  transition: background 0.18s ease;
}

.switch span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease;
}

.switch[aria-checked='true'] {
  background: var(--accent);
}

.switch[aria-checked='true'] span {
  transform: translateX(20px);
}

.tc-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 16px 4px 0;
  border-top: 1px solid var(--border);
}

.total {
  display: flex;
  flex-direction: column;
}

.total-label {
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.total-value {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.start {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 60px;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.1em;
  box-shadow: 0 16px 40px -16px rgba(229, 56, 59, 0.75);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.lang-ja .start {
  letter-spacing: 0.04em;
}

.start svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.start:hover {
  filter: brightness(1.06);
}

.start:active {
  transform: scale(0.98);
}

.tc-extra {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  padding: 0 4px;
}

.share {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
}

.share svg {
  width: 17px;
  height: 17px;
}

.tc-note {
  margin: 0;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.45;
}

/* ---------- phase colours and rings ---------- */

[data-phase='prepare'] {
  --phase-bg: var(--prepare);
  --fg: #fff;
  --soft: rgba(255, 255, 255, 0.22);
}

[data-phase='round'] {
  --phase-bg: var(--round);
  --fg: #fff;
  --soft: rgba(255, 255, 255, 0.22);
}

[data-phase='warning'] {
  --phase-bg: var(--warning);
  --fg: #1e1400;
  --soft: rgba(0, 0, 0, 0.14);
}

[data-phase='rest'] {
  --phase-bg: var(--rest);
  --fg: #fff;
  --soft: rgba(255, 255, 255, 0.22);
}

[data-phase='done'] {
  --phase-bg: var(--done);
  --fg: #fff;
  --soft: rgba(255, 255, 255, 0.22);
}

.ring-wrap {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 1;
}

.ring {
  width: 100%;
  height: 100%;
}

.ring circle {
  fill: none;
  stroke-width: 4.6;
}

.ring-track {
  stroke: var(--soft);
}

.ring-bar {
  stroke: var(--fg);
  stroke-linecap: round;
  stroke-dasharray: 100 100;
}

.ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  text-align: center;
}

.run-label {
  margin: 0;
  font-size: 7.4cqi;
  font-weight: 800;
  letter-spacing: 0.24em;
  padding-left: 0.24em;
  line-height: 1.2;
}

.lang-ja .run-label {
  letter-spacing: 0.08em;
  padding-left: 0.08em;
}

.run-digits {
  margin: 0;
  font-size: 27cqi;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.run-hint {
  margin: 1.2cqi 0 0;
  max-width: 76%;
  font-size: 4.8cqi;
  font-weight: 600;
  opacity: 0.88;
  line-height: 1.25;
}

/* ---------- running timer ---------- */

.run {
  position: fixed;
  inset: 0;
  height: 100dvh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--phase-bg);
  color: var(--fg);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  transition: background 0.35s ease;
}

.run[hidden] {
  display: none;
}

.run-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--fg);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.icon-btn[hidden] {
  visibility: hidden;
  display: grid;
}

.run-round {
  margin: 0 8px;
  font-size: clamp(15px, 5.2vw, 20px);
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.run-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 0 20px 20px;
  gap: 22px;
}

.run-center {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.run-ring + .ring-text {
  pointer-events: none;
}

.run .ring-wrap {
  width: min(88vw, 52vh, 620px);
}

.run[data-status='paused'] .run-digits {
  opacity: 0.55;
}

.run-side {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--fg);
  opacity: 0.4;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.dot.done {
  background: var(--fg);
  opacity: 1;
}

.dot.active {
  opacity: 1;
  transform: scale(1.35);
}

.stats {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
}

.stat-right {
  text-align: right;
}

.stat-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.75;
}

.stat-value {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

.round-btn {
  display: grid;
  place-items: center;
  width: clamp(52px, 17vw, 68px);
  height: clamp(52px, 17vw, 68px);
  border-radius: 50%;
  background: var(--soft);
  color: var(--fg);
  transition: transform 0.12s ease;
}

.round-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.round-btn:active {
  transform: scale(0.95);
}

.round-btn-main {
  width: clamp(76px, 25vw, 96px);
  height: clamp(76px, 25vw, 96px);
  background: var(--fg);
  color: var(--phase-bg);
}

.round-btn-main svg {
  width: 38px;
  height: 38px;
}

.run[data-status='running'] .i-play,
.run[data-status='paused'] .i-pause {
  display: none;
}

.run[data-status='done'] .controls {
  display: none;
}

.done-buttons {
  display: flex;
  gap: 12px;
}

.done-buttons[hidden] {
  display: none;
}

.done-btn {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 60px;
  border-radius: 18px;
  background: var(--soft);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.done-btn svg {
  width: 22px;
  height: 22px;
}

.done-btn-main {
  background: var(--accent);
  color: #fff;
}

.sound-hint {
  position: absolute;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

@media (orientation: landscape) and (min-width: 700px) {
  .run-body {
    flex-direction: row;
    align-items: center;
    gap: 32px;
  }

  .run .ring-wrap {
    width: min(46vw, 74vh, 640px);
  }

  .run-side {
    flex: 1;
    gap: 28px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .run-body {
    flex-direction: row;
    align-items: center;
  }

  .run .ring-wrap {
    width: min(46vw, 70vh);
  }

  .run-side {
    flex: 1;
    gap: 14px;
  }

  .round-btn {
    width: 56px;
    height: 56px;
  }

  .round-btn-main {
    width: 76px;
    height: 76px;
  }
}

/* ---------- modal and toast ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.5);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 340px;
  padding: 22px;
  border-radius: 24px;
  background: #1d1d25;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
}

.modal-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.modal-text {
  margin: 6px 0 18px;
  color: var(--dim);
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-btn {
  flex: 1;
  height: 48px;
  border-radius: 14px;
  background: var(--surface-high);
  font-weight: 700;
}

.modal-btn-danger {
  color: #ff6b6b;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1200;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 15px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- sections ---------- */

.section {
  position: relative;
  padding: 96px 0;
}

.section-title {
  margin: 0;
  max-width: 18em;
  font-size: clamp(30px, 4.2vw, 50px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.lang-ja .section-title {
  line-height: 1.3;
  letter-spacing: 0;
  font-size: clamp(26px, 3.4vw, 40px);
}

.kicker + .section-title {
  margin-top: 12px;
}

.section-lead {
  margin: 18px 0 0;
  max-width: 38em;
  color: #b7b7c2;
  font-size: 18px;
}

.colors {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.phase-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 44px;
}

.phase-card {
  display: grid;
  place-items: center;
  padding: 12%;
  border-radius: 30px;
  background: var(--phase-bg);
  color: var(--fg);
  box-shadow: 0 30px 70px -40px var(--phase-bg);
}

.phase-card .ring-wrap {
  width: 100%;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.points {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.points li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 17px;
}

.points svg {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  padding: 3px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
}

.get-app .stores {
  margin-top: 30px;
}

.phones {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 600px;
}

.phone {
  margin: 0;
  width: 270px;
  padding: 9px;
  border-radius: 46px;
  background: linear-gradient(160deg, #34343e, #121217 60%);
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, 0.95), inset 0 0 0 1.5px rgba(255, 255, 255, 0.09);
}

.phone img {
  width: 100%;
  height: auto;
  border-radius: 38px;
}

.phone-back {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-88%) rotate(-7deg);
  opacity: 0.92;
}

.phone-front {
  position: absolute;
  left: 50%;
  top: 40px;
  transform: translateX(-8%) rotate(4deg);
}

.belts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 56px;
  align-items: center;
}

.phone-solo {
  justify-self: center;
}

.belt-table {
  width: 100%;
  max-width: 520px;
  margin-top: 30px;
  border-collapse: collapse;
}

.belt-table th,
.belt-table td {
  padding: 14px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.belt-table thead th {
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.belt-table tbody th {
  font-size: 18px;
  font-weight: 700;
}

.belt-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.belt-table tbody .swatch {
  width: 64px;
  margin: 0;
}

.belt-table td {
  text-align: right;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.belt-table thead th:last-child {
  text-align: right;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.feature {
  padding: 26px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-dim);
  color: var(--accent);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature h3 {
  margin: 18px 0 0;
  font-size: 20px;
  font-weight: 800;
}

.feature p {
  margin: 8px 0 0;
  color: #b7b7c2;
  font-size: 16px;
}

.faq-wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 48px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border-radius: 20px;
  background: var(--surface);
}

.faq-item summary {
  position: relative;
  padding: 20px 56px 20px 22px;
  list-style: none;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '';
  position: absolute;
  right: 22px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-right: 2.5px solid var(--dim);
  border-bottom: 2.5px solid var(--dim);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq-item h3 {
  display: inline;
  font-size: 18px;
  font-weight: 700;
}

.faq-item p {
  margin: 0;
  padding: 0 22px 22px;
  color: #b7b7c2;
}

.cta {
  text-align: center;
}

.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta-icon {
  margin-bottom: 26px;
  border-radius: 22px;
  box-shadow: 0 30px 70px -20px rgba(31, 95, 214, 0.6);
}

.cta .section-title,
.cta .section-lead {
  margin-left: auto;
  margin-right: auto;
}

/* ---------- footer ---------- */

.site-footer {
  padding: 40px 0 calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand img {
  border-radius: 10px;
}

.footer-brand p {
  margin: 0;
  color: var(--dim);
  font-size: 14px;
}

.footer-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.footer-langs a,
.footer-meta a {
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.footer-langs a:hover,
.footer-meta a:hover {
  color: var(--text);
}

.footer-meta {
  margin: 0;
  width: 100%;
  color: var(--dim);
  font-size: 13px;
}

/* ---------- language suggestion ---------- */

.lang-suggest {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 8px 8px 8px 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #1d1d25;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.85);
  font-size: 14px;
}

.lang-suggest[hidden] {
  display: none;
}

.lang-suggest p {
  margin: 0;
  color: #c9c9d3;
}

.lang-suggest a {
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.lang-suggest button {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--dim);
}

.lang-suggest button svg {
  width: 16px;
  height: 16px;
}

html.running .lang-suggest {
  display: none;
}

/* ---------- other pages ---------- */

.prose {
  max-width: 760px;
  padding-top: 48px;
  padding-bottom: 80px;
}

.prose h1 {
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

.prose h2 {
  margin: 36px 0 8px;
  font-size: 22px;
}

.prose p,
.prose li {
  color: #c9c9d3;
}

.prose .meta {
  color: var(--dim);
}

.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 64px;
  padding-bottom: 96px;
  text-align: center;
}

.not-found .phase-card {
  width: 220px;
}

.not-found h1 {
  margin: 32px 0 0;
  font-size: clamp(32px, 5vw, 48px);
}

.not-found .btn {
  margin-top: 28px;
}

/* ---------- responsive ---------- */

@media (max-width: 1020px) {
  .hero-grid,
  .app-grid,
  .belts-grid,
  .faq-wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-grid {
    gap: 40px;
  }

  .timer-card {
    margin: 0 auto;
  }

  .hero-cta {
    display: inline-flex;
  }

  /* The card sits under the copy here, so the note goes above it and points down. */
  .hero-timer {
    padding-top: 64px;
  }

  .try-it {
    top: auto;
    right: auto;
    bottom: 100%;
    left: 50%;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: max-content;
    max-width: calc(100vw - 32px);
    margin-bottom: 4px;
    transform: translateX(-62%);
  }

  .try-it span {
    max-width: 240px;
    padding-bottom: 22px;
    text-align: right;
    transform: rotate(-3deg);
    transform-origin: right bottom;
  }

  .try-arrow-side {
    display: none;
  }

  .try-arrow-down {
    display: block;
    flex: none;
  }

  .phase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .faq-wrap {
    gap: 28px;
  }
}

@media (max-width: 760px) {
  .nav {
    display: none;
  }
}

@media (max-width: 600px) {
  :root {
    --header-h: 58px;
  }

  .wrap {
    padding: 0 16px;
  }

  .brand span {
    display: none;
  }

  .hero {
    padding: 32px 0 64px;
  }

  .section {
    padding: 72px 0;
  }

  .timer-card {
    padding: 20px 14px 16px;
    border-radius: 28px;
  }

  .chips {
    margin: 0 -14px;
    padding: 0 14px 4px;
  }

  .belts {
    gap: 6px;
  }

  .row {
    padding: 10px 12px;
  }

  .row-value {
    min-width: 56px;
    font-size: 20px;
  }

  .step {
    width: 38px;
    height: 38px;
  }

  .stores {
    flex-direction: column;
    align-items: stretch;
  }

  .stores-center {
    align-items: center;
  }

  .store {
    justify-content: center;
  }

  .phase-grid {
    gap: 10px;
  }

  .phase-card {
    border-radius: 22px;
  }

  .features {
    grid-template-columns: minmax(0, 1fr);
  }

  .phones {
    min-height: 470px;
  }

  .phone {
    width: 210px;
    border-radius: 38px;
    padding: 7px;
  }

  .phone img {
    border-radius: 31px;
  }

  .lang-suggest {
    border-radius: 18px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .lang-suggest p {
    flex: 1 1 100%;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .try-it span,
  .try-arrow path {
    animation: none;
    opacity: 1;
    stroke-dashoffset: 0;
  }
}
