/* PiiiP site: grey paper, one cobalt ink, hand-lettered display. Same rules as the app. */
:root {
  --paper: #DDDDDD;
  --card: #F4F4F2;
  --ink: #1B00CA;
  --ink-soft: rgba(27, 0, 202, 0.55);
  --dot: rgba(27, 0, 202, 0.28);
  --text: #17171C;
  --soft: #4A4A55;
  --rule: rgba(27, 0, 202, 0.18);
  --todo-bg: #FFF3B0;
  --todo-text: #3A3000;

  --font-hand: "Patrick Hand", "Comic Sans MS", cursive;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius-tile: 16px;
  --radius-card: 28px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14141A;
    --card: #1E1E26;
    --ink: #A9A0FF;
    --ink-soft: rgba(169, 160, 255, 0.6);
    --dot: rgba(169, 160, 255, 0.22);
    --text: #EDEDF2;
    --soft: #B4B4C0;
    --rule: rgba(169, 160, 255, 0.22);
    --todo-bg: #4A4000;
    --todo-text: #FFF3B0;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1.4px, transparent 1.6px);
  background-size: 28px 28px;
  color: var(--text);
  font: 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-head { padding: 20px 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand span { font: 1.9rem/1 var(--font-hand); color: var(--ink); }
.site-nav { display: flex; gap: 18px; font: 0.9rem var(--font-mono); }
.site-nav a { text-decoration: none; }
.site-nav a[aria-current="page"] { text-decoration: underline; }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 32px 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px rgba(27, 0, 202, 0.35);
}
@media (min-width: 600px) { .card { padding: 40px 40px; } }

h1, h2, h3 { font-family: var(--font-hand); color: var(--ink); font-weight: 400; }
h1 { font-size: clamp(2.4rem, 1.6rem + 3vw, 3.4rem); line-height: 1.05; margin: 0 0 8px; }
h2 { font-size: 1.7rem; line-height: 1.15; margin: 32px 0 6px; }
h3 { font-size: 1.35rem; margin: 24px 0 4px; }

.meta { font: 0.85rem var(--font-mono); color: var(--soft); margin: 0 0 20px; }
.lead { font-size: 1.12rem; font-weight: 600; }
.soft { color: var(--soft); }
ul { padding-left: 1.2em; }
li + li { margin-top: 4px; }

.lang-switch { font: 0.9rem var(--font-mono); margin: 8px 0 20px; }

.todo { background: var(--todo-bg); color: var(--todo-text); padding: 0 4px; border-radius: 4px; }

/* Landing */
.hero { display: grid; gap: 32px; align-items: center; padding: 24px 0 40px; }
@media (min-width: 720px) { .hero { grid-template-columns: 1.15fr 0.85fr; } }
.hero .tagline { font: 1.6rem/1.2 var(--font-hand); color: var(--ink); margin: 0 0 16px; }
.hero p { margin: 0 0 16px; }
.phone {
  justify-self: center;
  width: min(300px, 80vw);
  aspect-ratio: 600 / 1303;
  border-radius: 44px;
  border: 10px solid #17171C;
  overflow: hidden;
  background: var(--card);
  transform: rotate(2.5deg);
  box-shadow: 0 30px 60px -30px rgba(27, 0, 202, 0.5);
  transition: transform 500ms var(--ease-out);
}
.phone:hover { transform: rotate(0deg) translateY(-4px); }
.phone img { width: 100%; height: 100%; display: block; object-fit: cover; }

.badge-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.pill {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  font: 0.95rem var(--font-mono);
  text-decoration: none;
  border: 1.5px solid var(--ink);
  transition: transform 150ms var(--ease-out), background-color 150ms;
}
.pill:active { transform: scale(0.97); }
.pill.solid { background: var(--ink); color: var(--card); }
.pill.solid:hover { background: var(--text); border-color: var(--text); }
.pill.ghost:hover { background: var(--rule); }

.features { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 600px) { .features { grid-template-columns: 1fr 1fr; } }
.features li { background: var(--paper); border-radius: var(--radius-tile); padding: 18px 20px; margin: 0; }
.features li:first-child { grid-column: 1 / -1; border: 1.5px solid #D2002A; }
.features h3 { margin: 0 0 4px; }
.features p { margin: 0; font-size: 0.97rem; }

/* Phrasebook: tap to hear PiiiP */
.phrases { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.phrase {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 14px 16px; border: 0; border-radius: var(--radius-tile);
  background: var(--paper); color: var(--ink); text-align: left; cursor: pointer;
  font: inherit; transition: transform 150ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.phrase span { font: 1.45rem/1.1 var(--font-hand); }
.phrase small { font: 0.78rem/1.3 var(--font-mono); color: var(--soft); }
.phrase:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.phrase:active { transform: scale(0.97); }
.phrase:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.phrase.playing { background: var(--ink); }
.phrase.playing span, .phrase.playing small { color: var(--card); }
.phrase.alert span { color: #D2002A; }
.phrase.alert.playing { background: #D2002A; }

/* FAQ */
details { border-top: 1px solid var(--rule); padding: 14px 0; }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; font: 1.3rem/1.3 var(--font-hand); color: var(--ink); list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; display: inline-block; width: 1.2em; transition: transform 200ms var(--ease-out); }
details[open] summary::before { transform: rotate(45deg); }
details p { margin: 8px 0 0 1.2em; }

/* Footer */
.site-foot { padding: 8px 0 48px; font: 0.85rem var(--font-mono); color: var(--soft); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) {
  *, *::before { transition: none !important; }
  .phone { transform: none; }
}
