/* Viberdyne — shared stylesheet. No frameworks, no external assets, system fonts only. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* ---------- Theme tokens ---------- */
:root {
  --bg: #faf9f7;
  --bg-raised: #ffffff;
  --fg: #1c1a17;
  --muted: #6b6459;
  --border: #e6e1d9;
  --border-strong: #d3ccc0;
  --shadow: 0 1px 2px rgba(28, 26, 23, 0.04), 0 8px 24px rgba(28, 26, 23, 0.05);
  --accent: #d97a3f;
  --accent-fg: #ffffff;
  --code-bg: #f1ede6;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130f;
    --bg-raised: #1c1a15;
    --fg: #f2ede4;
    --muted: #a89e8d;
    --border: #322d25;
    --border-strong: #453e32;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    --code-bg: #23201a;
  }
}

/* Manual theme toggle hooks, in case a host page stamps data-theme on <html> */
:root[data-theme="dark"] {
  --bg: #15130f;
  --bg-raised: #1c1a15;
  --fg: #f2ede4;
  --muted: #a89e8d;
  --border: #322d25;
  --border-strong: #453e32;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  --code-bg: #23201a;
}
:root[data-theme="light"] {
  --bg: #faf9f7;
  --bg-raised: #ffffff;
  --fg: #1c1a17;
  --muted: #6b6459;
  --border: #e6e1d9;
  --border-strong: #d3ccc0;
  --shadow: 0 1px 2px rgba(28, 26, 23, 0.04), 0 8px 24px rgba(28, 26, 23, 0.05);
  --code-bg: #f1ede6;
}

/* Per-app accent overrides */
body.theme-duskie { --accent: #d97a3f; }
body.theme-toasttime { --accent: #2f8f5b; }

/* ---------- Base ---------- */
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Site header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand svg { width: 26px; height: 26px; flex-shrink: 0; }

.site-header nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.95rem;
  color: var(--muted);
}

.site-header nav a:hover { color: var(--fg); }

.back-link {
  font-size: 0.95rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.back-link:hover { color: var(--fg); }

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 56px;
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  max-width: 16ch;
}

.hero .tagline {
  margin-top: 18px;
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 46ch;
}

.hero-icon {
  margin-bottom: 28px;
}

.app-hero {
  padding: 72px 0 40px;
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.app-hero-icon {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.app-hero-icon svg { width: 100%; height: 100%; }

/* ---------- Cards / grid ---------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding-bottom: 96px;
}

@media (max-width: 640px) {
  .app-grid { grid-template-columns: 1fr; }
  .app-hero { flex-direction: column; }
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.app-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.app-card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
}

.app-card .card-icon svg { width: 100%; height: 100%; }

.app-card h2 {
  font-size: 1.35rem;
}

.app-card .platform {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-card p {
  color: var(--muted);
  font-size: 0.98rem;
}

.app-card .card-link {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-card .card-link svg { width: 14px; height: 14px; }

/* ---------- Sections ---------- */
.section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.section:first-of-type { border-top: none; }

.section h2 {
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.section h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.section p {
  color: var(--muted);
  max-width: 68ch;
}

.section p + p { margin-top: 12px; }

.lede {
  font-size: 1.1rem;
  color: var(--fg);
  max-width: 60ch;
}

/* ---------- Factor list ---------- */
.factor-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.factor {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.factor .emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.factor h3 {
  font-size: 1rem;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.factor .weight {
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  font-weight: 400;
}

.factor p {
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- Rating scale ---------- */
.scale {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.scale-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 18px;
  font-size: 0.9rem;
}

.scale-row + .scale-row { border-top: 1px solid var(--border); }

.scale-row .range {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  width: 60px;
  flex-shrink: 0;
}

.scale-row .label {
  font-weight: 600;
  width: 130px;
  flex-shrink: 0;
}

.scale-row .desc { color: var(--muted); }

/* ---------- Badges / buttons ---------- */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--bg-raised);
}

.store-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
}

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

.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--fg);
}

.btn svg { width: 16px; height: 16px; }

/* ---------- Platform table (ToastTime) ---------- */
.table-wrap { overflow-x: auto; margin-top: 20px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 420px;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 5px;
}

/* ---------- Traffic light graphic ---------- */
.traffic-demo {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.traffic-demo .light {
  flex: 1;
  padding: 14px 10px;
  border-radius: 10px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

/* ---------- Privacy policy ---------- */
.policy h2 { margin-top: 8px; }
.policy .effective {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}
.policy ul { margin: 12px 0 0; }
.policy li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  margin-bottom: 8px;
}
.policy li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer a:hover { color: var(--fg); }

/* ---------- 404 ---------- */
.notfound {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

.notfound h1 { font-size: 3rem; margin-bottom: 12px; }
.notfound p { color: var(--muted); margin-bottom: 28px; }
