/* Memizer — the app's theme, on the web.
   Black, white and greys. Square corners, hairline borders, no shadows. */

/* ── Tokens (the same values as the app's app_theme.dart) ─────────────── */
:root {
  --canvas: #ffffff;
  --subtle: #fafafa;
  --muted: #f4f4f5;
  --hairline: #e4e4e7;
  --strong: #d4d4d8;
  --text-muted: #71717a;
  --text-secondary: #52525b;
  --ink: #09090b;
  --on-ink: #ffffff;

  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Geist', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;

  --gutter: 24px;
  --width: 1080px;
  color-scheme: light;
}

/* Dark: by system setting unless the visitor chose light, or by choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --canvas: #09090b;
    --subtle: #0f0f11;
    --muted: #18181b;
    --hairline: #27272a;
    --strong: #3f3f46;
    --text-muted: #a1a1aa;
    --text-secondary: #d4d4d8;
    --ink: #fafafa;
    --on-ink: #09090b;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --canvas: #09090b;
  --subtle: #0f0f11;
  --muted: #18181b;
  --hairline: #27272a;
  --strong: #3f3f46;
  --text-muted: #a1a1aa;
  --text-secondary: #d4d4d8;
  --ink: #fafafa;
  --on-ink: #09090b;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-secondary);
  font: 400 16px/1.6 var(--body);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 6.4vw, 72px); font-weight: 600; line-height: 1.02; letter-spacing: -0.045em; }
h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 600; line-height: 1.1; letter-spacing: -0.035em; }
h3 { font-size: 18px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }

p { margin: 0; }
a { color: inherit; }

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

.wrap { width: 100%; max-width: var(--width); margin: 0 auto; padding: 0 var(--gutter); }

/* Upper-case mono captions, as in the app. */
.label {
  font: 400 11px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fine { font-size: 13px; color: var(--text-muted); }

.mark { display: block; width: 32px; height: 22px; fill: var(--ink); }

/* ── Top bar ──────────────────────────────────────────────────────────── */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
}
.bar-row { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: block; padding: 8px 0; }

.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a, .theme-toggle {
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
}
.nav a:hover { color: var(--ink); }

.theme-toggle {
  padding: 9px 12px;
  background: none;
  border: 1px solid var(--hairline);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--strong); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  font: 500 15px/1 var(--body);
  text-decoration: none;
  white-space: nowrap;
}
.button-solid { background: var(--ink); color: var(--on-ink); }
.button-solid:hover { opacity: 0.86; }
.button-ghost { border-color: var(--hairline); color: var(--text-muted); cursor: default; }
.button-ghost em {
  padding: 4px 6px;
  background: var(--muted);
  font: 400 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 64px;
  padding-top: 88px;
  padding-bottom: 96px;
}
.hero-copy > * + * { margin-top: 24px; }
.lede { max-width: 30em; font-size: 18px; line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px !important; }

/* ── Phone drawing ────────────────────────────────────────────────────── */
.phone { width: 296px; padding: 10px; border: 1px solid var(--strong); background: var(--subtle); }
.phone-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 580px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  overflow: hidden;
}

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px;
  border-bottom: 1px solid var(--hairline);
}
.app-bar .mark { width: 24px; height: 16px; }
.app-bar-icons { display: flex; align-items: center; gap: 16px; }
.icon-search {
  width: 11px; height: 11px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  position: relative;
}
.icon-search::after {
  content: '';
  position: absolute;
  right: -5px; bottom: -4px;
  width: 6px; height: 2px;
  background: var(--ink);
  transform: rotate(45deg);
}
.icon-menu { width: 3px; height: 3px; background: var(--ink); border-radius: 50%; box-shadow: 0 -5px 0 var(--ink), 0 5px 0 var(--ink); }

