/* ==========================================================================
   ROYESHE SABZ — core design system
   One land, two harvests. "Measured" (Supply) + "Lived" (Tilar).
   ========================================================================== */

:root {
  /* Land palette */
  --hyrcan: #0f1e16;      /* deep Hyrcanian forest */
  --hyrcan-2: #16291f;
  --moss: #22392b;
  --sprout: #a6c85a;      /* young rice shoot — the "sabz" of royesh */
  --sprout-dim: #6f8a3a;
  --narenj: #e8732c;      /* Thomson orange / sour orange */
  --narenj-soft: #f29a5e;
  --blossom: #f3efe4;     /* orange-blossom cream */
  --blossom-2: #ebe5d6;
  --fog: #d9ded6;
  --clay: #a85c40;
  --caspian: #6f8c8e;
  --ink: #0f1e16;
  --paper: #f3efe4;

  /* Type */
  --f-sans: "Geist", "Inter", system-ui, -apple-system, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-serif: "Instrument Serif", "Times New Roman", serif;
  --f-fa: "Vazirmatn", "Geist", sans-serif;

  /* Rhythm */
  --gutter: clamp(16px, 3.2vw, 48px);
  --max: 1440px;
  --r: 2px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  /* Page tokens (overridden per page/lens) */
  --bg: var(--hyrcan);
  --fg: var(--blossom);
  --muted: rgba(243, 239, 228, .56);
  --line: rgba(243, 239, 228, .14);
  --accent: var(--sprout);
}

/* Lenses ------------------------------------------------------------------ */
.lens-measured {
  --bg: var(--hyrcan);
  --fg: #e9eee4;
  --muted: rgba(233, 238, 228, .52);
  --line: rgba(166, 200, 90, .16);
  --accent: var(--sprout);
}
.lens-lived {
  --bg: var(--blossom);
  --fg: var(--hyrcan);
  --muted: rgba(15, 30, 22, .58);
  --line: rgba(15, 30, 22, .14);
  --accent: var(--narenj);
}

