/* ShroomCap Games — site styles
   Tokens first, then base elements, layout pieces, page sections and the privacy policy.
   The Fredoka @font-face lives in fonts.css. */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  --ink: #1f2326;            /* the logo's charcoal */
  --ink-soft: #3a4045;
  --muted: #5b6268;
  --paper: #faf6ef;
  --paper-2: #f2ebdf;
  --card: #ffffff;
  --line: #e3dacb;
  --cap: #d9482f;            /* toadstool red: the accent */
  --cap-ink: #b23a24;        /* accent text and links on paper */
  --cap-soft: #fbe2da;
  --sun: #f5b83d;
  --sun-soft: #fdf0d2;
  --moss: #2f6b4f;
  --on-ink: #faf6ef;
  --band: #1f2326;           /* contact band background */
  --band-muted: #b9c0c5;

  --font-display: "Fredoka", ui-rounded, "Arial Rounded MT Bold", "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgb(31 35 38 / 0.06), 0 2px 8px rgb(31 35 38 / 0.05);
  --shadow: 0 2px 4px rgb(31 35 38 / 0.05), 0 12px 32px rgb(31 35 38 / 0.10);
  --shadow-lg: 0 4px 10px rgb(31 35 38 / 0.06), 0 24px 60px rgb(31 35 38 / 0.16);

  --max: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 72px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --ink: #f3eee6;
    --ink-soft: #d9d3c9;
    --muted: #a7aeb4;
    --paper: #131618;
    --paper-2: #191d20;
    --card: #1f2427;
    --line: #2e3438;
    --cap: #ff7458;
    --cap-ink: #ff8a70;
    --cap-soft: #3a211b;
    --sun: #e8a93a;
    --sun-soft: #33291a;
    --moss: #7cc39f;
    --on-ink: #131618;
    --band: #1f2427;
    --band-muted: #a7aeb4;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow: 0 2px 4px rgb(0 0 0 / 0.25), 0 12px 32px rgb(0 0 0 / 0.35);
    --shadow-lg: 0 4px 10px rgb(0 0 0 / 0.3), 0 24px 60px rgb(0 0 0 / 0.45);
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main {
  flex: 1;
}

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

img {
  height: auto;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: var(--cap-ink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2.5px;
}

:focus-visible {
  outline: 3px solid var(--cap);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--sun);
  color: #1f2326;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0.7em 1.35em;
  border: 2px solid var(--btn-bg);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-out), background-color 0.2s;
  box-shadow: 0 3px 0 rgb(0 0 0 / 0.18);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 rgb(0 0 0 / 0.18);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.18);
}

.btn--accent {
  --btn-bg: var(--cap);
  --btn-fg: #fff;
}

.btn--ghost {
  --btn-fg: var(--ink);
  background: transparent;
  box-shadow: none;
}

.btn--ghost:hover {
  background: var(--paper-2);
  box-shadow: none;
}

.btn svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

@media (prefers-color-scheme: dark) {
  .btn--accent {
    --btn-fg: #1a0f0c;
  }
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}

.brand svg {
  height: 34px;
  width: auto;
  fill: currentColor;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s;
}

.site-nav a:hover {
  background: var(--paper-2);
}

.site-nav a[aria-current="page"] {
  background: var(--paper-2);
  font-weight: 600;
}

.site-nav .nav-cta {
  margin-left: 8px;
  background: var(--ink);
  color: var(--paper);
  padding-inline: 18px;
}

.site-nav .nav-cta:hover {
  background: var(--ink-soft);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-right: -8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--paper-2);
}

.nav-toggle__bars {
  position: relative;
  width: 22px;
  height: 14px;
}

.nav-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease-out), opacity 0.2s, top 0.3s var(--ease-out);
}

.nav-toggle__bars span:nth-child(1) { top: 0; }
.nav-toggle__bars span:nth-child(2) { top: 5.75px; }
.nav-toggle__bars span:nth-child(3) { top: 11.5px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  top: 5.75px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) {
  top: 5.75px;
  transform: rotate(-45deg);
}

@media (max-width: 760px) {
  :root {
    --header-h: 64px;
  }

  .brand svg {
    height: 28px;
  }

  .js .nav-toggle {
    display: inline-flex;
  }

  .js .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.25s var(--ease-out), visibility 0s linear 0.25s;
  }

  .js .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.2s, transform 0.25s var(--ease-out), visibility 0s;
  }

  .js .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .js .site-nav a {
    min-height: 52px;
    padding: 0 16px;
    font-size: 1.1875rem;
  }

  .js .site-nav .nav-cta {
    margin: 8px 0 0;
    justify-content: center;
  }

  /* Without JavaScript the links simply wrap under the logo. */
  html:not(.js) .site-header__inner {
    height: auto;
    flex-wrap: wrap;
    padding-block: 12px;
  }

  html:not(.js) .site-nav ul {
    flex-wrap: wrap;
  }
}

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

