:root {
  color-scheme: light;

  --cream: #fffbf2;
  --paper: #fffefb;
  --ink: #3a2516;
  --ink-soft: #6b5443;
  --line: #efe3cf;
  --link: #a8402f;

  /* The five colours of the Yummiable lettering. */
  --red: #c35142;
  --orange: #db8948;
  --yellow: #e1bd55;
  --green: #83a257;
  --brown: #875d3b;

  --stripe: linear-gradient(90deg,
    var(--red) 0 20%, var(--orange) 20% 40%, var(--yellow) 40% 60%,
    var(--green) 60% 80%, var(--brown) 80% 100%);

  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Arial Rounded MT Bold", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font: 400 1rem/1.65 var(--sans);
}

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

img { max-width: 100%; height: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Landing page ---------- */

.home { position: relative; isolation: isolate; }

.home::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("/assets/pattern.svg") center / 240px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 46%, transparent 35%, #000 100%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 46%, transparent 35%, #000 100%);
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 3rem 16px 2rem;
  text-align: center;
}

.logo-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 0.9rem);
  animation: arrive 0.7s cubic-bezier(0.2, 0.8, 0.2, 1.2) both;
}

.hero-apple { width: min(280px, 64vw); }

.hero-word {
  position: relative;
  line-height: 0;
}

.hero-word img { width: min(380px, 78vw); }

/* Top right of the lettering. */
.hero-word .tm {
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 2px;
  font: 700 clamp(0.75rem, 2.4vw, 1rem)/1 var(--round);
  color: var(--ink-soft);
}

.tagline {
  margin: 0;
  max-width: 36ch;
  text-wrap: balance;
  font: 600 clamp(1.1rem, 2.8vw, 1.35rem)/1.4 var(--round);
  color: var(--ink-soft);
}

.launch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.soon {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.6rem 1.25rem 0.6rem 1rem;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(120, 80, 40, 0.1);
  font: 700 1rem/1.3 var(--round);
  color: var(--red);
}

.platforms {
  margin: 0;
  font: 600 0.875rem/1.3 var(--round);
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.dots { display: inline-flex; gap: 3px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; }
.dots i:nth-child(1) { background: var(--red); }
.dots i:nth-child(2) { background: var(--orange); }
.dots i:nth-child(3) { background: var(--yellow); }
.dots i:nth-child(4) { background: var(--green); }
.dots i:nth-child(5) { background: var(--brown); }

/* Movement only, so the logo is never invisible if the animation does not run. */
@keyframes arrive {
  from { transform: translateY(10px) scale(0.97); }
  to { transform: none; }
}

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

.site-footer {
  padding: 1.5rem 16px 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.25rem;
  margin-bottom: 0.5rem;
}

.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--link); }
.site-footer p { margin: 0; }

/* ---------- Legal pages ---------- */

.site-header {
  position: relative;
  isolation: isolate;
  padding: 1.25rem 16px 1.5rem;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("/assets/pattern.svg") 0 0 / 200px;
  opacity: 0.4;
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: var(--stripe);
}

.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.9rem 0.35rem 0.45rem;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 4px 14px rgba(120, 80, 40, 0.1);
  text-decoration: none;
}

.brand-apple { width: 40px; }
.brand-word { width: 131px; }

.brand .tm {
  align-self: flex-start;
  margin: 0.3rem 0 0 -0.5rem;
  font: 700 0.65rem/1 var(--round);
  color: var(--ink-soft);
}

.doc-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 4px 14px rgba(120, 80, 40, 0.1);
}

.doc-tabs a {
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  font: 600 0.92rem/1.2 var(--round);
  color: var(--ink-soft);
  text-decoration: none;
}

.doc-tabs a:hover { color: var(--ink); background: var(--cream); }
.doc-tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }

.doc-layout {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 16px 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.doc {
  min-width: 0;
  padding: 2.5rem clamp(1.25rem, 5vw, 3rem) 3rem;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 1px 0 var(--line), 0 10px 40px rgba(120, 80, 40, 0.08);
}

.doc h1 {
  margin: 0 0 0.75rem;
  font: 800 clamp(1.9rem, 5vw, 2.5rem)/1.15 var(--round);
  letter-spacing: -0.01em;
}

.doc h2 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 2.5rem 0 0.75rem;
  font: 700 1.3rem/1.3 var(--round);
  scroll-margin-top: 1.5rem;
}

.doc h3 {
  margin: 1.75rem 0 0.5rem;
  font: 700 1.08rem/1.35 var(--round);
  scroll-margin-top: 1.5rem;
}

.num {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--c, var(--red));
  color: #fff;
  font-size: 0.95rem;
  transform: translateY(-0.1rem);
}

.doc p, .doc li { max-width: 72ch; }
.doc p { margin: 0 0 1rem; }
.doc ul, .doc ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
.doc li { margin-bottom: 0.45rem; padding-left: 0.2rem; scroll-margin-top: 1.5rem; }
.doc li::marker { color: var(--orange); font-weight: 700; }
.doc p[id] { scroll-margin-top: 1.5rem; }
.doc p > strong:first-child { color: var(--ink); }

.doc .meta {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: var(--cream);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.doc :target {
  border-radius: 8px;
  animation: flash 1.6s ease-out;
}

@keyframes flash {
  from { background: rgba(225, 189, 85, 0.35); }
  to { background: transparent; }
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.35;
}

.toc li { margin: 0; }

.toc a {
  display: block;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
}

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

.toc-title {
  margin: 0 0 0.5rem;
  padding: 0 0.6rem;
  font: 700 0.78rem/1.2 var(--round);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.toc-side { display: none; }

.toc-inline {
  margin: 0 0 1.75rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.toc-inline summary {
  cursor: pointer;
  font: 700 0.95rem/1.4 var(--round);
}

.toc-inline ol { margin-top: 0.6rem; }
.toc-inline a:hover { background: var(--cream); }

@media (min-width: 960px) {
  .doc-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .toc-side {
    display: block;
    position: sticky;
    top: 1.5rem;
    align-self: start;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding-top: 0.5rem;
  }
  .toc-inline { display: none; }
}

/* ---------- Not found ---------- */

.lost h1 {
  margin: 0;
  font: 800 clamp(1.6rem, 5vw, 2.2rem)/1.2 var(--round);
}

.lost-apple { width: min(180px, 50vw); }

@media (prefers-reduced-motion: reduce) {
  .logo-mark, .doc :target { animation: none; }
}

@media print {
  body { background: #fff; }
  .site-header, .toc, .site-footer, .home::before { display: none; }
  .doc-layout { display: block; padding: 0; }
  .doc { box-shadow: none; padding: 0; }
  .num { background: none; color: inherit; padding: 0; min-width: 0; }
  a { color: inherit; }
}
