/* ---------------------------------------------------------------------------
   Shared styles for sidequestsoftware.ca.

   The look borrows from the apps' own pages: system type, white cards on a
   soft grey ground, pill buttons, and a dark mode that follows the device.
   Each project card carries a trace of its app's accent, the way Spool's
   tinted backgrounds do.
--------------------------------------------------------------------------- */
:root {
  --bg: #f5f5f7;
  --raised: #ffffff;
  --sunken: #ececf0;
  --border: rgba(0, 0, 0, 0.08);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --ink: #1d1d1f;
  --on-ink: #ffffff;

  /* eMote: the warm blush of its icon. Spool: its brand gradient. */
  --emote: #c47b5e;
  --emote-text: #a35a3f;
  --spool: #eb3349;
  --spool-end: #f45c43;
  --spool-text: #d0263c;
  --live: #30b650;

  /* The two apps blended into one: Sidequest's own accent. */
  --blend: linear-gradient(100deg, #d1896b 0%, #eb3349 62%, #f45c43 100%);

  /* The same note styling eMote's support page uses. */
  --note-bg: #fff4e5;
  --note-border: #ffd8a8;
  --note-text: #6e4b1f;

  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.05), 0 18px 44px rgba(0, 0, 0, 0.1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
             Roboto, Helvetica, Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --raised: #1c1c1e;
    --sunken: #2c2c2e;
    --border: rgba(255, 255, 255, 0.09);
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --ink: #f5f5f7;
    --on-ink: #1d1d1f;

    --emote: #e3a488;
    --emote-text: #eab39b;
    --spool-end: #ff6b52;
    --spool-text: #ff6b6b;

    --note-bg: rgba(255, 170, 60, 0.1);
    --note-border: rgba(255, 170, 60, 0.28);
    --note-text: #f3c98b;

    --shadow: none;
    --shadow-lift: 0 18px 44px rgba(0, 0, 0, 0.5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
[id] { scroll-margin-top: 72px; }
:focus-visible { outline: 3px solid var(--spool); outline-offset: 3px; border-radius: 8px; }

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

/* --- Header -------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand svg { width: 26px; height: 26px; flex: none; }
.brand-sub { color: var(--muted); font-weight: 500; }
.site-nav { display: flex; gap: 22px; font-size: 15px; }
.site-nav a { color: var(--muted); text-decoration: none; transition: color 0.15s ease; }
.site-nav a:hover { color: var(--text); }

/* --- Buttons & pills ----------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
  background: var(--sunken);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(0.95); }
.btn:active { transform: scale(0.97); }
.btn.ink { background: var(--ink); color: var(--on-ink); }
.btn.spool { background: linear-gradient(120deg, var(--spool), var(--spool-end)); color: #fff; }
.btn.kofi { background: #ff5e5b; color: #fff; }
.btn .arrow { font-size: 0.85em; opacity: 0.75; }
@media (prefers-color-scheme: dark) {
  .btn:hover { filter: brightness(1.15); }
  .btn.ink:hover { filter: brightness(0.9); }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--raised);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  animation: live 2.2s ease-out infinite;
}
@keyframes live {
  0%       { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent); }
  70%, to  { box-shadow: 0 0 0 8px transparent; }
}

/* The dashed "?" tile: the app that hasn't been chosen yet. */
.placeholder-icon {
  display: grid;
  place-items: center;
  border-radius: 22.5%;
  border: 2px dashed color-mix(in srgb, var(--muted) 45%, transparent);
  background: var(--raised);
  color: var(--muted);
  font-weight: 600;
}

/* --- Hero ---------------------------------------------------------------- */

.hero { padding: 72px 0 56px; text-align: center; }

/* The app icons, fanned like a hand of cards. Hover spreads them out. */
.stack { display: flex; justify-content: center; margin-bottom: 36px; }
.stack > * {
  width: 96px;
  height: 96px;
  margin: 0 -10px;
  border-radius: 22.5%;
  transition: transform 0.4s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.stack .s1 { transform: rotate(-9deg) translateY(6px); filter: drop-shadow(0 10px 22px rgba(196, 123, 94, 0.35)); }
.stack .s2 { transform: rotate(2deg); z-index: 1; filter: drop-shadow(0 10px 22px rgba(225, 19, 58, 0.3)); }
.stack .s3 { transform: rotate(11deg) translateY(8px); font-size: 38px; }
.stack:hover .s1 { transform: rotate(-14deg) translate(-16px, 4px); }
.stack:hover .s2 { transform: rotate(0deg) translateY(-8px); }
.stack:hover .s3 { transform: rotate(16deg) translate(16px, 6px); }

.hero h1 {
  margin: 22px 0 20px;
  font-family: var(--display);
  font-size: clamp(40px, 8.4vw, 76px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.grad {
  background: var(--blend);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  max-width: 34em;
  margin: 0 auto;
  font-size: clamp(17px, 2.3vw, 20px);
  color: var(--muted);
}
.lede strong { color: var(--text); font-weight: 600; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

/* --- Sections ------------------------------------------------------------ */

.section { padding: 48px 0; }
.section-head { margin-bottom: 28px; }
.section-head h2,
.hello h2 {
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.022em;
}
.section-head p { margin-top: 6px; color: var(--muted); }

/* --- Project cards ------------------------------------------------------- */

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.project {
  --accent: var(--ink);
  --accent-text: var(--muted);
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 10%, var(--raised)) 0%,
    var(--raised) 42%
  );
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.project:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.project.emote { --accent: var(--emote); --accent-text: var(--emote-text); }
.project.spool { --accent: var(--spool); --accent-text: var(--spool-text); }

.project-head { display: flex; align-items: center; gap: 16px; }
.project-icon {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 22.5%;
  box-shadow:
    0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent),
    0 1px 2px rgba(0, 0, 0, 0.08);
}
.project-title { flex: 1; min-width: 0; }
.project h3 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.tagline { margin-top: 2px; font-size: 15px; font-weight: 500; color: var(--accent-text); }
.badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.desc { margin-top: 18px; font-size: 16px; line-height: 1.6; }

.platforms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.platforms li {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--sunken);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
/* A platform that's still in progress: dashed, like the "?" tile. */
.platforms li.soon {
  padding: 4px 11px;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  background: transparent;
  color: var(--accent-text);
}

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-top: 18px;
  font-size: 14.5px;
}
.features li { display: flex; align-items: center; gap: 10px; }
.features li::before {
  content: "✓";
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 800;
}

.note {
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px solid var(--note-border);
  border-radius: 12px;
  background: var(--note-bg);
  color: var(--note-text);
  font-size: 14px;
  line-height: 1.5;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 24px; }

.project.next {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  padding: 22px 28px;
  border: 2px dashed color-mix(in srgb, var(--muted) 30%, transparent);
  background: transparent;
  box-shadow: none;
}
.project.next:hover { transform: none; box-shadow: none; }
.project.next .placeholder-icon { flex: none; width: 56px; height: 56px; font-size: 24px; }
.project.next h3 { font-size: 19px; }
.project.next p { color: var(--muted); font-size: 15px; }

/* --- Say hello ----------------------------------------------------------- */

.hello {
  padding: 44px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--raised);
  box-shadow: var(--shadow);
  text-align: center;
}
.hello p { max-width: 30em; margin: 8px auto 0; color: var(--muted); }
.hello .actions { justify-content: center; }

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  padding-top: 24px;
  padding-bottom: 56px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* --- Document pages (privacy) -------------------------------------------- */

.doc { max-width: 720px; padding-top: 48px; padding-bottom: 32px; }
.doc h1 {
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 46px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.doc .updated { margin-top: 8px; color: var(--muted); font-size: 15px; }
.doc .card {
  margin-top: 28px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--raised);
  box-shadow: var(--shadow);
}
.doc h2 { margin: 28px 0 8px; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.doc p, .doc li { color: var(--muted); line-height: 1.65; }
.doc .lead { font-size: 19px; color: var(--text); }
.doc ul { list-style: disc; padding-left: 1.2em; }
.doc li + li { margin-top: 8px; }
.doc strong { color: var(--text); font-weight: 600; }
.doc a { color: var(--spool-text); text-decoration: none; }
.doc a:hover { text-decoration: underline; }

/* --- 404 ----------------------------------------------------------------- */

.notfound {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 57px);
  padding: 48px 24px;
  text-align: center;
}
.notfound .placeholder-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  font-size: 36px;
  transform: rotate(8deg);
}
.notfound h1 {
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.notfound p { margin-top: 10px; color: var(--muted); }
.notfound .btn { margin-top: 24px; }

/* --- Motion & small screens ---------------------------------------------- */

.rise { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.rise.d1 { animation-delay: 0.06s; }
.rise.d2 { animation-delay: 0.12s; }
.rise.d3 { animation-delay: 0.18s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  .projects { grid-template-columns: 1fr; }
  .project { padding: 24px; }
  .project.next { padding: 20px 24px; }
  .hero { padding: 48px 0 40px; }
  .stack > * { width: 80px; height: 80px; }
  .stack .s3 { font-size: 32px; }
}
@media (max-width: 440px) {
  .features { grid-template-columns: 1fr; }
  .site-nav { gap: 16px; }
  .doc .card { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .live, .rise { animation: none; }
  .stack > *, .project, .btn { transition: none; }
  .project:hover { transform: none; }
}