.section {
  padding-block: clamp(64px, 10vw, 120px);
}

.section--alt {
  background: var(--paper-2);
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section-head h2 {
  font-size: clamp(2rem, 4.6vw, 3rem);
}

.section-head p {
  color: var(--muted);
  font-size: 1.125rem;
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--cap-soft);
  color: var(--cap-ink);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cap);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cap) 22%, transparent);
}

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

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(40px, 7vw, 96px) clamp(64px, 9vw, 120px);
}

.hero::before {
  /* faint spore dots, like a cap's spots */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1.5px, transparent 1.6px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 75% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 75% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
}

.hero h1 {
  font-size: clamp(2.75rem, 7.4vw, 5.25rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}

.hero h1 .highlight {
  position: relative;
  white-space: nowrap;
  color: var(--cap);
}

.hero h1 .highlight svg {
  position: absolute;
  left: -2%;
  bottom: -0.16em;
  width: 104%;
  height: 0.32em;
  fill: none;
  stroke: var(--sun);
  stroke-width: 9;
  stroke-linecap: round;
  overflow: visible;
}

.js .hero h1 .highlight path {
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: draw-underline 0.9s 0.45s var(--ease-out) forwards;
}

@keyframes draw-underline {
  to { stroke-dashoffset: 0; }
}

.hero__lead {
  max-width: 34ch;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: clamp(1.125rem, 2vw, 1.3125rem);
  line-height: 1.55;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 480px;
  width: 100%;
  margin-inline: auto;
}

.hero__sun {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  /* Toadstool red in both themes, so the white mushroom always reads the same. */
  background:
    radial-gradient(circle at 35% 30%, #f2735a 0%, #d9482f 55%, #b3361f 100%);
  box-shadow: inset 0 -18px 40px rgb(80 10 0 / 0.18), var(--shadow-lg);
}

.hero__ring {
  position: absolute;
  inset: 0;
  border: 2px dashed color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 50%;
  animation: spin 60s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.mushroom-btn {
  position: relative;
  z-index: 1;
  width: 64%;
  padding: 0;
  border: 0;
  background: none;
  color: #ffffff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: float 5.5s ease-in-out infinite;
}

.mushroom-btn svg {
  width: 100%;
  height: auto;
  overflow: visible;
  fill: currentColor;
  filter: drop-shadow(0 14px 0 rgb(110 20 6 / 0.35));
}

.mushroom-btn .cap {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.mushroom-btn .stem {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.mushroom-btn.is-booping .cap {
  animation: boop-cap 0.7s var(--ease-out);
}

.mushroom-btn.is-booping .stem {
  animation: boop-stem 0.7s var(--ease-out);
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-12px) rotate(1.5deg); }
}

@keyframes boop-cap {
  0% { transform: none; }
  18% { transform: translateY(6%) scale(1.12, 0.82); }
  42% { transform: translateY(-14%) scale(0.94, 1.08); }
  64% { transform: translateY(2%) scale(1.04, 0.96); }
  82% { transform: translateY(-2%) scale(0.99, 1.01); }
  100% { transform: none; }
}

@keyframes boop-stem {
  0% { transform: none; }
  18% { transform: scale(1.1, 0.86); }
  42% { transform: scale(0.95, 1.06); }
  100% { transform: none; }
}

.spore {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 42%;
  width: var(--size, 10px);
  height: var(--size, 10px);
  border-radius: 50%;
  background: var(--spore, var(--cap));
  pointer-events: none;
  animation: spore-burst 0.9s var(--ease-out) forwards;
}

@keyframes spore-burst {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; }
}

.ambient-spore {
  position: absolute;
  bottom: 18%;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.8);
  opacity: 0;
  animation: drift var(--d, 7s) var(--delay, 0s) ease-in infinite;
  pointer-events: none;
}

@keyframes drift {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: 0.55; }
  100% { transform: translate(var(--sway, 20px), -280px); opacity: 0; }
}

.hero__hint {
  position: absolute;
  right: 4%;
  bottom: 6%;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  transform: rotate(-6deg);
  pointer-events: none;
}

html:not(.js) .hero__hint {
  display: none;
}

@media (max-width: 860px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }

  .hero__art {
    max-width: min(300px, 70vw);
    order: -1;
  }

  .hero__lead {
    max-width: 40ch;
  }
}

/* ---------- Games ---------- */

