/*
  Shared responsive type system
  -----------------------------
  One fluid scale for the portfolio, biography/CV and speaking archive.
  Component CSS continues to own font family, weight and character; this file
  keeps equivalent typographic roles the same size at every viewport.
*/

:root {
  --type-identity: clamp(2rem, 2.8vw, 2.75rem);
  --type-display: clamp(2.875rem, 3.8vw, 3.75rem);
  --type-card-title: clamp(2.3125rem, 3.25vw, 3rem);
  --type-bio-one: clamp(1.625rem, 1.9vw, 1.875rem);
  --type-subhead: clamp(1.625rem, 2vw, 2rem);
  --type-title: clamp(1rem, 1.4vw, 1.3125rem);
  --type-standfirst: clamp(1.0625rem, 1.18vw, 1.1875rem);
  --type-body: clamp(.96875rem, 1vw, 1.03125rem);
  --type-body-small: clamp(.875rem, .94vw, .9375rem);
  --type-nav: .9375rem;
  --type-mono-large: clamp(.8125rem, .9vw, .875rem);
  --type-mono: clamp(.75rem, .78vw, .8125rem);
  --type-mono-small: clamp(.6875rem, .7vw, .75rem);
  --type-devanagari: clamp(.875rem, 1.21vw, 1.1875rem);
  --type-ipa: clamp(.69375rem, .971vw, .953125rem);
}

/* Persistent identity and navigation */
.identity-name { font-size: var(--type-identity); }
.identity-dev { font-size: var(--type-devanagari); }
.identity-ipa { font-size: var(--type-ipa); }
.primary-nav a { font-size: var(--type-nav); }
.view-switch button,
.index-toggle { font-size: var(--type-mono); }

/* Page-level titles: the same visual role on every page */
.hero h1,
.vantage-heading-copy h2,
.work-heading-copy h2,
.lab-heading h2,
.contact-copy h2,
.contact-heading h2,
.page-heading h1,
.speaking-heading h1 {
  font-size: var(--type-display);
}

/* Standfirsts and introductory copy */
.hero-copy,
.vantage-thesis,
.work-heading-copy p,
.contact-standfirst,
.contact-note,
.standfirst,
.speaking-standfirst {
  font-size: var(--type-standfirst);
}

/* Record, sheet and experiment titles */
.vantage-sheet-title,
.work-sheet-title,
.experiment-card h3 {
  font-size: var(--type-card-title);
}

.section-heading h2,
.cv-entry h3,
.mini-record h3 {
  font-size: var(--type-subhead);
}

.vantage-tab-title,
.work-tab-title,
.bio-tab-label,
.event-title {
  font-size: var(--type-title);
}

/* Reading copy never drops below 16px */
.vantage-sheet-copy,
.work-sheet-copy,
.experiment-card p,
.bio-copy,
.event-organiser,
.mini-record p {
  font-size: var(--type-body);
}

/* A single responsive mono scale for labels, metadata and controls */
.vantage-kicker,
.work-heading .section-index,
.lab-heading .section-index,
.archive-tools,
.site-colophon {
  font-size: var(--type-mono-large);
}

.section-index,
.vantage-sheet-head,
.vantage-sheet-parent,
.work-filter,
.work-filter select,
.work-sheet-head,
.work-sheet-parent,
.work-phases li,
.work-sheet-role strong,
.work-sheet-links a,
.lab-question-label,
.lab-experiment-head,
.experiment-card-head,
.experiment-card-kicker,
.experiment-card-meta,
.experiment-card-foot,
.form-field label,
.contact-form-foot p,
.contact-form button,
.record-head,
.cv-toolbar span,
.cv-label,
.cv-date,
.machine-record-head,
.speaking-year,
.event-date,
.event-place {
  font-size: var(--type-mono);
}

.vantage-tab-number,
.vantage-tab-mark,
.vantage-deliverables span,
.vantage-route span,
.work-tab-number,
.work-sheet-role span,
.work-sheet-links span,
.bio-tab-number,
.mini-record-label,
.mini-record a,
.language-list li,
.ledger-columns {
  font-size: var(--type-mono-small);
}

/* Keep reading rhythm stable while the size changes. */
.hero-copy,
.vantage-thesis,
.work-heading-copy p,
.contact-standfirst,
.contact-note,
.standfirst,
.speaking-standfirst { line-height: 1.55; }

.vantage-sheet-copy,
.work-sheet-copy,
.experiment-card p,
.bio-copy,
.event-organiser,
.mini-record p { line-height: 1.55; }

/* Short landscape windows need slightly less display scale, not tiny body copy. */
@media (min-width: 821px) and (max-height: 760px) {
  :root {
    --type-display: clamp(2.75rem, 3.45vw, 3.375rem);
    --type-card-title: clamp(2.25rem, 2.9vw, 2.625rem);
    --type-bio-one: clamp(1.5rem, 1.8vw, 1.75rem);
  }
}

@media (max-width: 820px) {
  :root {
    --type-display: clamp(2.25rem, 9.3vw, 2.625rem);
    --type-card-title: clamp(2.25rem, 10vw, 2.75rem);
    --type-bio-one: clamp(1.375rem, 5.9vw, 1.625rem);
    --type-subhead: clamp(1.5rem, 5.8vw, 1.75rem);
    --type-title: clamp(.9375rem, 4.2vw, 1.0625rem);
    --type-nav: .75rem;
    --type-mono-large: .8125rem;
    --type-mono: .75rem;
    --type-mono-small: .6875rem;
  }
}

@media (max-width: 480px) {
  :root {
    --type-identity: 1.9375rem;
    --type-standfirst: 1rem;
    --type-body: 1rem;
    --type-devanagari: .9375rem;
    --type-ipa: .6875rem;
  }
}
