/*
 * miaword.com — tokens and primitives.
 *
 * Every value here is transcribed from src/theme/tokens.ts and the HTML
 * references in docs/, so the site and the app cannot drift apart. Where the
 * two disagreed, docs/odeme.html won: it is the newest surface in the repo
 * and the app is being brought to it, not the other way round.
 *
 * The four rules the app is built on, from tokens.ts, hold here too:
 *   1. Every interactive surface is a solid block with a darker edge under it.
 *   2. Static surfaces use a border, not a shadow.
 *   3. Corners are generously rounded. 16 is the default, never under 12.
 *   4. Type is heavy. 700 is the lightest weight that ever appears.
 */

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

:root {
  /* Ground. Warm charcoal, never black: against a warm orange, a pure or cool
     black reads as a hole in the page. */
  --bg: #221d1a;
  --surface: #2e2723;
  --surface-2: #352c26;
  --well: #191411;
  --edge: #171311;
  --border: #3d342e;
  --border-strong: #7b6f67;

  /* Brand. The ginger of the cat. */
  --orange: #ff8c1a;
  --orange-edge: #d96e00;
  --orange-ink: #2a1a08;

  /* The three ages of a card. These three may never mean anything else. */
  --new: #ff8c1a;
  --new-edge: #e57200;
  --young: #1cb0f6;
  --young-edge: #1899d6;
  --mature: #58cc02;
  --mature-edge: #46a302;

  --purple: #ce82ff;
  --purple-edge: #a568cc;
  --amber: #ffb020;
  --red: #ff4b4b;

  /* Text. Pure white on a warm dark ground glares. */
  --text: #f4efe9;
  --text-muted: #a79c93;
  --text-faint: #7b6f67;

  /* The wordmark's two tones. */
  --mia: #fff6e6;
  --word: #ffe27a;

  /* Shape. 22 is the card radius the newest screen settled on. */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-card: 22px;
  --r-pill: 999px;

  /* Light treatments that make a surface read as material. */
  --sheen: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  --sunk: inset 0 2px 4px rgba(0, 0, 0, 0.45);
  --lip: 0 4px 0 var(--edge);
  --lift: 0 14px 30px rgba(0, 0, 0, 0.42);

  /* Motion. The reference's three curves, the same ones every docs/*.html
     uses. Copied rather than approximated. */
  --settle: cubic-bezier(0.2, 1, 0.3, 1);
  --overshoot: cubic-bezier(0.34, 1.56, 0.64, 1);
  --springy: cubic-bezier(0.2, 1.2, 0.4, 1);

  --page: 1140px;
  --gutter: clamp(20px, 5vw, 56px);
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', ui-rounded, -apple-system, 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.41;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

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

h1,
h2,
h3,
h4 {
  font-weight: 900;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

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

code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.88em;
  background: var(--well);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-muted);
}

/* The app has no hover vocabulary at all, so the one invented here stays
   inside its physics: lift off the lip, never change colour. */
:focus-visible {
  outline: 3px solid #7fb8ff;
  outline-offset: 3px;
  border-radius: 14px;
}

/* ------------------------------------------------------------- primitives */

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

.narrow {
  max-width: 780px;
}

section {
  position: relative;
  padding-block: clamp(64px, 8vw, 112px);
}

/*
 * Overline. No `text-transform`, deliberately: Turkish uppercases "i" to "İ",
 * so CSS casing would turn miaword into MİAWORD -- correct Turkish, wrong
 * name -- and the habit is easier to keep than to remember to break. Every
 * shouted string on this site is hand-cased in the markup.
 */
.eyebrow {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--orange);
  margin-bottom: 16px;
}

.h1 {
  font-size: clamp(40px, 7.4vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.h2 {
  font-size: clamp(30px, 4.6vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.h3 {
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 800;
  line-height: 1.33;
}

.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 56ch;
}

.lede + .lede {
  margin-top: 18px;
}

.hl {
  color: var(--orange);
}

/* Every figure that can change is tabular, so a counter does not jitter as
   it climbs. Baloo is the numeral face; it never sets a sentence. */
.fig {
  font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Sticker card: a flat face on a hard lip, no side or top shadow. */
.card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 24px;
  box-shadow: var(--sheen), var(--lip);
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.01em;
  padding: 15px 28px;
  border-radius: var(--r-lg);
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--settle), box-shadow 0.2s var(--settle),
    background-color 0.2s var(--settle), color 0.2s var(--settle);
}

.btn--primary {
  background: var(--orange);
  color: var(--orange-ink);
  box-shadow: 0 5px 0 var(--orange-edge), 0 10px 20px rgba(255, 140, 26, 0.2);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 0 var(--orange-edge), 0 14px 26px rgba(255, 140, 26, 0.26);
}

/* Pressing sinks the face onto the edge rather than scaling or fading it,
   which is what makes the interaction read as physical. */
.btn--primary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--orange-edge);
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sheen), var(--lip);
}

