/*
  Tehran Pars brand foundation, ROUND 2: conservatoire scale.
  Kept from the client's brand brief: the six colour tokens, Fraunces for headings and
  numbers, Inter for everything else, no weight above 500, tabular figures for prices,
  one orange button per page, the five-line stave, the voice.
  Relaxed on the user's instruction (2026-09-18: the benchmark, Guildhall, is the quality
  bar): the H1 cap of 52px, the Paper-only ground (Ink now carries dark "stage" bands),
  and hairline-only section breaks. Oxblood still fills no large area except the footer.
  Paths are relative to this file (assets/tokens.css).
*/

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/fraunces-400-500-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* Brand tokens (exact hex from the brief) */
  --ink: #1A1817;
  --ink-muted: #6B6764;
  --oxblood: #71302B;
  --sand: #E8E2DA;
  --orange: #E8761B;
  --paper: #FAF8F6;

  /* Derived neutrals: mixes of the brand tokens, never new hues */
  --line: color-mix(in srgb, var(--ink) 11%, var(--paper));        /* row dividers inside a list */
  --rule: color-mix(in srgb, var(--oxblood) 32%, var(--paper));    /* the Oxblood hairline between sections */
  --rule-strong: var(--oxblood);                                     /* group heading underline (pricing) */
  --field: color-mix(in srgb, var(--paper) 35%, #ffffff);            /* form field fill */
  --field-line: color-mix(in srgb, var(--ink) 20%, var(--paper));
  --on-oxblood: var(--paper);
  --on-oxblood-muted: color-mix(in srgb, var(--paper) 72%, var(--oxblood));

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-text: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --h1: clamp(2rem, 1.2rem + 2.6vw, 3.25rem);    /* 32px phone to 52px desktop */
  --h2: clamp(1.625rem, 1.3rem + 1vw, 1.875rem); /* 26 to 30px */
  --h3: 1.375rem;                                  /* 22px */
  --body: 1.0625rem;                               /* 17px */
  --lead: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --small: 0.875rem;                               /* 14px */
  --eyebrow: 0.625rem;                             /* 10px, per the brief */
  --measure: 40ch;                                 /* lands near 46 real characters per line: in Inter, 1ch (the
                                                      width of a zero) is wider than the average letter */

  /* Conservatoire scale (round 2). Measured against Guildhall: H1 90px, H2 80px, 150px sections. */
  --display: clamp(3.25rem, 1.1rem + 7.2vw, 8rem);        /* 52px phone to 128px desktop: hero headline */
  --display-2: clamp(2.5rem, 1.2rem + 4.4vw, 5.5rem);     /* 40px to 88px: section headlines */
  --display-3: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem);   /* 28px to 44px: sub-headlines, big list entries */
  --stat: clamp(4.5rem, 2rem + 9vw, 10rem);               /* the big-number moments */

  /* The stage: Ink grounds for dramatic bands (Guildhall's black, in the brand's own Ink) */
  --stage: var(--ink);
  --on-stage: var(--paper);
  --on-stage-muted: color-mix(in srgb, var(--paper) 66%, var(--ink));
  --stage-line: color-mix(in srgb, var(--paper) 16%, var(--ink));

  /* Space */
  --gutter: clamp(1rem, 4.5vw, 4rem);
  --container: 75rem;                              /* 1200px */
  --section: clamp(5rem, 3rem + 8vw, 10rem);       /* 80px phone to 160px desktop, the benchmark's rhythm */
  --container-wide: 100rem;                        /* 1600px, for full-bleed-adjacent bands */
  --radius: 4px;                                   /* one radius for every interactive control; everything else square */

  /* Motion (strong custom curves; UI under 300ms) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-press: 140ms;
  --dur-ui: 220ms;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--body)/1.7 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: color-mix(in srgb, var(--oxblood) 24%, var(--paper)); color: var(--ink); }

/* Headings: Fraunces 500, optical sizing on, balanced wrapping */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 500;
  font-optical-sizing: auto;
  text-wrap: balance;
  margin: 0;
}
h1, .h1 { font-size: var(--h1); line-height: 1.1; letter-spacing: -0.012em; color: var(--ink); }
h2, .h2 { font-size: var(--h2); line-height: 1.2; letter-spacing: -0.006em; color: var(--oxblood); }
h3, .h3 { font-size: var(--h3); line-height: 1.3; color: var(--ink); }
p { margin: 0; text-wrap: pretty; }

