/*
 * KodaWorks website: shared layout, in the KodaWorks look (colours taken from the logo in images/).
 * Each app's page loads one more file that swaps these colours and fonts for the app's own look:
 *   roll-anywhere/page.css      (standalone: Roll Anywhere does not load this file)
 *   tomehaven/couch-corner.css  (Couch Corner)
 * When you change any .css file, raise the ?v= number where the pages load it, or browsers keep the old file for up to 30 days.
 * Font: Nunito (Google Fonts, SIL Open Font Licence), rounded like the logo's lettering.
 */

:root {
  --bg: #fff6ec; /* the logo's cream, so the logo blends into the page */
  --card: #ffffff;
  --card2: #ffffff; /* the highlighted card (Pro) */
  --border: #f0e2cf;
  --title: #1f2a44; /* the logo's navy */
  --text: #1f2a44;
  --text2: #4a5268; /* secondary text */
  --hint: #676d80;
  --accent: #b54c0d; /* links: the logo's orange, darkened so small text stays readable */
  --h2: #e0651b; /* section headings: the logo's orange (large text, so it reads fine) */
  --button: #1f2a44;
  --on-button: #ffffff;
  --code-bg: #fbeedd;

  --display: "Nunito", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display-weight: 800;
  --h3-font: var(--display);
  --h3-style: normal;
  --h3-weight: 800;
  --body: "Nunito", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-card: 18px;
  --shadow-card: 0 2px 6px rgba(31, 42, 68, 0.08);
  color-scheme: light dark; /* the site has its own dark version, so browsers don't repaint it */
}

/* Dark version, for phones and computers in dark mode. App pages override all of these. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141b2d; /* deep navy */
    --card: #1f2a44; /* the logo's navy */
    --card2: #26334f;
    --border: #2e3b5a;
    --title: #fff6ec; /* the logo's cream */
    --text: #f3ebdf;
    --text2: #c9c2b6;
    --hint: #9aa3b5;
    --accent: #f2894a; /* links: the logo's orange, lightened so small text stays readable */
    --h2: #e0651b; /* the logo's orange */
    --button: #e0651b;
    --on-button: #141b2d;
    --code-bg: #1f2a44;
    --shadow-card: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.page {
  max-width: 60rem;
  margin: 0 auto;
  padding: 32px 16px 56px;
  display: grid;
  gap: 48px;
}

/* Top bar: the KodaWorks name, linking home. */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: var(--display-weight);
  color: var(--title);
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); }
h2 {
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  color: var(--h2);
  display: flex;
  align-items: center;
  gap: 12px;
}
h3 {
  font-family: var(--h3-font);
  font-style: var(--h3-style);
  font-weight: var(--h3-weight);
  font-size: 1.2rem;
}
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, .button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
code {
  font-family: Consolas, "Courier New", monospace;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
  font-size: 0.95em;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 22px;
  position: relative;
}

section { display: grid; gap: 20px; }
.lead { font-size: 1.2rem; color: var(--text2); max-width: 38rem; }
.muted { color: var(--hint); }

/* App heading: icon beside name and pitch. */
.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
}
.app-icon {
  width: 128px;
  height: 128px;
  border-radius: 28px;
  display: block;
}
.hero .text { display: grid; gap: 12px; }
@media (max-width: 560px) {
  .hero { grid-template-columns: 1fr; }
  .app-icon { width: 96px; height: 96px; border-radius: 22px; }
}

/* Main button, and the quiet "coming soon" badge. */
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.button {
  display: inline-block;
  background: var(--button);
  color: var(--on-button);
  font-weight: 700;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 999px;
}
.badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Home page header: the KodaWorks logo. */
.logo { margin: 0; line-height: 0; }
.logo img { width: min(100%, 420px); height: auto; display: block; }
/* In dark mode the logo sits on a cream badge, so its navy lettering stays visible. */
@media (prefers-color-scheme: dark) {
  .logo img { background: #fff6ec; border-radius: 20px; padding: 10px 16px; }
}

/* A card of plain paragraphs, such as a note from the developer. */
.note { display: grid; gap: 14px; max-width: 46rem; }
.signature { font-style: italic; color: var(--text2); }

/* A policy page: one narrow reading column. */
.policy { display: grid; gap: 16px; max-width: 44rem; }
.policy h2 { font-size: 1.4rem; margin-top: 20px; }
.policy ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.dates { color: var(--hint); }

/* Grid of feature cards. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 16px;
}
.grid .card { display: grid; gap: 8px; align-content: start; }

/* A card's title with an icon tile before it (like the app's menu rows). */
.card-title { display: flex; align-items: center; gap: 12px; }
.icon-tile {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--card2);
  color: var(--accent);
  font-size: 20px;
  display: grid;
  place-items: center;
}

/* Free and Pro, side by side. */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 16px;
}
.compare .card { display: grid; gap: 12px; align-content: start; }
.compare ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.compare .pro { background: var(--card2); border-color: var(--accent); }

/* Home page: one card per app, with a stripe in the app's own colour down its left edge. */
.apps { display: grid; gap: 16px; }
.app-card { border-left: 6px solid var(--app-colour, var(--accent)); }
.app-link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.app-link .app-icon { width: 88px; height: 88px; border-radius: 20px; }
.app-link:hover h3, .app-link:focus-visible h3 { color: var(--accent); text-decoration: underline; }
.app-link .text { display: grid; gap: 4px; }
@media (max-width: 420px) {
  .app-link { grid-template-columns: 1fr; }
}

footer {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  color: var(--hint);
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
