/* ==========================================================================
   Felogics — shared stylesheet
   One file, no build step, no external requests.
   Sections: tokens · reset · typography · layout · components · pages · motion
   ========================================================================== */

/* --- tokens -------------------------------------------------------------- */

:root {
  --bg: #0b0b0f;
  --bg-raised: #101016;
  --surface: #14141a;
  --surface-hi: #1b1b23;

  --line: rgba(255, 255, 255, 0.08);
  --line-hi: rgba(255, 255, 255, 0.16);

  --ink: #f2f2f5;
  --ink-soft: #c3c3cd;
  --ink-muted: #8e8e9c;

  --accent: #f0b429;          /* studio */
  --accent-soft: rgba(240, 180, 41, 0.12);
  --pink: #e8467c;            /* reserved for Bake Box */
  --pink-soft: rgba(232, 70, 124, 0.12);
  --on-accent: #0b0b0f;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);

  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.9);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* The Bake Box pages keep the studio chrome but swap the accent. */
.theme-game {
  --accent: var(--pink);
  --accent-soft: var(--pink-soft);
  --on-accent: #ffffff;
}

/* --- reset --------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

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

::selection { background: var(--accent); color: var(--on-accent); }

/* --- typography ---------------------------------------------------------- */

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 680;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6.2vw, 4.1rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.1rem; letter-spacing: -0.015em; }

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

.lede {
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 46ch;
}

.muted { color: var(--ink-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  font-size: 0.78rem;
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* --- layout -------------------------------------------------------------- */

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

.section { padding-block: clamp(64px, 9vw, 116px); }
.section + .section { border-top: 1px solid var(--line); }

.section-head { max-width: 54ch; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head p { margin-top: 16px; color: var(--ink-muted); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-sm);
  font-weight: 620;
}
.skip-link:focus { left: 16px; }

/* --- header / footer ----------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 660;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
}
.wordmark svg { width: 24px; height: 24px; }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  font-size: 0.94rem;
  color: var(--ink-muted);
}
.nav a { transition: color 0.18s ease; }
.nav a:hover { color: var(--ink); }

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 48px 56px;
  color: var(--ink-muted);
  font-size: 0.92rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: center;
  justify-content: space-between;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.footer-links a { transition: color 0.18s ease; }
.footer-links a:hover { color: var(--ink); }

/* --- buttons & chips ----------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.97rem;
  font-weight: 620;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }

.btn-ghost {
  background: transparent;
  border-color: var(--line-hi);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--ink-muted); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

/* Store button in its pre-launch state: a real button, just not live yet.
   Swapping in the Play URL means changing the <span> to an <a href>. */
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 26px 12px 20px;
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: default;
}
.btn-store svg { width: 26px; height: 26px; flex: none; opacity: 0.55; }
.btn-store .store-line-1 {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.btn-store .store-line-2 {
  display: block;
  font-size: 1rem;
  font-weight: 640;
  letter-spacing: -0.015em;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 11px;
  border: 1px solid var(--line-hi);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}
.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

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

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  padding: 30px 28px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--line-hi); background: var(--surface-hi); }
.card h3 { margin-bottom: 12px; }
.card p { color: var(--ink-muted); font-size: 0.97rem; }

.card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.card-icon svg { width: 21px; height: 21px; }

/* Numbered list used for "How it plays" and "How we work". */
.steps { display: grid; gap: 28px; counter-reset: step; list-style: none; margin: 0; padding: 0; }
.step { position: relative; padding-left: 60px; counter-increment: step; }
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-hi);
  background: var(--surface);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 660;
  font-variant-numeric: tabular-nums;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--ink-muted); font-size: 0.97rem; }

/* The Bake Box wordmark is the shipped game logo, so the <h1> is an image.
   Its alt text carries the heading for screen readers and search engines. */
.title-lockup { margin: 0 0 6px; }
.title-lockup img { max-width: 420px; width: 100%; height: auto; }

/* --- hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: clamp(72px, 12vw, 148px) clamp(64px, 9vw, 112px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30% 30% 40% -20%;
  background: radial-gradient(50% 50% at 50% 50%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero > .wrap { position: relative; }
.hero .lede { margin-top: 26px; }

.hero-split {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
  grid-template-columns: 1fr;
}

/* --- phone frames -------------------------------------------------------- */