/* Reset ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
main { overflow-x: clip; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
::selection { background: var(--accent); color: var(--hyrcan); }
.fa { font-family: var(--f-fa); direction: rtl; unicode-bidi: isolate; }
.mono { font-family: var(--f-mono); letter-spacing: -.01em; }
.serif { font-family: var(--f-serif); font-weight: 400; letter-spacing: -.01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout ------------------------------------------------------------------ */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { position: relative; padding: clamp(96px, 14vw, 200px) 0; }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 var(--gutter); }
.hairline { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Type scale -------------------------------------------------------------- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.eyebrow.no-dot::before { display: none; }
.d1 { font-size: clamp(56px, 10.5vw, 188px); line-height: .9; letter-spacing: -.045em; font-weight: 400; margin: 0; }
.d2 { font-size: clamp(42px, 6.6vw, 112px); line-height: .95; letter-spacing: -.04em; font-weight: 400; margin: 0; }
.d3 { font-size: clamp(32px, 4.2vw, 64px); line-height: 1.02; letter-spacing: -.03em; font-weight: 400; margin: 0; }
.d4 { font-size: clamp(22px, 2.2vw, 32px); line-height: 1.15; letter-spacing: -.02em; font-weight: 400; margin: 0; }
.lede { font-size: clamp(17px, 1.35vw, 21px); line-height: 1.5; color: var(--muted); max-width: 46ch; margin: 0; }
.serif.d1, .serif.d2, .serif.d3 { letter-spacing: -.02em; }
.serif em, em.serif { font-style: italic; }

/* Buttons ----------------------------------------------------------------- */
.btn {
  --b-bg: var(--fg); --b-fg: var(--bg);
  position: relative; display: inline-flex; align-items: center; gap: 14px;
  height: 52px; padding: 0 22px 0 24px;
  background: var(--b-bg); color: var(--b-fg);
  font-size: 14px; font-weight: 500; letter-spacing: -.005em;
  border-radius: 100px; overflow: hidden; isolation: isolate;
  transition: transform .5s var(--ease);
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--accent); transform: translateY(101%); border-radius: inherit;
  transition: transform .55s var(--ease);
}
.btn:hover::after { transform: translateY(0); }
.btn:hover { color: var(--hyrcan); }
.btn .arr { width: 16px; height: 16px; transition: transform .5s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn.ghost { --b-bg: transparent; --b-fg: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { color: var(--hyrcan); box-shadow: none; }
.link-u { position: relative; display: inline-flex; gap: 8px; align-items: center; }
.link-u::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform-origin: right; transform: scaleX(0); transition: transform .5s var(--ease); }
.link-u:hover::after { transform-origin: left; transform: scaleX(1); }

/* Navigation -------------------------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  color: var(--fg);
  transition: transform .6s var(--ease), color .6s var(--ease);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav.hide { transform: translateY(-110%); }
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  transition: opacity .5s var(--ease);
}
.nav.solid::before { opacity: 1; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand svg { width: 30px; height: 30px; }
.brand .wm { display: flex; flex-direction: column; line-height: 1; gap: 4px; }
.brand .wm b { font-weight: 500; font-size: 14px; letter-spacing: .02em; }
.brand .wm span { font-family: var(--f-fa); font-size: 11px; color: var(--muted); }
.nav-links { display: flex; gap: 4px; padding: 5px; border-radius: 100px; box-shadow: inset 0 0 0 1px var(--line); background: color-mix(in srgb, var(--bg) 40%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nav-links a { position: relative; font-size: 13px; padding: 8px 14px; border-radius: 100px; color: var(--muted); transition: color .3s, background-color .3s; }
.nav-links a:hover { color: var(--fg); }
.nav-links a[aria-current="page"] { color: var(--bg); background: var(--fg); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.lang-sw { height: 34px; min-width: 34px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 100px; box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--fg); transition: background-color .3s, color .3s; }
.lang-sw[lang="en"] { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; }
.lang-sw[lang="fa"] { font-family: var(--f-fa); }
.lang-sw:hover { background: var(--fg); color: var(--bg); }
.chip {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  height: 34px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px;
  border-radius: 100px; box-shadow: inset 0 0 0 1px var(--line); color: var(--fg);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
.burger { display: none; width: 42px; height: 42px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.burger i { position: absolute; left: 13px; right: 13px; height: 1.5px; background: currentColor; transition: transform .4s var(--ease); }
.burger i:nth-child(1) { top: 17px; } .burger i:nth-child(2) { top: 24px; }
.menu-open .burger i:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.menu-open .burger i:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 55; background: var(--hyrcan); color: var(--blossom);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 100px var(--gutter) 40px;
  clip-path: inset(0 0 100% 0); transition: clip-path .8s var(--ease-io);
}
.menu-open .mobile-menu { clip-path: inset(0 0 0 0); }
.mobile-menu a { font-size: 13vw; line-height: 1.05; letter-spacing: -.04em; display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid rgba(243,239,228,.12); padding: 8px 0; }
.mobile-menu a.ms-lang { font-size: inherit; line-height: inherit; display: inline; border: 0; padding: 0; white-space: nowrap; opacity: 1; }
.mobile-menu a small { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; opacity: .5; }

/* Cursor ------------------------------------------------------------------ */
.cursor { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; mix-blend-mode: difference; }
.cursor .c-dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; }
.cursor .c-ring { position: absolute; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; border: 1px solid rgba(255,255,255,.7); transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), border-color .35s; }
.cursor.hover .c-ring { width: 70px; height: 70px; margin: -35px 0 0 -35px; border-color: #fff; }
.cursor .c-label { position: absolute; left: 18px; top: 14px; font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; color: #fff; white-space: nowrap; opacity: .8; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* Loader ------------------------------------------------------------------ */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--hyrcan); color: var(--blossom);
  display: grid; place-items: center;
}
.loader .l-mark { width: 72px; height: 72px; }
.loader .l-mark path { stroke-dasharray: 60; stroke-dashoffset: 60; }
.loader .l-meta { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px; display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .6; }
.loader .l-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--sprout); transform-origin: left; transform: scaleX(0); }

