/* ═══════════════════════════════════════════════════════════════════════════
   BASE.CSS — Design tokens, reset, RTL typography foundation
   "Quiet premium": warm-ivory light flow · deep ink-navy moments ·
   one champagne-gold accent · hairlines over boxes · soft layered shadows.
   Font: Vazirmatn (Persian/Farsi) | Direction: RTL
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Self-hosted Persian font ─────────────────────────────────────────────────
   Vazirmatn variable font, served from our own origin (no Google Fonts CDN —
   it is unreliable/often blocked inside Iran). One file covers weights 100–900,
   so every --fw-* token (300–800) resolves without synthetic bolding. */
@font-face {
    font-family: 'Vazirmatn';
    src: url('/assets/fonts/vazirmatn/Vazirmatn-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Display serif for hero + section titles: Markazi Text (OFL) — a contemporary
   Naskh with a matching Latin serif, self-hosted for the same reason as
   Vazirmatn. Two subsets (Arabic-script + Latin), each a 400–700 variable file. */
@font-face {
    font-family: 'Markazi Text';
    src: url('/assets/fonts/markazi/MarkaziText-Arabic.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    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;
}
@font-face {
    font-family: 'Markazi Text';
    src: url('/assets/fonts/markazi/MarkaziText-Latin.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    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;
}

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
    /* Ink navy ramp — reserved for "moments" (hero, CTA, footer, dark cards) */
    --clr-navy-950:   #070D1A;   /* deepest — hero/footer/dark CTA base       */
    --clr-navy-900:   #0C1526;   /* dark surface                              */
    --clr-navy-800:   #142138;   /* raised dark / dark card / primary button  */
    --clr-navy-700:   #24344E;   /* hairline / hover on dark                   */
    --clr-navy-500:   #35507B;   /* hover accent border on light              */
    --clr-navy-100:   #ECF1F8;   /* light navy tint — icon bg, hover, active   */

    /* Champagne gold — the single load-bearing accent */
    --clr-sky-600:   #2C6DA8;   /* deep — accent text/hover on light          */
    --clr-sky-500:   #4FA3E3;   /* primary accent                             */
    --clr-sky-400:   #86C5F7;   /* luminous highlight on dark                 */
    --clr-sky-100:   #E6F2FC;   /* gold wash                                  */

    --clr-emerald-600: #0F7A57;
    --clr-emerald-500: #12996C;
    --clr-emerald-100: #D6F2E6;

    /* Warm neutral light system */
    --clr-slate-900:  #15202E;   /* primary ink text                           */
    --clr-slate-700:  #47515E;   /* secondary text                             */
    --clr-slate-500:  #737B87;   /* muted text                                 */
    --clr-slate-300:  #E7E3D9;   /* warm hairline border                       */
    --clr-slate-100:  #E1F5FE;   /* light-blue wash — alt sections             */
    --clr-white:      #FFFFFF;

    /* Neutral ink — the floating header card and the photo heroes */
    --clr-ink-950:    #0E0E10;   /* ground behind hero photos                  */
    --clr-ink-900:    #131419;   /* logo wordmark                               */
    --clr-ink-800:    #212121;   /* nav link text                               */
    --clr-ink-700:    #28292D;   /* dark pill CTA (.btn--ink)                   */
    --hero-scrim:      rgba(10, 10, 12, 0.5);    /* even veil over hero photos                  */
    --hero-scrim-edge: linear-gradient(to left, rgba(10, 10, 12, 0.4), rgba(10, 10, 12, 0) 70%); /* extra shade on the text (start) side */
    --hero-scrim-band: rgba(10, 10, 12, 0.65);   /* .photo-band — centred text can land on bright areas */

    --clr-danger-500: #D64545;
    --clr-danger-100: #F9E0E0;

    /* Semantic aliases */
    --color-primary:         var(--clr-navy-800);
    --color-primary-hover:   #1C2E4A;
    --color-accent:          var(--clr-sky-500);
    --color-accent-deep:     var(--clr-sky-600);
    --color-success:         var(--clr-emerald-500);
    --color-error:           var(--clr-danger-500);
    --color-text-primary:    var(--clr-slate-900);
    --color-text-secondary:  var(--clr-slate-700);
    --color-text-muted:      var(--clr-slate-500);
    --color-surface:         var(--clr-white);
    --color-surface-alt:     var(--clr-slate-100);
    --color-border:          var(--clr-slate-300);

    /* Accent glows / washes */
    --sky-soft:    rgba(79,163,227, 0.14);
    --sky-faint:   rgba(79,163,227, 0.08);
    --sky-glow:    rgba(79,163,227, 0.40);
    --line-on-dark: rgba(255, 255, 255, 0.09);

    /* Typography */
    --font-family:    'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    --font-display:   'Markazi Text', 'Vazirmatn', 'Tahoma', serif;
    --font-size-base: 1rem;        /* 16px */
    --line-height:    1.75;        /* Generous for Persian script */
    --letter-spacing: 0;           /* Persian never needs letter-spacing */

    /* Type scale (fluid via clamp) */
    --text-xs:   clamp(0.70rem, 0.66rem + 0.18vw, 0.75rem);
    --text-sm:   clamp(0.85rem, 0.80rem + 0.22vw, 0.9rem);
    --text-base: clamp(0.95rem, 0.90rem + 0.25vw, 1rem);
    --text-md:   clamp(1.05rem, 0.98rem + 0.36vw, 1.15rem);
    --text-lg:   clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
    --text-xl:   clamp(1.3rem,  1.15rem + 0.75vw, 1.65rem);
    --text-2xl:  clamp(1.55rem, 1.3rem  + 1.25vw, 2.10rem);
    --text-3xl:  clamp(1.9rem,  1.55rem + 1.75vw, 2.75rem);
    --text-4xl:  clamp(2.2rem,  1.8rem  + 2.2vw,  3.5rem);
    --text-5xl:  clamp(2.75rem, 2.2rem  + 2.75vw, 4.5rem);

    /* Font weights */
    --fw-light:   300;
    --fw-regular: 400;
    --fw-medium:  500;
    --fw-semibold:600;
    --fw-bold:    700;
    --fw-black:   800;

    /* Spacing scale */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    --section-y: clamp(4.5rem, 9vw, 8rem);

    /* Radii — softer, more premium */
    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  18px;
    --radius-xl:  26px;
    --radius-full:9999px;

    /* Shadows — soft, layered, navy-tinted (premium depth, not hard boxes) */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -14px rgba(15, 23, 42, 0.14);
    --shadow-md: 0 2px 8px rgba(15, 23, 42, 0.05), 0 22px 50px -20px rgba(15, 23, 42, 0.20);
    --shadow-lg: 0 4px 12px rgba(7, 13, 26, 0.06), 0 32px 80px -28px rgba(7, 13, 26, 0.32);
    --shadow-xl: 0 40px 100px -30px rgba(7, 13, 26, 0.45);

    /* Motion */
    --ease:       cubic-bezier(0.32, 0.72, 0, 1);   /* sheet ease — decisive, no bounce */
    --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
    --transition-fast:   150ms var(--ease);
    --transition-base:   280ms var(--ease);
    --transition-slow:   480ms var(--ease);

    /* Layout */
    --container-max:     1264px;   /* 1184px content at 40px gutters — the reference's card width */
    --container-padding: clamp(1.1rem, 5vw, 2.5rem);

    /* Floating header card: offset from the top edge + card height. <main>'s
       first section clears --header-h because the header overlays it. */
    --header-offset:     clamp(0.75rem, 1.25vw, 1.125rem);
    --header-card-h:     82px;
    --header-h:          calc(var(--header-offset) + var(--header-card-h));
    --radius-nav:        10px;

    /* Z-index layers */
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-modal:    300;
    --z-toast:    400;
}
@media (max-width: 1024px) {
    :root { --header-card-h: 64px; }
}

/* ── Modern Normalize + Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    font-family:    var(--font-family);
    font-size:      var(--text-base);
    font-weight:    var(--fw-regular);
    line-height:    var(--line-height);
    color:          var(--color-text-primary);
    background:     var(--color-surface);
    direction:      rtl;
    text-align:     right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: clip;   /* hide horizontal overflow without promoting body to a scroll container */
}

/* RTL-aware list reset */
ul, ol { list-style: none; }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* The `hidden` attribute must win over component display rules (e.g. .btn's
   inline-flex), otherwise JS toggling `hidden` has no visual effect. */
[hidden] { display: none !important; }

input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button { cursor: pointer; background: none; border: none; }

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--fw-bold);
    line-height: 1.22;
    color: var(--color-text-primary);
    text-wrap: balance;
}

/* Fluid headings */
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p { margin-block-end: var(--space-4); text-wrap: pretty; }
p:last-child { margin-block-end: 0; }

/* ── Accessibility ─────────────────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    inset-inline-start: -9999px;
    top: var(--space-4);
    padding: var(--space-2) var(--space-6);
    background: var(--clr-sky-500);
    color: var(--clr-navy-950);
    border-radius: var(--radius-full);
    z-index: var(--z-toast);
    font-weight: var(--fw-semibold);
}
.skip-link:focus { inset-inline-start: var(--space-4); }

:focus-visible {
    outline: 2px solid var(--clr-sky-500);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ── Selection ─────────────────────────────────────────────────────────────── */
::selection {
    background: rgba(79,163,227, 0.28);
    color: var(--clr-navy-950);
}

/* ── Scrollbar (WebKit) ────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--clr-slate-100); }
::-webkit-scrollbar-thumb { background: #CFC9BB; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--clr-sky-600); }
