/* Fridge Madness — shared site styles. Palette mirrors app/lib/theme.dart. */
:root {
  --board: #0b0d10;
  --board-raised: #13161b;
  --board-edge: #1d2128;
  --text: #e8eaed;
  --muted: #9aa1ab;
  --frost: #7dd3fc;
  --ember: #fb923c;
  --slime: #a3e635;
  --tile: #f4f1ea;
  --tile-ink: #16181c;
  --radius: 14px;
  --maxw: 1080px;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--board);
  /* faint brushed-steel grain on the fridge door */
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% -10%, rgba(125, 211, 252, 0.08), transparent 60%);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  color: var(--frost);
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  color: #b5e6fd;
}

:focus-visible {
  outline: 2px solid var(--frost);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(100% - 2.5rem, var(--maxw));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--tile);
  color: var(--tile-ink);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

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

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 1.15rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 7px;
  background: var(--tile);
  color: var(--tile-ink);
  font-weight: 900;
  transform: rotate(-4deg);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), 0 6px 14px rgba(0, 0, 0, 0.45);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

/* ---------- magnets ---------- */
.magnet {
  display: inline-block;
  padding: 0.35em 0.7em;
  margin: 0.3em 0.2em;
  background: var(--tile);
  color: var(--tile-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.1;
  border-radius: 4px;
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.08),
    0 2px 0 rgba(0, 0, 0, 0.35),
    0 8px 16px rgba(0, 0, 0, 0.45);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.18s ease;
}

.magnet:hover {
  transform: rotate(0deg) translateY(-2px);
}

.magnet.frost { background: var(--frost); }
.magnet.ember { background: var(--ember); }
.magnet.slime { background: var(--slime); }

.t1 { --tilt: -2deg; }
.t2 { --tilt: 1.5deg; }
.t3 { --tilt: -1deg; }
.t4 { --tilt: 2.5deg; }
.t5 { --tilt: -3deg; }
.t6 { --tilt: 0.75deg; }

@media (prefers-reduced-motion: reduce) {
  .magnet { transition: none; }
  .magnet:hover { transform: rotate(var(--tilt, 0deg)); }
}

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.75rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.hero h1 .magnet {
  font-size: 0.9em;
}

.hero .lede {
  max-width: 40rem;
  margin: 0 auto 1.75rem;
  color: var(--muted);
  font-size: 1.2rem;
}

.sentence {
  max-width: 44rem;
  margin: 2.25rem auto 0;
  padding: 1.5rem 1rem;
  border: 1px dashed var(--board-edge);
  border-radius: var(--radius);
  font-size: clamp(1.1rem, 3.2vw, 1.45rem);
}

.sentences {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 72rem;
  margin: 2.25rem auto 0;
}

/* One row of four where the screen is wide enough; two by two, then one column, as it narrows. */
@media (min-width: 52rem) {
  .sentences { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 80rem) {
  .sentences { grid-template-columns: repeat(4, 1fr); }
}

.sentences {
  align-items: start;
}

.sentences img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.sentence-caption {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.examples-caption {
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--board-edge);
  border-radius: 999px;
  background: var(--board-raised);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.badge::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--slime);
  box-shadow: 0 0 10px var(--slime);
}

/* ---------- sections ---------- */
section {
  padding-block: clamp(2.25rem, 6vw, 4rem);
}

section + section {
  border-top: 1px solid var(--board-edge);
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
}

.section-intro {
  color: var(--muted);
  max-width: 44rem;
  margin: 0 0 2rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.card {
  background: var(--board-raised);
  border: 1px solid var(--board-edge);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

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

.card .accent {
  display: block;
  width: 2.25rem;
  height: 0.35rem;
  border-radius: 3px;
  margin-bottom: 1rem;
  background: var(--frost);
}

.card .accent.ember { background: var(--ember); }
.card .accent.slime { background: var(--slime); }

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 1.25rem 1.25rem 1.25rem 4.25rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0.75rem;
  top: 1.1rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 6px;
  background: var(--tile);
  color: var(--tile-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 8px 16px rgba(0, 0, 0, 0.45);
  transform: rotate(-2deg);
}

.steps li:nth-child(even)::before {
  transform: rotate(1.5deg);
}

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

/* ---------- long-form pages (privacy, support) ---------- */
.doc {
  max-width: 46rem;
  padding-block: clamp(2rem, 6vw, 3.5rem) 3rem;
}

.doc h1 {
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1.1;
  margin: 0 0 0.5rem;
}

.doc h2 {
  font-size: 1.45rem;
  margin-top: 2.25rem;
}

.doc .meta {
  color: var(--muted);
  margin: 0 0 2rem;
}

.doc li + li {
  margin-top: 0.35rem;
}

.callout {
  background: var(--board-raised);
  border: 1px solid var(--board-edge);
  border-left: 4px solid var(--frost);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}

.callout.ember { border-left-color: var(--ember); }

details {
  background: var(--board-raised);
  border: 1px solid var(--board-edge);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin: 0.75rem 0;
}

details[open] {
  padding-bottom: 1.1rem;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

details > *:not(summary) {
  color: #c9ced5;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--board-edge);
  padding-block: 2rem 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.site-footer a {
  color: var(--text);
  text-decoration: none;
}

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

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .site-header .wrap { justify-content: center; }
  .steps li { padding-left: 3.75rem; }
}