.game-feature {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.game-feature__media {
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: #1c6fe0;
}

.game-feature__media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  transition: transform 0.8s var(--ease-out);
}

.game-feature:hover .game-feature__media > img {
  transform: scale(1.025);
}

.game-feature__body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  padding: 0 clamp(20px, 4vw, 48px) clamp(24px, 4vw, 48px);
}

.game-feature__intro p {
  margin: 0;
  font-size: 1.125rem;
}

.game-feature__details {
  display: flex;
  flex-direction: column;
  padding-top: clamp(20px, 3vw, 32px);
}

.game-feature__title {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
}

.game-feature__icon {
  position: relative;
  width: clamp(84px, 10vw, 112px);
  height: auto;
  aspect-ratio: 1;
  flex: none;
  margin-top: clamp(-56px, -5vw, -40px);
  border: 4px solid var(--card);
  border-radius: 26%;
  box-shadow: var(--shadow);
}

.game-feature__title h3 {
  margin: 0 0 6px;
  font-size: clamp(1.75rem, 3.4vw, 2.375rem);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.feature-list svg {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex: none;
  color: var(--cap);
}

.store-row {
  margin-top: auto;
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 18px 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.15;
}

.store-btn svg {
  width: 24px;
  height: 24px;
  flex: none;
}

.store-btn small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.store-btn strong {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
}

a.store-btn:hover {
  border-color: var(--ink);
}

@media (max-width: 860px) {
  .game-feature__media {
    aspect-ratio: 1600 / 782;
  }

  .game-feature__body {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Screenshot strip */

.shots {
  margin-top: clamp(32px, 5vw, 48px);
}

.shots__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.shots__head h3 {
  margin: 0;
  font-size: 1.375rem;
}

.shots__nav {
  display: flex;
  gap: 8px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, opacity 0.2s, transform 0.2s var(--ease-spring);
}

.icon-btn:hover:not(:disabled) {
  border-color: var(--ink);
  transform: scale(1.06);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

html:not(.js) .shots__nav {
  display: none;
}

.shots__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(200px, 22vw, 250px);
  gap: clamp(14px, 2vw, 22px);
  margin: 0 calc(var(--gutter) * -1);
  padding: 8px var(--gutter) 28px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  list-style: none;
}

.shots__track li {
  scroll-snap-align: start;
}

.shots__track figure {
  margin: 0;
}

.shots__track img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 22px;
  border: 5px solid var(--ink);
  background: var(--paper-2);
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease-spring);
}

.shots__track li:hover img {
  transform: translateY(-6px) rotate(-1deg);
}

.shots__track figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
}

/* ---------- About ---------- */

.about__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.5vw, 24px);
}

.value-card {
  padding: clamp(24px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.value-card__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: var(--sun-soft);
  color: var(--ink);
}

.value-card:nth-child(2) .value-card__icon {
  background: var(--cap-soft);
}

.value-card:nth-child(3) .value-card__icon {
  background: color-mix(in srgb, var(--moss) 16%, var(--card));
}

.value-card__icon svg {
  width: 28px;
  height: 28px;
}

.value-card h3 {
  font-size: 1.375rem;
}

.value-card p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  .about__grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Contact band ---------- */

.contact {
  padding-block: clamp(32px, 6vw, 72px) clamp(64px, 10vw, 120px);
}

.contact__card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 32px;
  padding: clamp(32px, 6vw, 72px);
  border-radius: var(--radius-lg);
  background: var(--band);
  color: #faf6ef;
}

.contact__card::after {
  /* giant mushroom watermark */
  content: "";
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 255 255 / 0.06) 0 40%, transparent 41%);
  pointer-events: none;
}

.contact__card h2 {
  font-size: clamp(2rem, 4.6vw, 3rem);
  color: #faf6ef;
}

.contact__card p {
  color: var(--band-muted);
  margin: 0;
  font-size: 1.125rem;
}

.contact__actions {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  justify-items: start;
}

.contact__email {
  color: #faf6ef;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  text-decoration-color: var(--sun);
  word-break: break-word;
}

.contact__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact .btn {
  --btn-bg: #faf6ef;
  --btn-fg: #1f2326;
}

.contact .btn--ghost {
  --btn-bg: rgb(250 246 239 / 0.35);
  --btn-fg: #faf6ef;
}

.contact .btn--ghost:hover {
  background: rgb(250 246 239 / 0.1);
}