.chips { display: flex; gap: 6px; padding: 12px 14px; overflow: hidden; }
.chip {
  flex: none;
  padding: 7px 9px;
  border: 1px solid var(--hairline);
  font: 400 8px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.chip b { font-weight: 400; color: var(--text-muted); }
.chip-on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip-on b { color: var(--strong); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 0 2px; }
.tile { position: relative; aspect-ratio: 1; background: var(--muted); }

/* Stand-ins for pictures: greys only, so the page stays on theme. */
.t1 { background: linear-gradient(135deg, #3f3f46, #a1a1aa); }
.t2 { background: repeating-linear-gradient(45deg, #d4d4d8 0 8px, #e4e4e7 8px 16px); }
.t3 { background: radial-gradient(circle at 30% 30%, #e4e4e7, #71717a); }
.t4 { background: linear-gradient(180deg, #18181b, #52525b); }
.t5 { background: conic-gradient(#27272a 25%, #d4d4d8 0 50%, #27272a 0 75%, #d4d4d8 0) 0 0 / 24px 24px; }
.t6 { background: linear-gradient(90deg, #a1a1aa, #e4e4e7); }
.t7 { background: radial-gradient(circle at 70% 60%, #52525b, #18181b); }
.t8 { background: linear-gradient(45deg, #d4d4d8 50%, #71717a 50%); }
.t9 { background: linear-gradient(160deg, #71717a, #27272a); }
.t10 { background: repeating-linear-gradient(0deg, #3f3f46 0 6px, #52525b 6px 12px); }

.tile-sound {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: 400 7px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.bars { width: 2px; height: 12px; background: var(--text-secondary); box-shadow: -4px 0 0 -0.5px var(--text-secondary), 4px 0 0 -0.5px var(--text-secondary), -8px 3px 0 -1px var(--text-secondary), 8px 3px 0 -1px var(--text-secondary); }

.badge {
  position: absolute;
  left: 4px; bottom: 4px;
  padding: 3px 4px;
  background: #09090b;
  color: #ffffff;
  font: 400 7px/1 var(--mono);
  letter-spacing: 0.08em;
}
.badge-play { width: 14px; height: 14px; padding: 0; }
.badge-play::after {
  content: '';
  position: absolute;
  left: 5px; top: 3.5px;
  border-left: 5px solid #ffffff;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
}

.fab {
  position: absolute;
  right: 14px; bottom: 64px;
  width: 44px; height: 44px;
  background: var(--ink);
}
.fab::before, .fab::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 14px; height: 2px;
  background: var(--on-ink);
  transform: translate(-50%, -50%);
}
.fab::after { transform: translate(-50%, -50%) rotate(90deg); }

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: auto;
  border-top: 1px solid var(--hairline);
  background: var(--canvas);
  z-index: 1;
}
.tab {
  padding: 18px 0 16px;
  text-align: center;
  font: 400 8px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tab-on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }

/* ── "No account…" strip ──────────────────────────────────────────────── */
.strip { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); background: var(--subtle); }
.strip-row { display: grid; grid-template-columns: repeat(4, 1fr); }
.strip-row p {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 24px 0;
  color: var(--ink);
  font: 500 16px/1.3 var(--display);
}

/* ── Sections ─────────────────────────────────────────────────────────── */
.section { padding-top: 104px; padding-bottom: 8px; }
.section > h2 { margin-top: 16px; }
.section > .fine { margin-top: 20px; }

/* Feature grid: one outer border, hairlines between cells. */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 48px;
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
.cell {
  padding: 28px 24px 32px;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.cell h3 { margin: 14px 0 8px; }
.cell p:last-child { font-size: 15px; line-height: 1.55; }

/* ── Download ─────────────────────────────────────────────────────────── */
.download {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  margin-top: 48px;
  border: 1px solid var(--hairline);
}
.download-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding: 36px 32px;
  background: var(--subtle);
  border-right: 1px solid var(--hairline);
}
.mark-large { width: 70px; height: 48px; }

.facts { display: flex; gap: 32px; margin: 8px 0 0; }
.facts dt {
  font: 400 10px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.facts dd { margin: 6px 0 0; color: var(--ink); font: 500 16px/1.3 var(--display); }

.steps { margin: 0; padding: 0; list-style: none; }
.steps li { padding: 26px 32px; }
.steps li + li { border-top: 1px solid var(--hairline); }
.steps p { margin-top: 8px; font-size: 15px; line-height: 1.55; }

/* ── Developer ────────────────────────────────────────────────────────── */
.developer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 280px);
  gap: 32px;
  margin-top: 48px;
  padding: 32px;
  border: 1px solid var(--hairline);
}
.avatar {
  width: 88px; height: 88px;
  border: 1px solid var(--hairline);
  background: repeating-linear-gradient(45deg, var(--muted) 0 6px, var(--canvas) 6px 12px);
}
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
}
.developer-copy > * + * { margin-top: 10px; }
.developer-copy .why { margin-top: 24px; }
.quote {
  max-width: 18em;
  margin: 10px 0 0;
  color: var(--ink);
  font: 500 24px/1.25 var(--display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.links a {
  display: block;
  padding: 9px 12px;
  border: 1px solid var(--hairline);
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-secondary);
}
.links a:hover { color: var(--ink); border-color: var(--strong); }

.source { padding-left: 32px; border-left: 1px solid var(--hairline); }
.source h3 { margin: 12px 0 8px; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.source p:last-child { font-size: 15px; line-height: 1.55; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.footer { margin-top: 112px; border-top: 1px solid var(--hairline); }
.footer-row { display: flex; align-items: center; gap: 20px; padding-top: 28px; padding-bottom: 28px; }
.footer-row a { margin-left: auto; text-decoration: none; }
.footer-row a:hover { color: var(--ink); }

/* ── Smaller screens ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 56px; padding-top: 56px; padding-bottom: 72px; }
  .phone { justify-self: center; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .download { grid-template-columns: 1fr; }
  .download-main { border-right: 0; border-bottom: 1px solid var(--hairline); }
  .developer { grid-template-columns: auto minmax(0, 1fr); }
  .source { grid-column: 1 / -1; padding: 28px 0 0; border-left: 0; border-top: 1px solid var(--hairline); }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .nav { display: none; }
  .theme-toggle { margin-left: auto; }
  .lede { font-size: 17px; }
  .actions .button { flex: 1 1 100%; justify-content: center; }
  .strip-row { grid-template-columns: repeat(2, 1fr); }
  .strip-row p { padding: 18px 0; }
  .section { padding-top: 72px; }
  .grid { grid-template-columns: 1fr; }
  .download-main, .steps li { padding-left: 20px; padding-right: 20px; }
  .facts { gap: 24px; }
  .developer { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
  .footer { margin-top: 80px; }
}

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