/*
  Tiny Apps: one stylesheet for tinyappsbox.fyi and every <app>.tinyappsbox.fyi.
  Warm paper, ink text, serif headings, thin rules. Colour comes from one accent per app,
  set by <html data-app="...">. No gradients, no drop shadows, no icon tiles.
  Rules for changing it: .claude/skills/site-design/SKILL.md
*/
:root {
  color-scheme: light dark;
  --paper: #faf8f4;
  --paper-2: #f2eee6;
  --ink: #1f1d1a;
  --ink-2: #4a463f;
  --muted: #6e695f;
  --rule: #e4ded2;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --accent-soft: #e6eee9;
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --measure: 66ch;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171614;
    --paper-2: #211f1c;
    --ink: #ece8e0;
    --ink-2: #cfc9bd;
    --muted: #a39d91;
    --rule: #34312c;
    --accent: #9cc9b8;
    --accent-ink: #10201b;
    --accent-soft: #22302b;
  }
}

/* One accent per app. Light first, then dark. */
[data-app="nestkin"] { --accent: #3d4492; --accent-soft: #eceaf6; }
[data-app="portionmonitor"] { --accent: #00756d; --accent-soft: #e3f0ed; }
[data-app="dosekin"] { --accent: #24685a; --accent-soft: #e2efeb; }
@media (prefers-color-scheme: dark) {
  [data-app="nestkin"] { --accent: #f3d58f; --accent-ink: #1e2250; --accent-soft: #26284a; }
  [data-app="portionmonitor"] { --accent: #6fd3c7; --accent-ink: #062c28; --accent-soft: #1b2e2b; }
  [data-app="dosekin"] { --accent: #8dd5c1; --accent-ink: #0d2e27; --accent-soft: #1a2d29; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
code { font: 0.88em var(--mono); background: var(--paper-2); padding: 1px 5px; border-radius: 4px; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 18px; }
h2 { font-size: clamp(1.55rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 14px; }
h3 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 6px; }

.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.read { max-width: var(--measure); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; }
.skip:focus { left: 8px; }

/* Header */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; font-size: 1.02rem; }
.brand img, .brand svg { width: 30px; height: 30px; border-radius: 7px; }
.brand small { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.site-nav { display: flex; gap: 22px; font-size: 0.95rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink-2); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* Sections */
.section { padding: 72px 0; border-top: 1px solid var(--rule); }
.section:first-of-type { border-top: 0; }
.kicker { font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 40ch; }
.intro { max-width: 58ch; color: var(--ink-2); margin-bottom: 36px; }

/* Hero */
.hero { padding: 64px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 56px; align-items: center; }
.hero .app-icon { width: 72px; height: 72px; border-radius: 17px; margin-bottom: 22px; }
.hero .phone { width: min(320px, 100%); justify-self: center; border-radius: 26px; border: 1px solid var(--rule); }
.facts { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 0.92rem; }
.facts li::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 6px;
  background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; font-size: 0.98rem;
  border: 1px solid var(--ink); transition: background-color 150ms ease, transform 100ms ease;
}
.btn:hover { background: var(--ink-2); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn svg { width: 18px; height: 18px; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.quiet:hover { border-color: var(--ink-2); }
.status { display: inline-block; font-size: 0.92rem; color: var(--ink-2); border: 1px dashed var(--rule); padding: 10px 14px; border-radius: 6px; }

/* Feature list: plain rows under a rule, two columns */
.points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; margin: 0; padding: 0; list-style: none; }
.points li { border-top: 1px solid var(--rule); padding: 20px 0 22px; }
.points h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 650; }
.points p { margin: 0; color: var(--ink-2); }

/* Screenshots */
.shots { display: flex; gap: 20px; overflow-x: auto; padding: 4px 2px 16px; scroll-snap-type: x mandatory; margin: 0; }
.shots figure { margin: 0; flex: 0 0 auto; width: 210px; scroll-snap-align: start; }
.shots img { border-radius: 16px; border: 1px solid var(--rule); }
.shots figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 10px; line-height: 1.45; }

/* Answer blocks (written to be quoted by search and AI answers) */
.answers { display: grid; gap: 28px; max-width: var(--measure); }
.answers h3 { margin-bottom: 6px; }
.answers p { color: var(--ink-2); margin: 0; }

/* Plain-words note, e.g. privacy summary */
.note { background: var(--accent-soft); border-radius: 10px; padding: 20px 24px; max-width: var(--measure); }
.note p:last-child { margin: 0; }

/* FAQ */
.faq { max-width: var(--measure); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-of-type { border-top: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.3rem/1 var(--sans); color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--ink-2); margin: -4px 0 18px; }

/* Hub: list of apps */
.app-list { list-style: none; padding: 0; margin: 0; }
.app-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 24px; align-items: start; padding: 28px 0; border-top: 1px solid var(--rule); }
.app-row img { width: 76px; height: 76px; border-radius: 18px; }
.app-row h3 { font-size: 1.4rem; margin: 0 0 4px; }
.app-row h3 a { color: var(--ink); text-decoration: none; }
.app-row h3 a:hover { text-decoration: underline; }
.app-row p { margin: 0 0 8px; color: var(--ink-2); max-width: 56ch; }
.app-row .links { font-size: 0.93rem; color: var(--muted); }
.app-row .links a { color: var(--ink-2); }
.pill { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--paper-2); color: var(--ink-2); }
.pill.live { background: #e3f0e6; color: #2c5e38; }
@media (prefers-color-scheme: dark) { .pill.live { background: #1f3325; color: #a7d8b2; } }

.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; list-style: none; padding: 0; margin: 0; counter-reset: p; }
.principles li { border-top: 1px solid var(--rule); padding: 20px 0 22px; counter-increment: p; }
.principles li::before { content: counter(p, decimal-leading-zero); font: 0.85rem var(--mono); color: var(--muted); display: block; margin-bottom: 8px; }
.principles p { margin: 0; color: var(--ink-2); }

/* Documents: privacy policy, terms */
.doc { padding: 56px 0 24px; }
.doc .wrap > * { max-width: var(--measure); }
.doc h1 { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 6px; }
.doc .meta { color: var(--muted); margin: 0 0 32px; font-size: 0.95rem; }
.doc h2 { font-size: 1.35rem; margin: 44px 0 10px; }
.doc ul { padding-left: 20px; }
.doc li { margin: 6px 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 14px 0 18px; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); }
.doc th { color: var(--muted); font-weight: 600; }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); margin-top: 24px; padding: 36px 0 48px; color: var(--muted); font-size: 0.92rem; }
.site-foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-foot h2 { font: 600 0.8rem var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin: 4px 0; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot p { margin: 0 0 6px; max-width: 36ch; }

@media (max-width: 800px) {
  body { font-size: 16.5px; }
  .hero { padding: 40px 0 56px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .hero .phone { width: min(280px, 80%); }
  .section { padding: 56px 0; }
  .points, .principles { grid-template-columns: 1fr; }
  .app-row { grid-template-columns: 60px minmax(0, 1fr); gap: 16px; }
  .app-row img { width: 60px; height: 60px; border-radius: 14px; }
  .app-row .pill { grid-column: 2; justify-self: start; }
  .site-foot .wrap { grid-template-columns: 1fr; }
  .site-nav { gap: 16px; }
}
@media print {
  .site-head nav, .site-foot, .actions { display: none; }
  body { background: #fff; color: #000; }
}
