/* ============================================================
   Cooked Apps — shared site styles
   Used by: /, /support.html, /privacy-policy.html,
            /terms-of-use.html, /grindsize/, /design-system.html
   Not used by /lumo/ — that page is a self-contained product
   page with its own design system (see design-system.html).
   ============================================================ */

:root {
  --bg: #ffffff;
  --ink: #000000;
  --ink-muted: #555555;
  --rule: #e0e0e0;
  --card-bg: #fafafa;
}

[data-theme="dark"] {
  --bg: #111111;
  --ink: #ffffff;
  --ink-muted: #999999;
  --rule: #2a2a2a;
  --card-bg: #191919;
}

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

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  padding: 96px 24px 120px;
  transition: background-color 0.2s, color 0.2s;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- icon buttons (home / theme toggle) ---------- */
.iconbtn {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 20px);
  z-index: 90;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.iconbtn:hover { border-color: var(--ink); }

.iconbtn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.homebtn svg {
  fill: currentColor;
  stroke: none;
}

.homebtn { left: 24px; }
.themebtn { right: 24px; }

[data-theme="dark"] .themebtn .moon { display: none; }
[data-theme="light"] .themebtn .sun { display: none; }

/* ---------- typography ---------- */
h1 {
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 8px;
}

h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 14px;
}

p { margin-bottom: 12px; }
p:last-child { margin-bottom: 0; }

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

a:hover { opacity: 0.6; }

ul {
  list-style: none;
  margin: 12px 0;
  padding: 0;
}

ul li {
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}

ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--ink-muted);
}

/* ---------- doc-page content rhythm (privacy / terms / support) ---------- */
.intro {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}

.effective-date {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 40px;
  display: block;
}

section {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}

section:last-of-type { border-bottom: none; }

/* ---------- footer ---------- */
footer {
  margin-top: 64px;
  font-size: 12px;
  color: var(--ink-muted);
  text-align: center;
}

footer a {
  color: var(--ink-muted);
  opacity: 1;
}

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

.legal-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

/* ---------- pill CTA button ---------- */
.cta {
  display: inline-block;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 999px;
  transition: transform 0.2s, opacity 0.2s;
}

.cta:hover { transform: translateY(-2px); opacity: 0.9; }

/* ---------- app grid (home page) ---------- */
.apps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 480px) {
  .apps { grid-template-columns: repeat(2, 1fr); }
}

.apps li {
  padding-left: 0;
}

.apps li::before {
  content: none;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 16px;
  border-radius: 14px;
  background: var(--card-bg);
  border: 1px solid var(--rule);
  transition: transform 0.2s, border-color 0.2s;
}

a.app:hover {
  transform: translateY(-2px);
  border-color: var(--ink-muted);
}

.app-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: block;
  object-fit: cover;
  background: var(--rule);
}

.app-icon-placeholder {
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-muted);
  border: 1px dashed var(--rule);
  background: none;
}

.app-name {
  font-size: 14px;
  font-weight: 600;
}

.app-tag {
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.4;
}

.app-soon {
  opacity: 0.55;
  cursor: default;
}

.app-soon .app-name::after {
  content: 'Soon';
  margin-left: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 2px 5px;
  vertical-align: middle;
}