@media (prefers-color-scheme: dark) {
  .contact__card {
    border: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .contact__card {
    grid-template-columns: 1fr;
  }
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 40px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}

.site-footer .brand svg {
  height: 28px;
}

.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.site-footer nav a:hover {
  text-decoration: underline;
}

.site-footer__legal {
  flex-basis: 100%;
  margin: 0;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.3s var(--ease-spring);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Reveal on scroll ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Privacy policy ---------- */

.policy-hero {
  padding-block: clamp(40px, 7vw, 80px) clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}

.policy-hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 4rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.policy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.policy-meta strong {
  color: var(--ink);
}

.policy-intro {
  max-width: 68ch;
  font-size: 1.125rem;
}

.tldr {
  max-width: 820px;
  margin-top: 28px;
  padding: clamp(20px, 3vw, 28px) clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-left: 6px solid var(--cap);
  border-radius: var(--radius);
  background: var(--card);
}

.tldr h2 {
  font-size: 1.375rem;
  margin-bottom: 12px;
}

.tldr ul {
  margin: 0;
  padding-left: 1.2em;
}

.tldr li + li {
  margin-top: 6px;
}

.tldr li::marker {
  color: var(--cap);
}

.policy-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-block: clamp(40px, 6vw, 72px) clamp(64px, 9vw, 112px);
}

.policy-page {
  padding-block: clamp(40px, 6vw, 72px) clamp(64px, 9vw, 112px);
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  font-size: 0.9375rem;
}

.toc summary {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  list-style: none;
  margin-bottom: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  border-left: 2px solid var(--line);
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: flex;
  gap: 8px;
  margin-left: -2px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  color: var(--muted);
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.toc a::before {
  content: counter(toc) ".";
  min-width: 1.4em;
  font-variant-numeric: tabular-nums;
}

.toc a:hover {
  color: var(--ink);
}

.toc a[aria-current="true"] {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--cap);
}

.policy {
  max-width: 74ch;
}

.policy section {
  padding-bottom: 12px;
}

.policy section + section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.policy h2 {
  display: flex;
  gap: 0.45em;
  font-size: clamp(1.625rem, 3vw, 2rem);
  margin-bottom: 18px;
}

.policy h2 .num {
  color: var(--cap);
}

.policy h3 {
  font-size: 1.25rem;
  margin: 28px 0 10px;
}

.policy ul,
.policy ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

.policy li + li {
  margin-top: 6px;
}

.policy li::marker {
  color: var(--muted);
}

.policy strong {
  font-weight: 650;
}

.note {
  margin: 20px 0;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--sun-soft);
  color: var(--ink);
}

.note p:last-child {
  margin-bottom: 0;
}

.table-wrap {
  margin: 20px 0 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.policy table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.policy th,
.policy td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.policy thead th {
  background: var(--paper-2);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
}

.policy tbody tr:last-child > * {
  border-bottom: 0;
}

.policy tbody th {
  width: 32%;
  font-weight: 650;
}

/* Tables with three or more columns scroll sideways on narrow screens rather than squeezing. */
.policy table.wide {
  min-width: 620px;
}

.policy table.wide tbody th {
  width: auto;
  min-width: 140px;
}

@media (max-width: 520px) {
  .policy th,
  .policy td {
    padding: 10px 12px;
  }
}

.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0 !important;
}

.steps > li {
  position: relative;
  padding-left: 2.4em;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  display: grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: 52px;
  height: 52px;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.25s var(--ease-out), visibility 0s linear 0.25s;
  box-shadow: var(--shadow);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.2s, transform 0.25s var(--ease-out), visibility 0s;
}

@media (max-width: 960px) {
  .policy-layout {
    /* minmax(0, …) keeps wide tables scrolling inside .table-wrap instead of widening the page */
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    position: static;
    max-height: none;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
  }

  .toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    cursor: pointer;
  }

  .toc summary::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-3px);
    transition: transform 0.2s;
  }

  .toc[open] summary {
    margin-bottom: 12px;
  }

  .toc[open] summary::after {
    transform: rotate(-135deg) translate(-2px, -2px);
  }
}

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

.lost {
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: clamp(64px, 12vw, 140px);
}

.lost img {
  width: 140px;
  margin: 0 auto 28px;
  transform: rotate(-12deg);
}

.lost h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
}

.lost p {
  max-width: 40ch;
  margin-inline: auto;
  color: var(--muted);
  margin-bottom: 28px;
}

/* ---------- Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ambient-spore {
    display: none;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toc,
  .back-to-top,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .policy-layout {
    display: block;
    padding: 0;
  }

  .policy-hero {
    background: none;
    border: 0;
    padding: 0 0 16px;
  }

  .policy a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
  }

  .policy a[href^="#"]::after {
    content: "";
  }

  .table-wrap {
    overflow: visible;
  }

  .policy table,
  .policy table.wide {
    min-width: 0;
  }

  .policy section + section {
    break-before: auto;
  }
}
