/* Kuwa landing page. Tiger theme, mirrored from the app's
   src/constants/theme.ts. Yellow is a fill with dark text on top, never text or thin lines. */

:root {
  --bg: #ffffff;
  --surface: #fffbee;
  --selected: #ffefb5;
  --border: #efe6cc;
  --text: #16140f;
  --muted: #6a6355;
  --primary: #ffc800;
  --on-primary: #16140f;
  --primary-outline: #16140f;
  --success: #1f7a4d;
  --on-success: #eaf6ef;
  --ink: #16140f;

  --font: "Spline Sans", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  --max: 1120px;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  --bg: #14120e;
  --surface: #211e17;
  --selected: #3a3320;
  --border: #37322a;
  --text: #fffdf5;
  --muted: #a89f8c;
  --primary: #ffc800;
  --on-primary: #16140f;
  --primary-outline: #ffc800;
  --success: #4cc38a;
  --on-success: #06281a;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.num {
  font-variant-numeric: tabular-nums;
}

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

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 18px 0;
  transition: background 0.3s, box-shadow 0.3s, padding 0.3s;
}

.nav.scrolled {
  padding: 12px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  box-shadow: 0 1px 0 var(--border);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wordmark .tiger {
  display: inline-block;
  font-size: 22px;
  transition: transform 0.4s var(--ease);
}

.wordmark:hover .tiger {
  transform: rotate(-12deg) scale(1.1);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  color: var(--muted);
}

.nav-links a {
  transition: color 0.2s;
}

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

@media (max-width: 640px) {
  .nav-links .hide-sm {
    display: none;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
  will-change: transform;
}

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

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.btn-sm {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

/* ---------- Hero ---------- */

.hero {
  padding: 56px 0 72px;
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 50%, transparent);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 45%, transparent);
  }
  70% {
    box-shadow: 0 0 0 10px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

h1 {
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 24px;
}

h1 .line {
  display: block;
}

.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--muted);
  max-width: 520px;
  margin: 0 0 32px;
}

.lede strong {
  color: var(--text);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-note {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Load-in animation for hero copy */
.up {
  opacity: 0;
  transform: translateY(18px);
  animation: up 0.9s var(--ease) forwards;
}

.up:nth-child(1) { animation-delay: 0.05s; }
.up:nth-child(2) { animation-delay: 0.15s; }
.up:nth-child(3) { animation-delay: 0.25s; }
.up:nth-child(4) { animation-delay: 0.35s; }
.up:nth-child(5) { animation-delay: 0.45s; }

@keyframes up {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Phone mockup ---------- */

.phone-wrap {
  display: flex;
  justify-content: center;
  perspective: 1400px;
}

.phone {
  width: 320px;
  aspect-ratio: 9 / 19.2;
  background: var(--ink);
  border-radius: 48px;
  padding: 12px;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.06) inset,
    0 30px 60px -24px rgba(22, 20, 15, 0.45),
    0 0 0 1px rgba(22, 20, 15, 0.1);
  transform: rotateY(-8deg) rotateX(2deg);
  animation: float 7s ease-in-out infinite, phone-in 1.2s var(--ease) both;
  animation-delay: 0s, 0.3s;
}

@keyframes phone-in {
  from {
    opacity: 0;
    transform: rotateY(-14deg) rotateX(4deg) translateY(30px);
  }
  to {
    opacity: 1;
    transform: rotateY(-8deg) rotateX(2deg) translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -8px;
  }
}

.phone-screen {
  position: relative;
  height: 100%;
  border-radius: 38px;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 54px 14px 14px;
  font-size: 13px;
  color: var(--text);
}

.phone-screen::before {
  /* dynamic island */
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  translate: -50% 0;
  width: 92px;
  height: 26px;
  border-radius: 20px;
  background: var(--ink);
}

.ph-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

.ph-title {
  text-align: center;
  line-height: 1.2;
}

.ph-title strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.01em;
}

.ph-title .ph-elapsed {
  font-size: 12px;
  color: var(--muted);
}

.ph-finish {
  color: var(--text);
  font-weight: 600;
}

.ph-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 12px 8px;
  margin-bottom: 10px;
}

.ph-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ph-ex {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.ph-ex-sub {
  font-size: 11px;
  color: var(--muted);
}

.ph-cols,
.ph-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 34px;
  align-items: center;
  gap: 6px;
}

.ph-cols {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 4px 6px;
}

.ph-row {
  padding: 5px 4px;
  border-radius: 10px;
  transition: background 0.3s, opacity 0.3s;
}

.ph-row.is-done {
  background: var(--selected);
}

.ph-last {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ph-val {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  transition: border-color 0.2s;
}

.ph-row.is-done .ph-val {
  background: transparent;
  border-color: transparent;
}

.ph-val.is-typing {
  border-color: var(--text);
}

.ph-val.is-typing::after {
  content: "";
  width: 1px;
  height: 16px;
  margin-left: 2px;
  background: var(--text);
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  to {
    opacity: 0;
  }
}

.ph-val:empty::before {
  content: attr(data-placeholder);
  color: var(--border);
  font-weight: 500;
}

.ph-check {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--on-primary);
  transition: background 0.3s var(--ease), border-color 0.3s, transform 0.3s var(--ease);
}

