/* ==========================================================================
   HMAYED Design System: "Viewfinder"
   --------------------------------------------------------------------------
   Built from the HMAYED brand marks: the viewfinder corner brackets, the bold
   condensed wordmark, ink #1F1C1D on bone #F0F0EB. One signal colour, "tally",
   borrowed from the camera's record light, is used sparingly for state.

   Three layers:
     1. Fonts         self-hosted, subset by script
     2. Primitives    raw values; components never reference these directly
     3. Semantic      what components consume; remapped per surface
                      (.surface-ink / .surface-bone) so any component works on
                      either background without modification.
   ========================================================================== */

/* Layer order for the whole site. Tokens sit lowest so components win. */
@layer tokens, reset, base, layout, components, utilities;

/* 1. Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  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;
}

/* Metric-matched fallback so the swap to Inter does not shift layout. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  ascent-override: 90.2%;
  descent-override: 22.48%;
  line-gap-override: 0%;
  size-adjust: 107.4%;
}

@font-face {
  font-family: "Roboto Condensed";
  src: url("../fonts/roboto-condensed-700-latin.woff2") format("woff2");
  font-weight: 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;
}

/* Arabic only: Latin text never downloads this file. */
@font-face {
  font-family: "Cairo";
  src: url("../fonts/cairo-var-arabic.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011,
    U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

/* 2. Primitives ------------------------------------------------------------ */

@layer tokens {
:root {
  /* Ink: warm near-blacks from the logo */
  --ink-1000: #0b0a0a;
  --ink-950: #121011;
  --ink-900: #1f1c1d; /* brand ink */
  --ink-800: #2a2627;
  --ink-700: #3a3536;
  --ink-500: #6e6869;

  /* Stone: mid neutrals, reserved for muted text and UI borders */
  --stone-400: #8a8485; /* 3.2:1 on bone: UI borders */
  --stone-300: #a39e95; /* 7.1:1 on ink-950: muted text on dark */
  --stone-600: #5e5859; /* 6.1:1 on bone: muted text on light */

  /* Bone: warm off-whites from the logo */
  --bone-300: #d6d4cb;
  --bone-200: #e4e3db;
  --bone-100: #f0f0eb; /* brand bone */
  --bone-50: #f7f7f3;

  /* Tally: the record light. State and emphasis only, never large fills. */
  --tally-400: #ff5a42; /* 6.1:1 on ink-950 */
  --tally-600: #c2311e; /* 4.9:1 on bone-100 */

  /* Type families */
  --font-body: "Inter", "Inter Fallback", "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Roboto Condensed", "Cairo", "Arial Narrow", "Inter Fallback", sans-serif;
  --font-arabic: "Cairo", "Inter", system-ui, sans-serif;

  /* Fluid type scale: min at 360px viewport, max at 1440px */
  --step--2: 0.75rem;
  --step--1: clamp(0.8125rem, 0.792rem + 0.093vw, 0.875rem);
  --step-0: clamp(1rem, 0.958rem + 0.185vw, 1.125rem);
  --step-1: clamp(1.125rem, 1.042rem + 0.37vw, 1.375rem);
  --step-2: clamp(1.375rem, 1.208rem + 0.741vw, 1.875rem);
  --step-3: clamp(1.75rem, 1.417rem + 1.481vw, 2.75rem);
  --step-4: clamp(2.25rem, 1.667rem + 2.593vw, 4rem);
  --step-5: clamp(2.75rem, 1.5rem + 5.556vw, 6.5rem);

  --leading-display: 0.92;
  --leading-heading: 1.04;
  --leading-snug: 1.3;
  --leading-body: 1.6;

  --tracking-display: -0.005em;
  --tracking-label: 0.14em;

  /* Spacing: 4px base */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* Layout */
  --container: 80rem;
  --container-prose: 44rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 3rem);
  --section-pad: clamp(4rem, 2.5rem + 6.5vw, 9rem);
  --header-h: 4.5rem;

  /* Shape: the brand is square. Corners stay sharp. */
  --radius-0: 0;
  --radius-1: 2px;
  --radius-round: 999px;
  --border-w: 1px;

  /* Viewfinder brackets */
  --frame-w: 2px;
  --frame-len: clamp(1.125rem, 0.9rem + 1vw, 2rem);
  --frame-gap: clamp(0.5rem, 0.35rem + 0.6vw, 0.875rem);

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 140ms;
  --dur-base: 240ms;
  --dur-slow: 640ms;

  /* Elevation */
  --shadow-pop: 0 1.5rem 3rem -1rem rgb(0 0 0 / 0.55);

  /* Stacking */
  --z-fab: 40;
  --z-header: 50;
  --z-dialog: 100;
}

/* 3. Semantic tokens per surface ------------------------------------------ */

/* Dark is the default surface: footage reads best on ink. */
:root,
.surface-ink {
  color-scheme: dark;
  --surface: var(--ink-950);
  --surface-raised: var(--ink-900);
  --surface-sunken: var(--ink-1000);
  --text: var(--bone-100);
  --text-muted: var(--stone-300);
  --line: rgb(240 240 235 / 0.12);
  --line-strong: rgb(240 240 235 / 0.4);
  --accent: var(--tally-400);
  --focus: var(--tally-400);
  --frame: var(--bone-100);
  --action-bg: var(--bone-100);
  --action-fg: var(--ink-900);
  --action-bg-hover: #ffffff;
  --control-bg: var(--ink-900);
  --scrim: linear-gradient(180deg, rgb(11 10 10 / 0) 35%, rgb(11 10 10 / 0.78) 100%);
}

.surface-ink-raised {
  --surface: var(--ink-900);
  --surface-raised: var(--ink-800);
}

.surface-bone {
  color-scheme: light;
  --surface: var(--bone-100);
  --surface-raised: var(--bone-50);
  --surface-sunken: var(--bone-200);
  --text: var(--ink-900);
  --text-muted: var(--stone-600);
  --line: rgb(31 28 29 / 0.12);
  --line-strong: var(--stone-400);
  --accent: var(--tally-600);
  --focus: var(--tally-600);
  --frame: var(--ink-900);
  --action-bg: var(--ink-900);
  --action-fg: var(--bone-100);
  --action-bg-hover: var(--ink-700);
  --control-bg: var(--bone-50);
  --scrim: linear-gradient(180deg, rgb(11 10 10 / 0) 35%, rgb(11 10 10 / 0.78) 100%);
}

.surface-ink,
.surface-ink-raised,
.surface-bone {
  background-color: var(--surface);
  color: var(--text);
}
} /* end @layer tokens */
