/* Shared structure for all five flavors. Concepts restyle through the tokens below and their own brand.css.
   Rules: no shadows, no italics, no gradient text, logical properties only (RTL mirrors for free). */
:root {
  --bg: #fff; --ink: #111; --muted: #6b6b6b; --line: #e4e4e4; --surface: #f6f6f6;
  --accent: #2b3ff0; --accent-ink: #fff;
  --font-d: system-ui, sans-serif; --font-u: system-ui, sans-serif; --font-n: ui-monospace, monospace;
  --r: 14px; --bar-h: 72px; --gutter: clamp(16px, 4vw, 56px); --max: 1320px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; animation-timing-function: var(--ease); }
.ff-bar { view-transition-name: ff-bar; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-u); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
em, i, cite, address { font-style: normal; }
img, video, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-d); margin: 0; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }
.ff-wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.ff-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Arabic letters must never be letter-spaced (it breaks joining). */
[dir="rtl"] *, [dir="rtl"] *::before, [dir="rtl"] *::after { letter-spacing: 0 !important; }
bdi.ff-num, bdi.ff-amt { font-variant-numeric: tabular-nums; unicode-bidi: isolate; white-space: nowrap; }

/* Skip link */
.ff-skip { position: fixed; inset-inline-start: 12px; inset-block-start: -60px; z-index: 100; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; text-decoration: none; transition: inset-block-start .2s; }
.ff-skip:focus { inset-block-start: 12px; }

/* Bar: same logic everywhere, concept CSS owns the look */
.ff-bar { position: sticky; inset-block-start: 0; z-index: 50; display: flex; align-items: center; gap: 12px;
  min-height: var(--bar-h); padding-inline: var(--gutter); background: var(--bg); }
.ff-brand { display: inline-flex; align-items: center; text-decoration: none; margin-inline-end: 12px; flex: none; }
.ff-aud { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.ff-aud a { text-decoration: none; padding: 7px 14px; border-radius: 999px; font-size: 14px; line-height: 1.2; color: var(--muted); }
.ff-aud a[aria-current] { background: var(--ink); color: var(--bg); }
.ff-menu-btn { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 10px 6px; font-size: 15px; }
.ff-menu-ico { width: 14px; height: 8px; position: relative; }
.ff-menu-ico::before, .ff-menu-ico::after { content: ""; position: absolute; inset-inline: 0; height: 1.5px; background: currentColor; transition: transform .3s var(--ease); }
.ff-menu-ico::before { inset-block-start: 0; } .ff-menu-ico::after { inset-block-end: 0; }
.ff-menu-btn[aria-expanded="true"] .ff-menu-ico::before { transform: translateY(3.25px) rotate(45deg); }
.ff-menu-btn[aria-expanded="true"] .ff-menu-ico::after { transform: translateY(-3.25px) rotate(-45deg); }
.ff-menu-narrow { display: none; }
.ff-ask-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: none; border-radius: 999px; padding: 8px 10px 8px 14px; font-size: 14px; }
[dir="rtl"] .ff-ask-btn { padding: 8px 14px 8px 10px; }
.ff-ask-btn kbd { font: 500 12px/1 var(--font-n); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; color: var(--muted); }
.ff-ask-mark { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); flex: none; transform: rotate(45deg); }
.ff-lang { text-decoration: none; min-width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 999px; font-size: 15px; }
.ff-lang:hover { background: var(--surface); }

/* Mega menu */
.ff-menu { position: fixed; inset-inline: 0; inset-block-start: var(--bar-h); z-index: 49; background: var(--bg); border-block-end: 1px solid var(--line);
  max-height: calc(100dvh - var(--bar-h)); overflow: auto; overscroll-behavior: contain; }