.ph-row.is-done .ph-check {
  background: var(--primary);
  border-color: var(--primary-outline);
  transform: scale(1.06);
}

.ph-row.is-done .ph-check::after {
  content: "✓";
}

.ph-row.is-pr .ph-check {
  background: var(--success);
  border-color: var(--success);
  color: var(--on-success);
}

.ph-row.is-pr .ph-check::after {
  content: "PR";
  font-size: 10px;
  letter-spacing: 0.02em;
}

.ph-add {
  margin-top: 6px;
  padding: 6px 4px 2px;
  font-size: 12px;
  color: var(--muted);
}

.ph-card.is-dim {
  opacity: 0.55;
}

.ph-card.is-dim .ph-ex-sub {
  margin-left: auto;
}

.ph-rest {
  margin-top: auto;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 14px;
  padding: 10px 12px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 8px;
  align-items: center;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.4s;
}

.ph-rest.is-on {
  transform: none;
  opacity: 1;
}

.ph-rest-label {
  font-size: 12px;
  opacity: 0.75;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.ph-rest-time {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ph-rest-bar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--on-primary) 25%, transparent);
  overflow: hidden;
}

.ph-rest-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--on-primary);
  transform-origin: left;
  transition: transform 0.1s linear;
}

/* ---------- Sections ---------- */

section {
  padding: 88px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

h2 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 16px;
}

.section-head p {
  color: var(--muted);
  font-size: 18px;
  margin: 0;
}

/* Features grid */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  transition: transform 0.4s var(--ease), border-color 0.3s;
}

.feature:hover {
  transform: translateY(-3px);
  border-color: var(--muted);
}

.feature .glyph {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.feature .glyph svg {
  width: 20px;
  height: 20px;
  stroke: var(--text);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature h3 {
  font-size: 18px;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

/* Principles */

.principles {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.principle-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.principle .n {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 18px;
  color: var(--text);
}

.principle h3 {
  font-size: 20px;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}

.principle p {
  margin: 0;
  color: var(--muted);
}

/* Big quote band */

.band {
  text-align: center;
}

.band .tiger-big {
  font-size: 72px;
  line-height: 1;
  display: inline-block;
  margin-bottom: 24px;
  animation: float 6s ease-in-out infinite;
}

.band h2 {
  max-width: 760px;
  margin-inline: auto;
}

.band p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 32px;
  font-size: 18px;
}

/* Footer */

footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  font-size: 14px;
  color: var(--muted);
}

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

footer nav {
  display: flex;
  gap: 24px;
}

footer a:hover {
  color: var(--text);
}

/* Scroll reveal */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.4s; }

/* ---------- Legal and support pages ---------- */

.prose {
  max-width: 680px;
  padding: 48px 0 96px;
}

.prose h1 {
  font-size: clamp(34px, 5vw, 52px);
  margin-bottom: 8px;
}

.prose .meta {
  color: var(--muted);
  margin: 0 0 40px;
}

.prose h2 {
  font-size: 24px;
  margin: 40px 0 10px;
}

.prose p,
.prose li {
  color: var(--text);
}

.prose p.soft,
.prose li.soft {
  color: var(--muted);
}

.prose ul {
  padding-left: 20px;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
}

.prose a:hover {
  text-decoration-color: var(--text);
}

.faq details {
  border-top: 1px solid var(--border);
  padding: 18px 0;
}

.faq details:last-child {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.faq summary::after {
  content: "+";
  font-weight: 400;
  font-size: 22px;
  color: var(--muted);
  transition: transform 0.3s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  margin: 12px 0 0;
  color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }

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

  .phone {
    width: 290px;
    transform: none;
    animation-name: float, phone-in-flat;
  }

  @keyframes phone-in-flat {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .features,
  .principle-list {
    grid-template-columns: 1fr;
  }

  section {
    padding: 64px 0;
  }
}

/* ---------- Reduced motion ---------- */

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

  .up,
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }

  .phone,
  .band .tiger-big,
  .eyebrow::before {
    animation: none;
  }

  .ph-rest,
  .ph-check,
  .ph-row,
  .btn,
  .feature {
    transition: none;
  }
}

/* Phone shell must stay visible on the ink background in dark mode. */
:root[data-theme="dark"] .phone {
  background: var(--surface);
  box-shadow:
    0 0 0 1px rgba(255, 253, 245, 0.14),
    0 30px 60px -24px rgba(0, 0, 0, 0.7);
}

:root[data-theme="dark"] .phone-screen::before {
  background: #0a0907;
}

/* ---------- Theme toggle ---------- */

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, border-color 0.2s, transform 0.3s var(--ease);
}

.theme-toggle:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .moon {
  display: block;
}
