/* Daftar landing page. Tokens copy design/tokens.json (light theme, like the app);
   server/test/landing.test.ts fails when a value here drifts from the JSON. */

@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/urbanist-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Readex Pro';
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url('fonts/readex-pro-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E,
    U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  --sky: #dcebf5;
  --mist: #f4f6f8;
  --surface: #ffffff;
  --ink: #111315;
  --on-ink: #ffffff;
  --ink-2: #4b525b;
  --muted: #6b717a;
  --line: #eef0f2;
  --border: #dde0e4;
  --ink-card-text-2: #b9bec6;
  --protein-fill: #fbe3d6;
  --protein-mark: #e9784b;
  --protein-text: #4a3328;
  --carbs-fill: #e4f2c7;
  --carbs-mark: #6fa51e;
  --fat-fill: #fbefc4;
  --fat-mark: #d9a520;
  --water-fill: #d6ecf5;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --gutter: 20px;

  --radius-card: 28px;
  --radius-tile: 22px;
  --radius-thumb: 16px;
  --radius-pill: 999px;

  --size-touch: 44px;
  --size-button: 58px;

  --sans: 'Urbanist', sans-serif;
  --arabic: 'Readex Pro', 'Urbanist', sans-serif;
  --page: 1120px;
}

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

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

body {
  margin: 0;
  background: var(--mist) linear-gradient(180deg, var(--sky) 0, var(--mist) 320px) no-repeat;
  color: var(--ink);
  font: 500 17px/26px var(--sans);
  font-variant-numeric: tabular-nums;
}

[lang='ar'] body,
[lang='ar'] input,
[lang='ar'] button {
  font-family: var(--arabic);
}

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

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

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 20px;
  line-height: 26px;
  font-weight: 700;
}

[lang='ar'] h1,
[lang='ar'] h2 {
  letter-spacing: 0;
  line-height: 1.35;
}

[lang='ar'] h1 {
  font-size: clamp(32px, 4.6vw, 48px);
}

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  inset-inline-start: var(--space-4);
  top: -100px;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-pill);
  font-weight: 700;
}

.skip:focus {
  top: var(--space-4);
}

/* Header: the wordmark and the other language, nothing else. */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.wordmark span {
  font-family: var(--arabic);
  font-weight: 500;
  font-size: 22px;
  color: var(--ink-2);
  letter-spacing: 0;
}

.lang {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-touch);
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.lang[lang='ar'] {
  font-family: var(--arabic);
}

.lang[lang='en'] {
  font-family: var(--sans);
}

/* Sections */
section {
  padding: 56px 0;
}

.section-head {
  display: grid;
  gap: var(--space-3);
  max-width: 640px;
  margin-bottom: var(--space-8);
}

.lead {
  font-size: 19px;
  line-height: 29px;
  color: var(--ink-2);
}

/* Hero */
.hero {
  display: grid;
  gap: 40px;
  align-items: center;
  padding-block: var(--space-6) 56px;
}

.hero-text {
  display: grid;
  gap: var(--space-5);
  max-width: 580px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--size-button);
  padding: 0 var(--space-8);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--on-ink);
  font: 700 16px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  justify-self: start;
}

[lang='ar'] .button {
  font-family: var(--arabic);
}

.button:disabled {
  cursor: progress;
  background: var(--ink-2);
}

.for {
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  color: var(--ink-2);
}

/* A canvas screen at its real proportions (390 x 844), edged like a phone screen. */
.screen {
  width: 100%;
  max-width: 300px;
  border-radius: var(--radius-card);
  outline: 1px solid var(--border);
  background: var(--mist);
}

.screen-wide {
  max-width: 390px;
  border-radius: var(--radius-tile);
}

.hero .screen {
  max-width: 320px;
}

/* How it works: the one numbered sequence on the page. */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 48px;
}

.step {
  display: grid;
  gap: var(--space-5);
  align-items: center;
}

.step-text {
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: var(--space-4);
  row-gap: var(--space-2);
  max-width: 480px;
}

.step-text p {
  grid-column: 2;
  color: var(--ink-2);
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: 2.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 16px/1 var(--sans);
}