.lead { font-size: var(--lead); line-height: 1.65; color: var(--ink-muted); max-width: var(--measure); }
.small { font-size: var(--small); line-height: 1.55; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }

/* Eyebrow: 10px, letterspaced, uppercase, Inter 500, Oxblood. Hero only (brief pattern). */
.display-1 { font-size: var(--display); line-height: 0.98; letter-spacing: -0.022em; }
.display-2 { font-size: var(--display-2); line-height: 1.02; letter-spacing: -0.016em; }
.display-3 { font-size: var(--display-3); line-height: 1.12; letter-spacing: -0.01em; }
.on-stage { background: var(--stage); color: var(--on-stage); }
.on-stage h1, .on-stage h2, .on-stage h3 { color: var(--on-stage); }
.on-stage .lead, .on-stage .small, .on-stage .muted { color: var(--on-stage-muted); }
.on-stage a { color: var(--on-stage); }
.on-stage :focus-visible { outline-color: var(--orange); }
.on-stage .btn-secondary { color: var(--on-stage); border-color: var(--on-stage); }
@media (hover: hover) and (pointer: fine) { .on-stage .btn-secondary:hover { background: color-mix(in srgb, var(--paper) 10%, var(--ink)); } }

.eyebrow {
  font: 500 var(--eyebrow)/1.4 var(--font-text);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin: 0;
}

/* Numbers set in Fraunces (stat bands); prices set in Inter 500 tabular */
.num { font-family: var(--font-display); font-weight: 500; font-optical-sizing: auto; font-variant-numeric: lining-nums; }
.price { font-family: var(--font-text); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }

/* Links */
a { color: var(--oxblood); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }

/* Focus: always visible, Oxblood on Paper, Paper on Oxblood */
:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 3px; border-radius: 2px; }
.on-oxblood :focus-visible { outline-color: var(--paper); }

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 0.75rem 1rem; border-radius: var(--radius);
  text-decoration: none; font-weight: 500;
}
.skip-link:focus { top: 0.75rem; }

/* The mark: five hairlines from the logo, once per page, above the main heading */
.stave {
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 0;
}
.stave > span { display: block; height: 1px; background: var(--sand); }

/* Buttons: one orange per page (Ink text on Orange), second always outlined in Oxblood */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 52px; padding: 0.8rem 1.6rem;
  font: 500 1.0625rem/1.2 var(--font-text);
  border-radius: var(--radius);
  text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-ui) ease, border-color var(--dur-ui) ease, color var(--dur-ui) ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--orange); color: var(--ink); }
.btn-secondary { background: transparent; color: var(--oxblood); border-color: var(--oxblood); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: color-mix(in srgb, var(--orange) 88%, var(--ink)); }
  .btn-secondary:hover { background: color-mix(in srgb, var(--oxblood) 6%, var(--paper)); }
}
.btn .icon { width: 1.1em; height: 1.1em; flex: none; }

/* Forms: visible labels (Ink muted), 16px+ input text, 52px targets */
.field { display: grid; gap: 0.4rem; }
.field label { font: 400 var(--small)/1.4 var(--font-text); color: var(--ink-muted); }
.field input, .field select {
  width: 100%; min-height: 52px; padding: 0.75rem 0.9rem;
  font: 400 1.0625rem/1.3 var(--font-text); color: var(--ink);
  background: var(--field); border: 1px solid var(--field-line); border-radius: var(--radius);
  transition: border-color var(--dur-ui) ease, box-shadow var(--dur-ui) ease;
  appearance: none; -webkit-appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 2.5rem;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--oxblood); box-shadow: 0 0 0 3px color-mix(in srgb, var(--oxblood) 18%, transparent); }
.field .error { font-size: var(--small); color: var(--oxblood); }
.field [aria-invalid="true"] { border-color: var(--oxblood); }

/* Oxblood footer: the one large Oxblood fill the brief allows */
.site-footer { background: var(--oxblood); color: var(--on-oxblood); }
.site-footer a { color: var(--on-oxblood); }
.site-footer .muted { color: var(--on-oxblood-muted); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { width: 1.25rem; height: 1.25rem; flex: none; }
