:root {
  --bg: #eef1ef;
  --ink: #1b2530;
  --muted: #56626e;
  --rule: #cdd3d1;
  --link: #1f5b43;
  --focus: #2f7df6;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Public Sans", ui-sans-serif, system-ui, sans-serif;

  --gutter: clamp(16px, 5vw, 48px);
  --max: 1080px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141a20;
    --ink: #e4e9ec;
    --muted: #9aa6b0;
    --rule: #2c3640;
    --link: #7fcca5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141a20;
  --ink: #e4e9ec;
  --muted: #9aa6b0;
  --rule: #2c3640;
  --link: #7fcca5;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

img { display: block; max-width: 100%; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 6px;
}
.skip:focus { left: 8px; z-index: 10; }

/* Top bar */
.top-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 20px;
}
.mark {
  font-family: var(--display); font-weight: 800; font-size: 1.05rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
  border: 2px solid currentColor; border-radius: 9px; padding: 3px 7px 2px;
}
.top nav { display: flex; gap: clamp(16px, 4vw, 32px); }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.top nav a:hover { color: var(--link); }

/* Hero */
.hero { padding-block: clamp(48px, 11vw, 132px) clamp(56px, 9vw, 104px); }
.hero h1 {
  font-family: var(--display);
  font-variation-settings: "opsz" 96;
  font-weight: 800;
  font-size: clamp(3.25rem, 12.5vw, 9.5rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
  margin: 0 0 clamp(20px, 3vw, 32px);
  margin-left: -0.05em;
}
.lede {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.35rem, 3.2vw, 2.1rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  max-width: 24ch;
  margin: 0 0 clamp(36px, 5vw, 52px);
  color: var(--muted);
}

.shelf { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.shelf a {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.98rem;
}
.shelf img { width: 44px; height: 44px; border-radius: 10px; }
.shelf a:hover span { text-decoration: underline; text-underline-offset: 0.2em; }

/* App bands: each one borrows its app's own colors */
.app { color: var(--app-ink); background: var(--app-bg); padding-block: clamp(56px, 9vw, 104px); }
.app-inner {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.icon {
  width: 180px; height: 180px;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 18px 40px -18px rgb(0 0 0 / 0.6);
}
.app h2 {
  font-family: var(--display);
  font-variation-settings: "opsz" 72;
  font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
}
.app-lede { font-size: 1.15rem; line-height: 1.6; max-width: 60ch; margin: 0 0 22px; }
.facts { margin: 0 0 22px; padding: 0; list-style: none; max-width: 60ch; }
.facts li { position: relative; padding-left: 26px; margin-bottom: 6px; color: var(--app-soft); }
.facts li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 10px; height: 10px; border-radius: 3px; background: var(--app-accent);
}
.where { margin: 0 0 26px; font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; min-height: 46px;
  padding: 10px 20px; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none;
  color: var(--app-ink);
  border: 1.5px solid var(--app-line);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--app-ink); background: rgb(255 255 255 / 0.06); }
.btn--primary { background: var(--app-accent); border-color: var(--app-accent); color: var(--app-on-accent); }
.btn--primary:hover { background: var(--app-accent-hover); border-color: var(--app-accent-hover); }
.app :focus-visible { outline-color: var(--app-ink); }

.app--spades {
  --app-bg: #10201a;
  --app-ink: #f3efe4;
  --app-soft: #c9cfc4;
  --app-line: #4b5d53;
  --app-accent: #f3efe4;
  --app-accent-hover: #ffffff;
  --app-on-accent: #10201a;
}
.app--spc {
  --app-bg: #2e3e50;
  --app-ink: #f4f6f8;
  --app-soft: #cbd4dd;
  --app-line: #5d6d7e;
  --app-accent: #e67e22;
  --app-accent-hover: #f08f37;
  --app-on-accent: #1b1f2b;
}
.app--spc .facts li::before { background: #2ecc71; }
.app--parjamie {
  --app-bg: #1d2127;
  --app-ink: #eef0f2;
  --app-soft: #c2c7cd;
  --app-line: #525962;
  --app-accent: #d8412f;
  --app-accent-hover: #e65540;
  --app-on-accent: #ffffff;
  background-image: repeating-linear-gradient(0deg, rgb(255 255 255 / 0.018) 0 2px, transparent 2px 5px);
}
.app--parjamie .facts li::before { background: #f39a3b; }

/* About */
.about { padding-block: clamp(64px, 10vw, 120px); }
.about h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -0.03em; line-height: 1;
  margin: 0 0 clamp(28px, 4vw, 44px);
}
.about-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); }
.about-copy p { margin: 0 0 1.1em; max-width: 62ch; }
.about-copy p:first-child { font-size: 1.2rem; line-height: 1.55; }
.about-facts { margin: 0; border-top: 2px solid var(--ink); }
.about-facts div { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.about-facts dt { font-size: 0.88rem; color: var(--muted); margin-bottom: 2px; }
.about-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.foot { border-top: 1px solid var(--rule); }
.foot p { margin: 0; padding-block: 28px; color: var(--muted); font-size: 0.92rem; }

/* 404 */
.missing { padding-block: clamp(64px, 14vw, 160px); }
.missing h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 8vw, 5rem); letter-spacing: -0.04em; line-height: 1; margin: 0 0 20px; }
.missing p { font-size: 1.15rem; color: var(--muted); margin: 0 0 12px; }

@media (max-width: 720px) {
  .app-inner { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .icon { width: 104px; height: 104px; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .shelf { flex-direction: column; }
  .top nav a[href^="mailto"] { display: none; }
}
