/* ==========================================================================
   JEEV TECH — Base Typography & Styles
   ========================================================================== */

/* ---- Font Face Declarations (self-hosted) ---- */

@font-face {
  font-family: 'Newsreader';
  src: url('../fonts/newsreader-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Newsreader';
  src: url('../fonts/newsreader-italic.woff2') format('woff2');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Source Serif 4';
  src: url('../fonts/sourceserif4-normal.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Source Serif 4';
  src: url('../fonts/sourceserif4-italic.woff2') format('woff2');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---- Anchor targets ----
   The header is fixed, so a raw jump puts the heading underneath it and
   lands the reader mid-section. Every linkable target keeps clear space
   above it so the section label and heading arrive together. */

h1[id],
h2[id],
h3[id],
.section[id],
.areas__item[id],
[id^="note-"] {
  scroll-margin-top: 7rem;
}

/* ---- Body ---- */

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--ink);
  background-color: var(--ground);
}

/* ---- Headings ---- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  /* Even out the rag rather than filling each line before breaking. On a
     three-line statement the difference between a full line and a two-word
     one is the difference between typeset and typed. Ignored by browsers
     that do not have it, which simply get the old greedy break. */
  text-wrap: balance;
}

h1 {
  font-size: var(--text-hero);
  line-height: var(--lh-tight);
}

h2 {
  font-size: var(--text-h2);
}

h3 {
  font-size: var(--text-h3);
}

/* ---- Body Copy ---- */

p {
  max-width: var(--measure);
  margin-bottom: var(--space-md);
  /* Running prose gets the weaker of the two: balance would even every
     paragraph into a block and cost the rag its life. This only prevents the
     last line from being a single word. */
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

/* ---- Links ---- */

a {
  color: var(--ink);
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
  transition: color var(--duration-sm) var(--ease-out),
    text-decoration-color var(--duration-sm) var(--ease-out);
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Links inside running prose need an underline. The reset clears
   text-decoration globally, and the rule above only sets its colour — so
   without this a prose link is the same colour and weight as the sentence
   around it and is invisible until hovered. Colour alone cannot carry the
   meaning anyway (WCAG 1.4.1). Unclassed links only: nav, footer, entry
   links and band links all carry their own treatment. */
p a:not([class]),
dd a:not([class]),
li a:not([class]),
blockquote a:not([class]) {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
}

/* ---- Blockquotes ---- */

blockquote {
  max-width: var(--measure);
  padding-left: var(--space-md);
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  margin-bottom: var(--space-lg);
}

blockquote p {
  margin-bottom: var(--space-sm);
}

/* ---- Hero ---- */

/* ---- Display tracking ----
   Tracking is a function of size, not a constant. -0.02em closes the gaps
   that open at 68px; at the 34px mobile cut the same value is simply tight,
   and the eye reads it as cramped rather than considered. The responsive
   sheet reopens both of these. */

.hero__statement {
  font-size: var(--text-hero);
  font-weight: 400;
  letter-spacing: -0.02em;
  max-width: 100%;
  text-wrap: balance;
}

/* ---- Eyebrow Label ---- */

.eyebrow {
  font-family: var(--font-utility);
  font-size: var(--text-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

/* ---- Small / Caption ---- */

small,
.caption {
  font-family: var(--font-utility);
  font-size: var(--text-nav);
  color: var(--muted);
}

/* ---- Horizontal Rule ---- */

hr {
  border: none;
  border-top: var(--border-rule);
  margin: var(--space-3xl) 0;
}

/* ---- Strong / Emphasis ---- */

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

/* ---- Selection ---- */

::selection {
  background-color: var(--accent);
  color: var(--ground);
}

/* ---- Screen Reader Only ---- */

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

/* A hyphenated compound is one word to a reader, and a hero that breaks it
   across two lines reads as two. Narrow enough at every size that holding it
   together costs nothing. */
.nowrap {
  white-space: nowrap;
}