/* Page transition --------------------------------------------------------- */
.curtain { position: fixed; inset: 0; z-index: 90; pointer-events: none; display: grid; grid-template-columns: repeat(6, 1fr); }
.curtain i { background: var(--hyrcan); transform: scaleY(0); transform-origin: bottom; }
.curtain.to-lived i { background: var(--blossom); }
.curtain.to-measured i { background: var(--hyrcan); }

/* Reveal utilities -------------------------------------------------------- */
.split-line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.split-line > span { display: inline-block; will-change: transform; }
.w { display: inline-block; }
[data-reveal] { opacity: 0; transform: translateY(24px); }
.no-js [data-reveal], .reduced [data-reveal] { opacity: 1; transform: none; }

/* Marquee ----------------------------------------------------------------- */
.marquee { overflow: hidden; white-space: nowrap; border-block: 1px solid var(--line); }
.marquee-track { display: inline-flex; gap: 48px; padding: 14px 0; animation: marquee 40s linear infinite; }
.marquee-track span { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: inline-flex; gap: 48px; align-items: center; }
.marquee-track span::after { content: "✳"; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Footer ------------------------------------------------------------------ */
.footer { position: relative; background: var(--hyrcan); color: var(--blossom); padding: 120px 0 28px; overflow: hidden; }
.footer .f-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px var(--gutter); }
.footer h4 { font-family: var(--f-mono); font-weight: 400; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(243,239,228,.45); margin: 0 0 18px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; }
.footer ul a { color: rgba(243,239,228,.85); }
.footer ul a:hover { color: var(--sprout); }
.footer .f-news { display: flex; border-bottom: 1px solid rgba(243,239,228,.25); margin-top: 22px; max-width: 360px; }
.footer .f-news input { flex: 1; background: none; border: 0; outline: 0; padding: 12px 0; color: var(--blossom); }
.footer .f-news input::placeholder { color: rgba(243,239,228,.4); }
.footer .f-giant { margin-top: 120px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.footer .f-giant .lat { font-size: clamp(64px, 15vw, 260px); line-height: .78; letter-spacing: -.06em; font-weight: 400; }
.footer .f-giant .fa { font-size: clamp(48px, 9vw, 160px); line-height: .9; font-weight: 700; color: var(--sprout); }
.footer .f-bottom { margin-top: 48px; padding-top: 20px; border-top: 1px solid rgba(243,239,228,.12); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(243,239,228,.45); }

/* Forms ------------------------------------------------------------------- */
.field { display: grid; gap: 8px; }
.field label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  background: transparent; border: 0; border-bottom: 1px solid var(--line); outline: 0;
  padding: 12px 0; font-size: 17px; color: var(--fg); border-radius: 0; appearance: none; -webkit-appearance: none;
  transition: border-color .3s;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 10px) 50%, calc(100% - 5px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { color: #111; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }

/* Toast ------------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 80; transform: translate(-50%, 140%); background: var(--fg); color: var(--bg); padding: 14px 20px; border-radius: 100px; font-size: 14px; display: flex; gap: 10px; align-items: center; transition: transform .6s var(--ease); max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }


/* ==========================================================================
   PERSIAN / RTL  — <html lang="fa" dir="rtl">
   Measured voice = Vazirmatn (constructed, even). Lived voice = Markazi Text
   (a Naskh drawn by an Iranian designer; the written hand). Persian is never
   letter-spaced, never italicised, and always gets room for its descenders.
   ========================================================================== */
:root[dir="rtl"] {
  --f-sans: "Vazirmatn", "Geist", system-ui, sans-serif;
  --f-serif: "Markazi Text", "Noto Naskh Arabic", "Vazirmatn", serif;
  --f-mono: "Geist Mono", "Vazirmatn", ui-monospace, monospace;
  --f-lat: "Geist", system-ui, sans-serif;
}
[dir="rtl"] body { line-height: 1.85; font-size: 16.5px; font-feature-settings: "ss01"; }
/* No tracking on Persian. Latin runs opt back in with lang="en". */
[dir="rtl"] *:not([lang="en"]):not([lang="en"] *) { letter-spacing: 0 !important; }
[dir="rtl"] [lang="en"] { font-family: var(--f-lat); direction: ltr; unicode-bidi: isolate; }
/* a Latin block inside RTL keeps the parent's alignment instead of flipping to the left */
:where([dir="rtl"] [lang="en"]) { text-align: match-parent; }
[dir="rtl"] .mono[lang="en"], [dir="rtl"] [lang="en"].mono, [dir="rtl"] .mono [lang="en"] { font-family: "Geist Mono", ui-monospace, monospace; }
[dir="rtl"] em:not([lang="en"]), [dir="rtl"] i:not([lang="en"]) { font-style: normal; }
[dir="rtl"] .serif { font-weight: 500; }

[dir="rtl"] .d1 { line-height: 1.12; font-weight: 300; }
[dir="rtl"] .d2 { line-height: 1.18; font-weight: 300; }
[dir="rtl"] .d3 { line-height: 1.3; font-weight: 400; }
[dir="rtl"] .d4 { line-height: 1.55; font-weight: 400; }
[dir="rtl"] .serif.d1, [dir="rtl"] .serif.d2, [dir="rtl"] .serif.d3 { font-weight: 500; line-height: 1.15; }
[dir="rtl"] .lede { line-height: 1.9; max-width: 42ch; }
[dir="rtl"] .eyebrow, [dir="rtl"] .chip, [dir="rtl"] .field label, [dir="rtl"] .footer h4,
[dir="rtl"] .marquee-track span, [dir="rtl"] .footer .f-bottom, [dir="rtl"] .loader .l-meta { font-size: 12.5px; }
[dir="rtl"] .split-line { padding: .12em 0 .26em; margin: -.12em 0 -.26em; }

/* Direction-aware motion & ornaments */
[dir="rtl"] .arr { transform: scaleX(-1); }
[dir="rtl"] .btn:hover .arr { transform: scaleX(-1) translateX(4px); }
[dir="rtl"] .btn { padding: 0 24px 0 22px; }
[dir="rtl"] .link-u::after { transform-origin: left; }
[dir="rtl"] .link-u:hover::after { transform-origin: right; }
[dir="rtl"] .loader .l-bar { transform-origin: right; }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { to { transform: translateX(50%); } }
[dir="rtl"] .field select { background-position: 5px 50%, 10px 50%; padding-left: 20px; }
[dir="rtl"] .field input[type="email"], [dir="rtl"] .field input[type="tel"] { direction: ltr; text-align: right; }

/* Brand, nav, menu, footer */
[dir="rtl"] .brand .wm b { font-size: 16px; font-weight: 600; }
[dir="rtl"] .brand .wm span { font-family: "Geist Mono", monospace; font-size: 9px; letter-spacing: .16em; }
[dir="rtl"] .nav-links a { font-size: 13.5px; }
[dir="rtl"] .mobile-menu a:not(.ms-lang) { font-size: 11vw; line-height: 1.45; font-weight: 300; }
[dir="rtl"] .footer .f-giant .fa { white-space: nowrap; font-size: clamp(76px, 14vw, 250px); line-height: 1.05; font-weight: 800; color: var(--blossom); }
[dir="rtl"] .footer .f-giant .lat { white-space: nowrap; font-size: clamp(30px, 4.4vw, 80px); line-height: 1; color: var(--sprout); letter-spacing: -.04em; }
[dir="rtl"] .footer ul { font-size: 15.5px; }
[dir="rtl"] .cursor .c-label { font-family: var(--f-sans); font-size: 11px; }
@media (max-width: 960px) {
  [dir="rtl"] .footer .f-giant { align-items: flex-start; }
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 960px) {
  .nav-links, .nav-right .hide-m { display: none; }
  .burger { display: inline-block; }
  .footer .f-top { grid-template-columns: 1fr 1fr; }
  .footer .f-top > :first-child { grid-column: 1 / -1; }
  .footer .f-giant { flex-direction: column; align-items: flex-start; margin-top: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