.ff-menu[hidden] { display: none; }
.ff-menu.is-open .ff-menu-in { animation: ff-drop .4s var(--ease) both; }
@keyframes ff-drop { from { opacity: 0; transform: translateY(-8px); } }
.ff-menu-in { max-width: var(--max); margin-inline: auto; padding: 28px var(--gutter) 36px; }
.ff-menu-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-block-end: 20px; }
.ff-menu-kicker { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ff-menu-switch { text-decoration: none; font-size: 15px; display: inline-flex; gap: 8px; }
.ff-menu-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.ff-mi { display: grid; gap: 6px; text-decoration: none; padding: 10px; border-radius: var(--r); border: 1px solid transparent; height: 100%; align-content: start; }
a.ff-mi:hover, a.ff-mi:focus-visible { border-color: var(--line); background: var(--surface); }
.ff-mi[aria-current] { border-color: var(--ink); }
.ff-mi-pre { display: block; aspect-ratio: 16 / 10; border-radius: calc(var(--r) - 4px); background: var(--surface); overflow: hidden; margin-block-end: 6px; }
.ff-mi-pre svg { width: 100%; height: 100%; }
.ff-mi-t { font-weight: 600; font-size: 16px; }
.ff-mi-p { font-size: 14px; color: var(--muted); line-height: 1.4; }
.ff-mi.is-soon { opacity: .55; cursor: default; }
.ff-mi-soon { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ff-menu-foot { display: none; }

/* Ask composer (shared anatomy) */
.ff-ask { display: grid; gap: 10px; }
.ff-ask-label { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.ff-ask-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r); padding: 6px; background: var(--bg); }
.ff-ask-field:focus-within { border-color: var(--ink); }
.ff-ask-field input { flex: 1; min-width: 0; border: 0; background: none; padding: 10px 10px; font-size: 16px; outline: none; }
.ff-ask-go { border: 0; background: var(--ink); color: var(--bg); border-radius: calc(var(--r) - 4px); padding: 10px 16px; font-size: 15px; }
.ff-ask-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ff-chip { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 7px 13px; font-size: 14px; text-align: start; }
.ff-chip:hover { border-color: var(--ink); }
.ff-ask-out:empty { display: none; }
.ff-ask-out { display: grid; gap: 12px; }
.ff-how { font-size: 14px; color: var(--muted); }
.ff-how summary { cursor: pointer; list-style: none; display: inline-flex; gap: 8px; align-items: center; }
.ff-how summary::-webkit-details-marker { display: none; }
.ff-how summary::before { content: ""; width: 7px; height: 7px; border-inline-end: 1.5px solid currentColor; border-block-end: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s; }
[dir="rtl"] .ff-how summary::before { transform: rotate(45deg); }
.ff-how[open] summary::before { transform: rotate(45deg); }
.ff-how ol { margin: 10px 0 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.ff-how li { opacity: 0; transition: opacity .3s; }
.ff-how li.is-in { opacity: 1; }
.ff-answer { font-size: 17px; line-height: 1.5; }
.ff-answer-go { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; font-weight: 600; }
.ff-thinking { display: inline-flex; gap: 4px; align-items: center; height: 20px; }
.ff-thinking i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .3; animation: ff-dot 1s infinite; }
.ff-thinking i:nth-child(2) { animation-delay: .15s; } .ff-thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes ff-dot { 50% { opacity: 1; } }

/* Ask sheet (opened from the bar or with "/") */
.ff-asksheet { border: 0; padding: 0; margin: 0 auto; inset-block-start: 0; width: min(760px, 100%); max-width: 100%; max-height: 100dvh; background: transparent; color: var(--ink); overflow: visible; }
.ff-asksheet::backdrop { background: color-mix(in srgb, var(--ink) 40%, transparent); }
.ff-asksheet-in { position: relative; margin: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: calc(var(--r) + 6px); padding: 22px 22px 20px; }
.ff-asksheet[open] .ff-asksheet-in { animation: ff-drop .35s var(--ease) both; }
.ff-asksheet-x { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; width: 36px; height: 36px; border: 0; background: none; font-size: 24px; line-height: 1; border-radius: 999px; }
.ff-asksheet-x:hover { background: var(--surface); }

/* Media frames until licensed media lands */
.ff-media { width: 100%; height: 100%; object-fit: cover; }
.ff-frame { display: grid; place-items: end start; padding: 14px; min-height: 120px; background: color-mix(in srgb, var(--ink) 7%, var(--bg)); color: var(--muted); }
.ff-frame span { font: 500 12px/1.4 var(--font-n); max-width: 36ch; }

/* Scroll reveal */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.ff-static [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Footer */
.ff-foot { border-block-start: 1px solid var(--line); margin-block-start: clamp(64px, 10vw, 140px); }
.ff-foot-in { max-width: var(--max); margin-inline: auto; padding: 48px var(--gutter) 32px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.ff-foot-name { font-family: var(--font-d); font-size: 28px; font-weight: 600; }
.ff-foot-tag { color: var(--muted); margin-block-start: 6px; max-width: 34ch; }
.ff-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ff-foot a { text-decoration: none; }
.ff-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ff-foot-other p { font-size: 13px; color: var(--muted); margin-block-end: 10px; letter-spacing: .04em; text-transform: uppercase; }
.ff-foot-other a[aria-current] { text-decoration: underline; text-underline-offset: 3px; }
.ff-foot-base { max-width: var(--max); margin-inline: auto; padding: 18px var(--gutter) 40px; display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); border-block-start: 1px solid var(--line); }

/* Phone */
@media (max-width: 760px) {
  :root { --bar-h: 60px; }
  body { font-size: 16px; }
  .ff-bar { gap: 8px; }
  .ff-brand { margin-inline-end: 4px; }
  .ff-aud a { padding: 6px 10px; font-size: 13px; }
  .ff-bar > .ff-aud { display: none; }
  .ff-menu-wide, .ff-ask-btn kbd, .ff-bar > .ff-lang { display: none; }
  .ff-menu-narrow { display: inline; }
  .ff-ask-btn { padding: 0 12px; height: 40px; }
  .ff-menu { inset-block-end: 0; max-height: none; }
  .ff-menu-in { padding-block: 20px 28px; display: flex; flex-direction: column; min-height: 100%; }
  .ff-menu-list { grid-template-columns: 1fr; gap: 4px; }
  .ff-mi { grid-template-columns: 88px 1fr; column-gap: 14px; align-items: center; }
  .ff-mi-pre { grid-row: span 3; margin: 0; }
  .ff-menu-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-block-start: auto; padding-block-start: 24px; }
  .ff-menu-foot .ff-aud { display: inline-flex; }
  .ff-lang-m { text-decoration: none; padding: 10px 4px; }
  .ff-foot-in { grid-template-columns: 1fr; }
  .ff-foot-base { flex-direction: column; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .ff-ask-btn-t { display: none; }
}