.btn--ghost:hover {
  transform: translateY(-1px);
  box-shadow: var(--sheen), 0 5px 0 var(--edge);
}

.btn--ghost:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--edge);
}

/* ------------------------------------------------------------ scroll work */

/*
 * Two mechanisms, and the page never depends on the newer one.
 *
 * `.reveal` is driven by an IntersectionObserver in site.js and fires once,
 * never on the way back up: a section that replays every time it is scrolled
 * past is what makes a page feel like a toy. The 16px rise and the 70ms
 * sibling stagger are the app's own entrance, from tokens.ts.
 */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--settle), transform 0.5s var(--settle);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.reveal[data-delay='1'] { transition-delay: 0.07s; }
.reveal[data-delay='2'] { transition-delay: 0.14s; }
.reveal[data-delay='3'] { transition-delay: 0.21s; }
.reveal[data-delay='4'] { transition-delay: 0.28s; }

@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* -------------------------------------------------------------------- nav */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--settle), border-color 0.3s var(--settle);
}

.nav--moved {
  background: rgba(34, 29, 26, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--border);
}

.nav__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 74px;
}

/* The wordmark: lowercase, split at index three, cream over gold. It exists
   nowhere as a file -- only as Brand.tsx -- so this is its first vector. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.027em;
  color: var(--mia);
}

.brand img {
  width: 32px;
  height: 32px;
}

.brand b {
  font-weight: 800;
  color: var(--word);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-muted);
}

.nav__links a:not(.btn) {
  transition: color 0.2s var(--settle);
}

.nav__links a:not(.btn):hover {
  color: var(--text);
}

.nav__links .btn {
  font-size: 14px;
  padding: 11px 18px;
}

@media (max-width: 860px) {
  .nav__links a:not(.btn) {
    display: none;
  }
}

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

.foot {
  border-top: 1px solid var(--border);
  padding-block: 52px 68px;
}

.foot__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 48px;
  justify-content: space-between;
  align-items: flex-start;
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
}

.foot__links a {
  transition: color 0.2s var(--settle);
}

.foot__links a:hover {
  color: var(--orange);
}

.foot__fine {
  margin-top: 34px;
  font-size: 14px;
  color: var(--text-faint);
}

/* ------------------------------------------------------------ legal pages */

/*
 * The pages a reviewer opens. Measured for reading rather than for looking:
 * somebody is here to find one clause, not to be impressed.
 */

.doc {
  padding-top: 148px;
  padding-bottom: 100px;
}

.doc h1 {
  font-size: clamp(32px, 4.6vw, 48px);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.doc__meta {
  color: var(--text-faint);
  font-size: 15px;
  margin-bottom: 48px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.doc h2 {
  font-size: clamp(21px, 2.6vw, 26px);
  margin-top: 52px;
  margin-bottom: 12px;
  scroll-margin-top: 100px;
}

.doc h3 {
  font-size: 18px;
  font-weight: 800;
  margin-top: 30px;
  margin-bottom: 6px;
}

.doc p,
.doc li {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 13px;
}

.doc a:not(.btn) {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

.doc ul {
  padding-left: 22px;
  margin: 0 0 20px;
}

.doc li::marker {
  color: var(--orange);
}

.doc strong {
  color: var(--text);
  font-weight: 900;
}

/* A table is the honest shape for "what we hold and why". */
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0 30px;
  font-size: 15px;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.doc th {
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  background: var(--well);
}

.doc thead tr:first-child th:first-child { border-top-left-radius: var(--r-md); }
.doc thead tr:first-child th:last-child { border-top-right-radius: var(--r-md); }

.doc td:first-child {
  color: var(--text);
  font-weight: 800;
}

@media (max-width: 620px) {
  .doc table,
  .doc tbody,
  .doc tr,
  .doc td {
    display: block;
  }

  .doc thead {
    display: none;
  }

  .doc tr {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

  .doc td {
    border: none;
    padding: 2px 0;
  }
}

.note {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 22px 24px;
  margin: 28px 0 32px;
  box-shadow: var(--sheen), 0 4px 0 var(--edge);
  border-left: 4px solid var(--orange);
}

.note p {
  margin-bottom: 0;
}
