/*
  sanus.fit: one stylesheet for the English page (index.html) and the Arabic one (ar/).
  Palette and type are the app's (clients/android …/core/ui/Theme.kt, Type.kt).
  Layout uses logical properties (inline-start/end), so the Arabic page mirrors itself.
*/
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Naskh"; src: url("fonts/naskh-arabic.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("fonts/plex-arabic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("fonts/plex-arabic-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #f6f2e9;
  --studio: #f4ecde;      /* the dish photos' own backdrop, so they sit without a seam */
  --ink: #2a3329;
  --muted: #6e756a;
  --line: #d4cfc1;
  --sage: #5e7a63;
  --sage-deep: #3e5443;
  --sage-tint: #e8eee5;
  --clay: #c2714f;
  --night: #1f2620;
  --cream: #ece7da;
  --unfilled: #c9c3b3;    /* manifesto words before the scroll reaches them */

  --serif: "Newsreader", "Naskh", Georgia, serif;
  --sans: "Geist", "Plex Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 3vw, 44px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
:lang(ar) {
  --serif: "Naskh", "Newsreader", Georgia, serif;
  --sans: "Plex Arabic", "Geist", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 4px; }

/* The wordmark is the app's own logo, traced to wordmark.svg and painted with currentColor. */
.wordmark {
  display: block;
  aspect-ratio: 2652 / 1480;
  background: currentColor;
  -webkit-mask: url("wordmark.svg") center / contain no-repeat;
  mask: url("wordmark.svg") center / contain no-repeat;
}

/* first paint: the wordmark and header come up out of a blur */
@keyframes surface { from { opacity: 0; filter: blur(12px); transform: translateY(12px); } }
/* backwards, not both: a filter left on the header would cut its links' backdrop blur off */
.film__mark { animation: surface 1400ms var(--ease) backwards; }
.film__tag { animation: surface 900ms var(--ease) 350ms backwards; }
.nav { animation: surface 900ms var(--ease) 250ms backwards; }

.eyebrow { font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: "●"; margin-inline-end: 0.6em; color: var(--clay); font-size: 0.8em; }
:lang(ar) .eyebrow { letter-spacing: 0; font-size: 15px; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 12px 20px; border-radius: 999px;
  background: var(--clay); color: #fff; text-decoration: none; font-weight: 500; font-size: 15px;
  transition: transform 160ms ease-out, background 160ms ease-out;
}
.btn:hover { background: #b0623f; transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }

/* ── Header ─────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
  color: #fff;
  transition: color 300ms ease;
}
.nav.is-ink { color: var(--ink); background: linear-gradient(to bottom, rgb(246 242 233 / 94%) 62%, rgb(246 242 233 / 0%)); }
.nav__brand { width: 52px; text-decoration: none; }
.nav__links { display: none; gap: 4px; padding: 4px; border-radius: 999px; background: rgb(255 255 255 / 12%); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav.is-ink .nav__links { background: rgb(255 255 255 / 70%); box-shadow: 0 0 0 1px var(--line); }
.nav__links a, .nav__lang { text-decoration: none; font-size: 14px; font-weight: 500; padding: 8px 16px; border-radius: 999px; transition: background 160ms ease-out; }
.nav__links a:hover { background: rgb(255 255 255 / 18%); }
.nav.is-ink .nav__links a:hover { background: var(--sage-tint); }
.nav__lang { box-shadow: inset 0 0 0 1px currentColor; }
@media (min-width: 760px) { .nav__links { display: flex; } }

/* ── Film: a scroll-scrubbed take under the wordmark, closed by a diagonal wipe ── */
.film { position: relative; height: 100vh; height: 100svh; background: var(--night); color: #fff; }
.js .film { height: 460vh; }
.film__stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  perspective: 1200px;   /* the vanishing point the wordmark sinks towards */
}
.film__poster, .film__canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film__canvas { opacity: 0; transition: opacity 240ms linear; }
.film__canvas.is-live { opacity: 1; }
.film__veil { position: absolute; inset: 0; background: linear-gradient(to top, rgb(20 24 20 / 72%), rgb(20 24 20 / 0%) 55%), linear-gradient(to bottom, rgb(20 24 20 / 35%), rgb(20 24 20 / 0%) 22%); pointer-events: none; }

.film__title {
  position: absolute; inset: auto 0 calc(env(safe-area-inset-bottom) + 3vh);
  display: flex; flex-direction: column; align-items: center; gap: 2.2vh;
  transform: translate3d(0, 0, calc(var(--exit, 0) * 680px));
  opacity: calc(1 - var(--exit, 0) * var(--exit, 0));
}
.film__title.is-exiting { filter: blur(calc(var(--exit, 0) * var(--exit, 0) * 8px)); }
.film__title.is-gone { visibility: hidden; }
.film__tag { font-size: clamp(13px, 1.3vw, 17px); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
:lang(ar) .film__tag { letter-spacing: 0; font-size: clamp(15px, 1.5vw, 19px); }
.film__mark { width: min(84vw, 34vh * 2652 / 1480); }

/* the three lines that narrate the take; each rises in, then lifts out */
.film__line {
  position: absolute; inset-inline-start: var(--gutter); bottom: 12vh;
  max-width: min(20ch, 86vw);
  font: 500 clamp(26px, 3.4vw, 50px)/1.12 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
  opacity: var(--in, 0);
  transform: translateY(calc((1 - var(--in, 0)) * 0.8em));
}
:lang(ar) .film__line { line-height: 1.45; letter-spacing: 0; }
.film__line.is-anim { filter: blur(calc((1 - var(--in, 0)) * (1 - var(--in, 0)) * 5px)); }
.film__line.is-hidden { visibility: hidden; }
html:not(.js) .film__line:not(:first-of-type) { display: none; }
html:not(.js) .film__line { --in: 1; bottom: auto; top: 18vh; }

.film__acts {
  position: absolute; inset-inline-end: var(--gutter); top: 50%; transform: translateY(-50%);
  display: grid; gap: 10px; font-size: 13px; font-weight: 500; text-align: end;
}
.film__acts li { opacity: 0.45; transition: opacity 300ms ease; }
.film__acts li span { font-variant-numeric: tabular-nums; margin-inline-end: 0.7em; }
.film__acts li.is-on { opacity: 1; }
html:not(.js) .film__acts { display: none; }

.film__cue { position: absolute; inset: auto 0 calc(env(safe-area-inset-bottom) + 3vh) auto; inset-inline: auto var(--gutter); font-size: 13px; opacity: calc(0.8 - var(--exit, 0)); }

/*
  The wipe. Not a clip-path: a box whose width grows while it turns, as in the PLATE reference.
  A box turned by t covers a W×H screen once its sides reach W·cos t + H·sin t; at 45° that is
  0.707(W+H), so 72vw + 72vh with a little to spare. Paper inside, so the page below continues it.
*/
.film__reveal {
  --rot: calc(var(--reveal, 0) * var(--angle, -45deg));
  position: absolute; top: 50%; left: 50%;
  width: calc(var(--reveal, 0) * (72vw + 72vh));
  height: calc(72vw + 72vh);
  transform: translate3d(-50%, -50%, 0) rotate(var(--rot));
  background: var(--paper);
  backface-visibility: hidden;
  pointer-events: none;
}
[dir="rtl"] .film__reveal { --angle: 45deg; }

@media (max-width: 759px) {
  .film__acts, .film__cue { display: none; }
  .film__line { bottom: auto; top: 16vh; }
}

/* ── Manifesto: the words fill in as you read down ─────────── */
/* everything after the film paints above its sticky stage, which is positioned */
.film ~ section { position: relative; z-index: 1; }
.manifesto { padding: clamp(48px, 8vw, 110px) var(--gutter) clamp(90px, 14vw, 210px); text-align: center; }
/* The wipe is done with 72vh of the film still to scroll (site.js, WIPE). Pulling the manifesto
   up a full screen makes it rise over the paper as the wipe closes, not a screen later. */
@media (prefers-reduced-motion: no-preference) {
  .js .manifesto { margin-top: -100vh; }
}
.manifesto .eyebrow { margin-bottom: 36px; }
.manifesto__text {
  max-width: 24ch; margin: 0 auto;
  font: 500 clamp(30px, 4.2vw, 60px)/1.2 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
:lang(ar) .manifesto__text { line-height: 1.6; letter-spacing: 0; max-width: 22ch; }
.manifesto__text .w { color: color-mix(in srgb, var(--ink) calc(var(--f, 1) * 100%), var(--unfilled)); }
.manifesto__sub { margin-top: clamp(40px, 7vw, 110px); font-size: clamp(17px, 1.6vw, 22px); line-height: 1.45; }
.manifesto__sub span { color: var(--muted); }

/* ── Menu: one dish in focus, the rest of the week behind it ── */
.menu { background: var(--studio); padding-block: clamp(70px, 9vw, 130px) clamp(56px, 7vw, 100px); overflow: hidden; }
.menu__head { padding-inline: var(--gutter); display: grid; gap: 14px; max-width: 1240px; margin: 0 auto; }
.menu h2 { font: 500 clamp(34px, 4.6vw, 64px)/1.05 var(--serif); letter-spacing: -0.02em; }
:lang(ar) .menu h2 { line-height: 1.4; letter-spacing: 0; }
.menu__head p:last-child { color: var(--muted); max-width: 44ch; }

.menu__stage { position: relative; margin-top: clamp(24px, 4vw, 48px); }
.menu__track {
  display: flex; align-items: center;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-inline: calc(50% - var(--dish-w) / 2);
  --dish-w: min(66vw, 320px);
}
.menu__track::-webkit-scrollbar { display: none; }
.dish {
  flex: 0 0 var(--dish-w);
  scroll-snap-align: center;
  cursor: pointer;
  /* the photos' backdrop is not perfectly flat; feather the frame so no edge shows */
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 74%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 74%, transparent 100%);
  transform: scale(calc(1 - min(var(--d, 0), 1.6) * 0.22));
  filter: blur(calc(min(var(--d, 0), 1.4) * 5px));
  opacity: calc(1 - min(var(--d, 0), 1.6) * 0.38);
}
.dish img { width: 100%; user-select: none; -webkit-user-drag: none; }
.dish.is-sharp { filter: none; }

.menu__info {
  display: grid; justify-items: center; gap: 4px; text-align: center;
  padding: 8px var(--gutter) 0;
}
.menu__count { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.menu__name { font: 500 clamp(24px, 2.4vw, 34px)/1.2 var(--serif); }
.menu__meta { color: var(--muted); font-size: 15px; }
.menu__btns { display: flex; gap: 10px; margin-top: 14px; }
.menu__btns button {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 18px; cursor: pointer; transition: transform 160ms ease-out;
}
.menu__btns button:hover { transform: translateY(-1px); }
[dir="rtl"] .menu__btns button { transform: scaleX(-1); }
.menu__note { margin-top: 26px; text-align: center; font-size: 13px; color: var(--muted); padding-inline: var(--gutter); }

/* ── How it works: a bordered panel of three cards ─────────── */
.how { padding: clamp(80px, 10vw, 150px) var(--gutter); }
.panel {
  max-width: 1300px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 16px;
  padding: clamp(22px, 3vw, 44px);
  display: grid; gap: 32px;
}
.panel__intro { display: grid; gap: 18px; align-content: start; justify-items: start; }
.panel h2 { font: 500 clamp(34px, 3.8vw, 56px)/1.06 var(--serif); letter-spacing: -0.02em; }
:lang(ar) .panel h2 { line-height: 1.4; letter-spacing: 0; }
.panel__intro p { color: var(--muted); max-width: 34ch; }
.cards { display: grid; gap: 12px; }
.card {
  position: relative; overflow: hidden;
  min-height: 300px; border-radius: 10px; padding: 22px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  transition: transform 260ms var(--ease);
}
.card:hover { transform: translateY(-6px); }
.card h3 { font: 500 26px/1.15 var(--serif); }
.card p { font-size: 15px; line-height: 1.5; }
.card__n { position: absolute; inset-block-start: 20px; inset-inline-start: 22px; font-size: 13px; font-variant-numeric: tabular-nums; opacity: 0.7; }
.card--ink { background: var(--ink); color: var(--cream); }
.card--photo { background: var(--studio); }
.card--photo img { position: absolute; inset: -6% 0 auto; width: 100%; }
.card--photo h3, .card--photo p { position: relative; }
.card--photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--studio) 34%, rgb(244 236 222 / 0%) 62%); }
.card--photo > :not(img) { z-index: 1; }
.card--sage { background: var(--sage-deep); color: #fff; }
.card .card__big { font: 500 clamp(64px, 7vw, 96px)/0.9 var(--serif); letter-spacing: -0.03em; }
.card__big small { font-size: 0.32em; letter-spacing: 0; margin-inline-start: 0.2em; }
.card__tags { position: absolute; inset-block-start: 56px; inset-inline: 22px; display: flex; flex-wrap: wrap; gap: 6px; }
.card__tags li { padding: 6px 12px; border-radius: 999px; border: 1px solid rgb(236 231 218 / 28%); font-size: 13px; }
@media (min-width: 900px) {
  .panel { grid-template-columns: minmax(260px, 0.9fr) 2.1fr; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .card { min-height: 340px; }
}
@media (min-width: 600px) and (max-width: 899px) { .cards { grid-template-columns: repeat(3, 1fr); } .card { min-height: 280px; } }

/* entrance for anything marked [data-rise] */
.js [data-rise] { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-rise].is-in { opacity: 1; transform: none; }

/* ── The app ───────────────────────────────────────────────── */
.app {
  background: var(--night); color: var(--cream);
  padding: clamp(80px, 10vw, 140px) var(--gutter) 0;
  display: grid; gap: 48px; overflow: hidden;
}
.app__copy { display: grid; gap: 18px; align-content: start; max-width: 520px; }
.app .eyebrow { color: #a9c0ac; }
.app h2 { font: 500 clamp(36px, 4.4vw, 64px)/1.05 var(--serif); letter-spacing: -0.02em; color: #fff; }
:lang(ar) .app h2 { line-height: 1.4; letter-spacing: 0; }
.app__list { display: grid; gap: 10px; }
.app__list li { padding-top: 10px; border-top: 1px solid rgb(236 231 218 / 18%); }
.app__soon { display: inline-block; justify-self: start; margin-top: 8px; padding: 10px 18px; border-radius: 999px; background: rgb(236 231 218 / 10%); font-size: 15px; }
.app__phones { display: flex; justify-content: center; align-items: flex-end; gap: clamp(10px, 2vw, 24px); }
.phone {
  width: clamp(130px, 18vw, 250px);
  border-radius: clamp(18px, 2.4vw, 32px) clamp(18px, 2.4vw, 32px) 0 0;
  border: clamp(5px, 0.6vw, 8px) solid #0f1310; border-bottom: 0;
  overflow: hidden; background: var(--paper);
  aspect-ratio: 9 / 15;   /* the screenshot is 1:2; the band cuts it off at the bottom */
}
.phone img { width: 100%; }
.phone:nth-child(2) { width: clamp(150px, 21vw, 290px); }
@media (max-width: 599px) { .phone:nth-child(3) { display: none; } }
@media (min-width: 900px) { .app { grid-template-columns: 1fr 1.2fr; align-items: end; } .app__copy { align-self: center; padding-bottom: 100px; } }

/* ── Footer ────────────────────────────────────────────────── */
.foot { background: var(--paper); padding: 44px var(--gutter) 52px; display: grid; gap: 22px; font-size: 14px; color: var(--muted); }
.foot__mark { width: 74px; color: var(--ink); }
.foot__links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot__links a { color: var(--sage-deep); }

/* ── Privacy policy (privacy/, ar/privacy/) ────────────────── */
.legal { max-width: 720px; margin: 0 auto; padding: 120px var(--gutter) 80px; }
.legal h1 { font: 500 clamp(38px, 5vw, 56px)/1.1 var(--serif); letter-spacing: -0.02em; margin-bottom: 10px; }
.legal h2 { font: 500 24px/1.3 var(--serif); margin: 40px 0 10px; }
.legal h3 { font-size: 17px; font-weight: 500; margin: 18px 0 6px; }
:lang(ar) .legal h1, :lang(ar) .legal h2 { line-height: 1.5; letter-spacing: 0; }
.legal p, .legal li { margin-bottom: 10px; }
.legal ul, .legal ol { padding-inline-start: 22px; margin-bottom: 10px; list-style: revert; }
.legal a { color: var(--sage-deep); }
.legal__meta { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.legal h2[id] { scroll-margin-top: 100px; }

/* ── Sign-in pages (sign-in/, sign-up/, account/, sso-callback/, and ar/…) ── */
/* Roboto Medium for the Google button only, as Google's sign-in branding asks. */
@font-face { font-family: "Roboto"; src: url("fonts/roboto-500-latin.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
.auth { max-width: 420px; margin: 0 auto; padding: 128px var(--gutter) 80px; display: grid; gap: 16px; }
.auth h1 { font: 500 clamp(36px, 5vw, 48px)/1.1 var(--serif); letter-spacing: -0.02em; }
.auth h2 { font: 500 26px/1.25 var(--serif); }
:lang(ar) .auth h1, :lang(ar) .auth h2 { line-height: 1.5; letter-spacing: 0; }
.auth__lede { color: var(--muted); font-size: 16px; }
.auth__social { display: grid; gap: 10px; margin-top: 8px; }
/* Both buttons the same size, so neither ranks above the other (Apple's rule). */
.social {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  font-size: 15px; font-weight: 500; line-height: 20px;
  transition: opacity 160ms ease-out, box-shadow 160ms ease-out;
}
.social img { flex: none; }
/* Google's light button: white, #747775 hairline, #1F1F1F Roboto Medium, the four-colour G. */
.social--google { background: #fff; color: #1f1f1f; border: 1px solid #747775; font-family: "Roboto", var(--sans); }
.social--google:hover { box-shadow: 0 1px 3px rgb(60 64 67 / 30%); }
/* Apple's black button with the white logo, in the system font. */
.social--apple { background: #000; color: #fff; border: 1px solid #000; font-family: -apple-system, BlinkMacSystemFont, system-ui, var(--sans); }
.social--apple:hover { opacity: 0.88; }
.social:disabled { opacity: 0.6; cursor: progress; }
.auth__or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.auth__or::before, .auth__or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth__form { display: grid; gap: 14px; }
.auth__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth__field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.auth__field input {
  font: 400 16px/1.4 var(--sans); color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; width: 100%;
}
.auth__field input:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px rgb(194 113 79 / 18%); }
.auth__submit { justify-content: center; border: 0; cursor: pointer; font: inherit; font-weight: 500; padding: 13px 20px; margin-top: 4px; }
.auth__submit:disabled { opacity: 0.6; cursor: progress; }
.auth__link { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 15px; font-weight: 500; color: var(--sage-deep); cursor: pointer; justify-self: start; }
.auth__msg { color: var(--clay); font-size: 15px; }
.auth__switch { font-size: 15px; color: var(--muted); }
.auth__switch a { color: var(--sage-deep); font-weight: 500; }
.auth__muted { color: var(--muted); }
.auth__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px; }
.auth [hidden] { display: none !important; }

/* ── Less motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .js .film { height: 100vh; height: 100svh; }
  .js .film__line:not(:first-of-type), .film__acts, .film__reveal, .film__cue { display: none; }
  .js .film__line:first-of-type { --in: 1; bottom: auto; top: 18vh; }
  .manifesto__text .w { color: var(--ink); }
  .dish { transform: none; filter: none; }
  .js [data-rise] { opacity: 1; transform: none; transition: none; }
  .card, .btn, .menu__btns button, .social { transition: none; }
  .film__mark, .film__tag, .nav { animation: none; }
}