.phone {
  position: relative;
  width: 100%;
  max-width: 300px;
  padding: 9px;
  margin-inline: auto;
  background: linear-gradient(160deg, #26262f, #101014);
  border: 1px solid var(--line-hi);
  border-radius: 34px;
  box-shadow: var(--shadow);
}
.phone img { border-radius: 25px; width: 100%; }
.phone::after {
  content: "";
  position: absolute;
  top: 17px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
}

.phone-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: clamp(24px, 4vw, 44px);
  max-width: 660px;
}
.phone-pair .phone { max-width: 260px; }

/* Alternating feature rows on the Bake Box page. */
.split {
  display: grid;
  gap: clamp(40px, 6vw, 76px);
  align-items: center;
  grid-template-columns: 1fr;
}

/* --- feature list -------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--line);
}
/* Beside a screenshot the list only has half the width, so keep it to one
   column rather than letting two cramped ones wrap every line. */
.split .features { grid-template-columns: 1fr; }

.features li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 22px 24px;
  background: var(--surface);
  font-size: 0.96rem;
  color: var(--ink-soft);
}
.features svg { width: 17px; height: 17px; margin-top: 4px; flex: none; color: var(--accent); }

/* --- featured work card -------------------------------------------------- */

.work {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 60px);
  align-items: center;
  padding: clamp(28px, 4vw, 48px);
  background: linear-gradient(150deg, var(--surface-hi), var(--surface) 60%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.22s ease;
}
.work:hover { border-color: var(--line-hi); }
.work-icon {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  margin-bottom: 24px;
  border: 1px solid var(--line-hi);
}
.work h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.03em; margin-bottom: 14px; }
.work p { color: var(--ink-muted); max-width: 44ch; }
.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 26px;
  font-size: 0.86rem;
  color: var(--ink-muted);
}
.work-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 28px;
  font-weight: 620;
  color: var(--accent);
}
.work-link svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.work-link:hover svg { transform: translateX(4px); }

/* --- contact band -------------------------------------------------------- */

.contact {
  display: grid;
  gap: 28px;
  padding: clamp(36px, 5vw, 64px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  justify-items: center;
}
.contact h2 { max-width: 20ch; }
.contact p { color: var(--ink-muted); max-width: 48ch; }
.mail {
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-weight: 620;
  letter-spacing: -0.02em;
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding-bottom: 2px;
}

/* --- long-form prose (privacy) ------------------------------------------- */

.doc { display: grid; grid-template-columns: 1fr; gap: clamp(36px, 5vw, 64px); }

.toc {
  align-self: start;
  font-size: 0.9rem;
}
.toc p {
  margin-bottom: 14px;
  font-size: 0.74rem;
  font-weight: 640;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.toc a {
  display: block;
  padding: 7px 12px;
  border-left: 2px solid var(--line);
  color: var(--ink-muted);
  transition: color 0.18s ease, border-color 0.18s ease;
}
.toc a:hover { color: var(--ink); border-color: var(--accent); }

.prose { max-width: 68ch; }
.prose h2 {
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  margin-top: 52px;
  margin-bottom: 14px;
  scroll-margin-top: 96px;
}
.prose h2:first-of-type { margin-top: 0; }
.prose p { margin-bottom: 18px; color: var(--ink-soft); }
.prose ul { margin: 0 0 18px; padding-left: 22px; color: var(--ink-soft); }
.prose li { margin-bottom: 8px; }
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 640; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-hi);
  color: var(--ink);
}
.prose hr { margin: 48px 0 28px; border: 0; border-top: 1px solid var(--line); }

.callout {
  padding: 22px 26px;
  margin-bottom: 34px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius);
}
.callout p { margin: 0; color: var(--ink); }

.doc-head { padding-block: clamp(56px, 8vw, 88px) 0; }
.doc-head h1 { font-size: clamp(2rem, 4.6vw, 3rem); }
.doc-head .meta { margin-top: 18px; color: var(--ink-muted); font-size: 0.94rem; }

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

.center-page {
  min-height: 62vh;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 22px;
}

/* --- motion -------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --- breakpoints --------------------------------------------------------- */

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 36px 32px; }
  /* Steps sitting beside a screenshot stay in one column. */
  .steps-stack { grid-template-columns: 1fr; }
  .btn-row { margin-top: 40px; }
}

@media (min-width: 900px) {
  .hero-split { grid-template-columns: 1.15fr 0.85fr; }
  .split { grid-template-columns: 1fr 1fr; }
  .split.reverse > :first-child { order: 2; }
  .work { grid-template-columns: 1.1fr 0.9fr; }
  .doc { grid-template-columns: 210px 1fr; }
  .toc { position: sticky; top: 96px; }
  .phone { max-width: 320px; }
}

@media (max-width: 560px) {
  .nav { gap: 18px; font-size: 0.9rem; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}
