/* ChakChak website styles
   Colors for the three block types match the app's three block modes:
   Same palette as the app (App.js): Timed = teal, Timed + tap = amber,
   Untimed = muted gray-brown. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --paper: #faf7f1;
  --surface: #ffffff;
  --ink: #2b2a26;
  --muted: #6b675d;
  --line: #e4e0d5;
  --timed: #146356;
  --confirm: #c97b2e;
  --untimed: #8c887c;
  --radius-block: 10px;
  --wrap: 1120px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hangul: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
}

a { color: var(--timed); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--timed);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(var(--wrap), 100% - 2.5rem);
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  padding-block: 1.5rem;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.wordmark-mark {
  display: inline-grid;
  grid-template-columns: 9px 15px 6px;
  gap: 2px;
  height: 18px;
}
.wordmark-mark span { border-radius: 3px; }
.wordmark-mark span:nth-child(1) { background: var(--timed); }
.wordmark-mark span:nth-child(2) { background: var(--confirm); }
.wordmark-mark span:nth-child(3) { background: var(--untimed); }
.wordmark-ko {
  font-family: var(--hangul);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
}
.site-header nav a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.site-header nav a:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3rem, 7vw, 5rem);
}
.hero h1 {
  margin: 0;
  max-width: 15ch;
  font-size: clamp(2.6rem, 7.2vw, 5.4rem);
  line-height: 0.98;
  font-weight: 850;
  font-stretch: 118%;
  letter-spacing: -0.025em;
}
.hero .lede {
  margin: 1.5rem 0 0;
  max-width: 52ch;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--muted);
}
.availability {
  margin: 1.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  font-weight: 600;
}
.pill {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--timed);
  color: var(--surface);
  font-weight: 700;
}

/* ---------- Routine player (the hero demo) ---------- */
.player {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(1.25rem, 3vw, 2rem);
}
.player-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.player-routine {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.player-block {
  margin: 0.15rem 0 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  font-stretch: 110%;
  line-height: 1.1;
}
.player-status {
  margin: 0.35rem 0 0;
  color: var(--muted);
  min-height: 1.55em;
}
.player-clock {
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 800;
  font-stretch: 75%;
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.strip {
  display: flex;
  gap: 4px;
  margin-top: 1.5rem;
  height: 64px;
}
.seg {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-block);
  background: color-mix(in srgb, var(--c) 18%, white);
  display: flex;
  align-items: flex-end;
  padding: 0.5rem 0.6rem;
  min-width: 0;
}
.seg-fill {
  position: absolute;
  inset: 0;
  background: var(--c);
  transform-origin: left center;
  transform: scaleX(0);
}
.seg.done .seg-fill { transform: scaleX(1); }
.seg-label {
  position: relative;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.seg.done .seg-label,
.seg.active.filled-past-half .seg-label { color: #fff; }
.seg.waiting { animation: wait-pulse 0.9s ease-in-out infinite alternate; }
@keyframes wait-pulse {
  from { box-shadow: inset 0 0 0 0 var(--c); }
  to   { box-shadow: inset 0 0 0 3px var(--c); }
}
.t-timed   { --c: var(--timed); }
.t-confirm { --c: var(--confirm); }
.t-untimed { --c: var(--untimed); }

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--line);
}
.section h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.05;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.015em;
  max-width: 22ch;
}
.section .intro {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
}

/* Block modes */
.modes {
  margin-top: 2.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}
.mode-swatch {
  display: block;
  height: 14px;
  border-radius: 4px;
  background: var(--c);
  margin-bottom: 1rem;
}
.t-timed .mode-swatch   { width: 100%; }
.t-confirm .mode-swatch { width: 100%; }
.t-untimed .mode-swatch { width: 38%; }
.mode h3 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 800;
}
.mode p { margin: 0; color: var(--muted); }

/* Example routines */
.routines {
  margin-top: 2.25rem;
  display: grid;
  gap: 1.5rem;
}
.routine-name {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
}
.routine-name span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.routine .strip { margin-top: 0; height: 44px; }
.routine .seg { background: var(--c); }
.routine .seg-label { color: #fff; font-size: 0.75rem; }
.routine .t-untimed .seg-label { color: #fff; }

/* Free */
.promises {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem 2rem;
}
.promises li {
  padding-left: 1rem;
  border-left: 3px solid var(--timed);
}
.promises strong { display: block; font-size: 1.1rem; }
.promises span { color: var(--muted); }

/* ---------- Legal pages ---------- */
.doc {
  padding-block: clamp(2rem, 5vw, 3.5rem) 4rem;
}
.doc article {
  max-width: 68ch;
}
.doc h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.02;
  font-weight: 850;
  font-stretch: 115%;
  letter-spacing: -0.02em;
}
.doc .effective {
  margin: 0.75rem 0 2rem;
  color: var(--muted);
}
.doc h2 {
  margin: 2.25rem 0 0.5rem;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
}
.doc h3 {
  margin: 1.25rem 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.doc p, .doc li { max-width: 68ch; }
.doc ul, .doc ol { padding-left: 1.3rem; }
.doc li + li { margin-top: 0.35rem; }
.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--timed);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.summary p { margin: 0 0 0.5rem; font-weight: 700; }
.summary ul { margin: 0; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.site-footer a { color: var(--ink); }
.site-footer p { margin: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .strip { height: 56px; }
  .seg-label { font-size: 0.7rem; }
  .seg-label { display: none; }
  .wordmark-ko { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .seg.waiting { animation: none; box-shadow: inset 0 0 0 3px var(--c); }
}