.step-text h3 {
  align-self: center;
}

q {
  quotes: '\201C' '\201D';
  font-weight: 700;
  color: var(--ink);
}

[lang='ar'] q {
  quotes: '\00AB' '\00BB';
}

/* The Gulf food library: real rows from data/gulf_foods.json. */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-5);
}

.library {
  max-width: 460px;
  width: 100%;
}

.foods {
  list-style: none;
  margin: 0;
  padding: 0;
}

.foods li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}

.foods li:last-of-type {
  border-bottom: 0;
}

.food-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
}

.food-ar {
  display: block;
  font: 500 14px/22px var(--arabic);
  color: var(--ink-2);
}

.food-portion {
  grid-column: 1;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  color: var(--muted);
}

.food-kcal {
  grid-column: 2;
  grid-row: 1 / span 2;
  text-align: end;
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  margin-top: var(--space-1);
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--protein-fill);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.foods-note {
  margin-top: var(--space-3);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--muted);
}

/* Two columns side by side: own AI and safety. */
.pair {
  display: grid;
  gap: var(--space-4);
}

.pair .card {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  padding: var(--space-6);
}

.pair p {
  color: var(--ink-2);
}

.ai {
  display: grid;
  gap: var(--space-3);
  max-width: 760px;
  padding: var(--space-6);
}

/* The one ink card: health questions go to the coach, like the roster's escalation card. */
.card-ink {
  background: var(--ink);
  color: var(--on-ink);
}

.pair .card-ink p {
  color: var(--ink-card-text-2);
}

.safety {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

/* Pricing: one table, not tier cards. */
.prices {
  width: 100%;
  border-collapse: collapse;
}

.prices th,
.prices td {
  padding: var(--space-4) var(--space-2);
  text-align: start;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

.prices tr:last-child th,
.prices tr:last-child td {
  border-bottom: 0;
}

.prices th {
  font-size: 18px;
  font-weight: 700;
}

.price {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  white-space: nowrap;
}

.prices td:last-child {
  color: var(--ink-2);
}

.fee {
  margin-top: var(--space-4);
  color: var(--ink-2);
}

/* Waitlist form */
.join {
  display: grid;
  gap: var(--space-8);
  align-items: start;
}

.join .section-head {
  margin-bottom: 0;
}

form {
  display: grid;
  gap: var(--space-5);
  max-width: 560px;
}

.field {
  display: grid;
  gap: var(--space-2);
}

label,
legend {
  font-size: 15px;
  font-weight: 700;
}

input[type='text'] {
  width: 100%;
  min-height: var(--size-button);
  padding: 0 var(--space-5);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font: 500 16px/1 var(--sans);
}

input[type='text']:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}

input[aria-invalid='true'] {
  border-color: var(--protein-mark);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: var(--space-2);
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.choices label {
  position: relative;
}

.choices input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.choices span {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-touch);
  padding: 0 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 15px;
  font-weight: 700;
}

.choices input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}

.choices input:focus-visible + span {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.hint {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--muted);
}

.status {
  min-height: 26px;
  font-weight: 700;
}

.status[data-state='error'] {
  color: var(--protein-text);
}

.done {
  padding: var(--space-6);
  border-radius: var(--radius-card);
  background: var(--surface);
  font-size: 19px;
  line-height: 28px;
  font-weight: 700;
}

.privacy {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--muted);
  max-width: 560px;
}

footer {
  padding: var(--space-8) 0 48px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  border-top: 1px solid var(--border);
  padding-top: var(--space-6);
}

@media (max-width: 899px) {
  .prices tr {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--line);
  }

  .prices tr:last-child {
    border-bottom: 0;
  }

  .prices th,
  .prices td {
    padding: var(--space-1) 0;
    border-bottom: 0;
  }

  .prices td:last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 900px) {
  .wrap {
    max-width: calc(var(--page) + 2 * var(--space-8));
    padding: 0 var(--space-8);
  }

  section {
    padding: 80px 0;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 64px;
    padding-block: 40px 80px;
  }

  .step {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
  }

  .pair {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .join {
    grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
    gap: 64px;
  }
}

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