/* =============================================================
   Red Thread Careers — colors_and_type.css
   Source of truth for color + typography tokens.
   See Red_Thread_Careers_Color_Specification.docx and
   Typography_and_Type_Pairing_Specification.docx for full rationale.
   ============================================================= */

/* Fonts.
   ---------------------------------------------------------------
   Both families are self-hosted from /fonts as variable TTFs.
   Fraunces ships with the full SOFT and WONK axes available;
   Inter ships with opsz + wght. Leave at defaults unless doing
   a deliberate display moment. */

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces-VariableFont_SOFT_WONK_opsz_wght.ttf') format('truetype-variations'),
       url('fonts/Fraunces-VariableFont_SOFT_WONK_opsz_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-stretch: 50% 200%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces-Italic-VariableFont_SOFT_WONK_opsz_wght.ttf') format('truetype-variations'),
       url('fonts/Fraunces-Italic-VariableFont_SOFT_WONK_opsz_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-stretch: 50% 200%;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-VariableFont_opsz_wght.ttf') format('truetype-variations'),
       url('fonts/Inter-VariableFont_opsz_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Italic-VariableFont_opsz_wght.ttf') format('truetype-variations'),
       url('fonts/Inter-Italic-VariableFont_opsz_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* -------- Core palette (three hues, no substitutions) -------- */
  --color-paper:        #F9F1EE;   /* canvas, 80% of any surface  */
  --color-ink:          #16181D;   /* type + structure, 18%       */
  --color-red:          #BD132D;   /* the thread, 2% max          */

  /* Quiet operational tints, derived from the three core hues.
     Use sparingly — these exist for borders, dividers, faint
     surfaces. They should never read as "another color." */
  --color-ink-15:       rgba(22, 24, 29, 0.15);  /* 1px dividers */
  --color-ink-30:       rgba(22, 24, 29, 0.30);  /* secondary text on Paper */
  --color-ink-55:       rgba(22, 24, 29, 0.55);  /* tertiary text */
  --color-ink-72:       rgba(22, 24, 29, 0.72);  /* meta text */
  --color-paper-warm:   #F2E9E5;                 /* card surface lift */
  --color-paper-deep:   #ECE1DC;                 /* faint inset / footer */

  /* -------- Semantic surfaces -------- */
  --bg:                 var(--color-paper);
  --bg-elevated:        var(--color-paper-warm);
  --bg-inset:           var(--color-paper-deep);
  --bg-inverse:         var(--color-ink);

  --fg:                 var(--color-ink);
  --fg-muted:           var(--color-ink-72);
  --fg-quiet:           var(--color-ink-55);
  --fg-faint:           var(--color-ink-30);
  --fg-inverse:         var(--color-paper);

  --border:             var(--color-ink-15);
  --border-strong:      var(--color-ink);
  --accent:             var(--color-red);

  /* -------- Typography families -------- */
  --font-display:       'Fraunces', 'Recoleta', 'Georgia', serif;
  --font-body:          'Inter', -apple-system, BlinkMacSystemFont,
                        'Segoe UI', sans-serif;

  /* -------- Display scale (Fraunces, mobile-first) --------
     Sizes scale from a 360px viewport up to ~1280px via clamp.
     The brand reads as editorial print, so the type does most
     of the heavy lifting at every breakpoint. */
  --text-display-size:    clamp(44px, 12vw, 112px);
  --text-display-weight:  600;
  --text-display-leading: 1.02;
  --text-display-tracking: -0.035em;

  --text-h1-size:         clamp(32px, 7vw, 56px);
  --text-h1-weight:       600;
  --text-h1-leading:      1.08;
  --text-h1-tracking:     -0.025em;

  --text-h2-size:         clamp(24px, 4.4vw, 36px);
  --text-h2-weight:       600;
  --text-h2-leading:      1.15;
  --text-h2-tracking:     -0.02em;

  --text-h3-size:         clamp(19px, 2.4vw, 22px);
  --text-h3-weight:       600;
  --text-h3-leading:      1.25;
  --text-h3-tracking:     -0.01em;

  /* Editorial pull quote — Fraunces italic regular */
  --text-quote-size:      clamp(20px, 3.4vw, 30px);
  --text-quote-weight:    400;
  --text-quote-style:     italic;
  --text-quote-leading:   1.35;

  /* -------- Body scale (Inter, mobile-first) -------- */
  --text-lead-size:       clamp(17px, 2.1vw, 19px);
  --text-lead-weight:     400;
  --text-lead-leading:    1.55;

  --text-body-size:       16px;
  --text-body-weight:     400;
  --text-body-leading:    1.6;

  --text-small-size:      14px;
  --text-small-weight:    400;
  --text-small-leading:   1.55;

  --text-meta-size:       12px;
  --text-meta-weight:     500;
  --text-meta-leading:    1.4;
  --text-meta-tracking:   0.04em;

  --text-button-size:     14px;
  --text-button-weight:   500;

  /* -------- Spacing (8px base, occasionally 4px micro) -------- */
  --space-0:   0;
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   24px;
  --space-6:   32px;
  --space-7:   48px;
  --space-8:   64px;
  --space-9:   96px;
  --space-10:  128px;

  /* Page rhythm */
  --page-gutter:        clamp(20px, 5vw, 56px);
  --page-max:           1180px;
  --measure:            64ch;        /* ideal reading width */

  /* Vertical section padding — mobile-first, grows with viewport. */
  --section-y:          clamp(56px, 9vw, 112px);
  --section-y-tight:    clamp(40px, 6vw, 72px);

  /* Mobile-first breakpoints (used in component-local media queries
     and in the layout primitives below). */
  --bp-sm:              480px;
  --bp-md:              720px;
  --bp-lg:              1024px;

  /* -------- Borders + radii -------- */
  --hairline:           1px solid var(--border);
  --hairline-strong:    1px solid var(--border-strong);
  --thread-rule:        1.5px solid var(--color-red);

  --radius-0:           0;
  --radius-1:           2px;
  --radius-2:           4px;
  --radius-3:           8px;       /* used very sparingly */

  /* -------- Shadows (almost none — the brand is flat) -------- */
  --shadow-none:        none;
  --shadow-quiet:       0 1px 0 var(--color-ink-15);  /* hairline lift */
  --shadow-card:        0 1px 0 var(--color-ink-15),
                        0 12px 32px -24px rgba(22, 24, 29, 0.18);

  /* -------- Motion -------- */
  --ease-quiet:         cubic-bezier(0.2, 0.6, 0.2, 1);
  --dur-fast:           120ms;
  --dur-base:           220ms;
  --dur-slow:           420ms;
}

/* =============================================================
   Base resets + semantic defaults
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-body-size);
  line-height: var(--text-body-leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--fg);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1-size);
  font-weight: var(--text-h1-weight);
  line-height: var(--text-h1-leading);
  letter-spacing: var(--text-h1-tracking);
  /* Force the TEXT cut of Fraunces (sturdier strokes) even at display sizes,
     instead of letting the browser auto-select the lighter DISPLAY cut. */
  font-optical-sizing: none;
  font-variation-settings: "opsz" 14;
}
h2 {
  font-size: var(--text-h2-size);
  font-weight: var(--text-h2-weight);
  line-height: var(--text-h2-leading);
  letter-spacing: var(--text-h2-tracking);
}
h3 {
  font-size: var(--text-h3-size);
  font-weight: var(--text-h3-weight);
  line-height: var(--text-h3-leading);
  letter-spacing: var(--text-h3-tracking);
}

p { margin: 0; max-width: var(--measure); text-wrap: pretty; }

/* Editorial pull quote */
.rt-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--text-quote-weight);
  font-size: var(--text-quote-size);
  line-height: var(--text-quote-leading);
  color: var(--fg);
  max-width: 28ch;
}

/* Meta / eyebrow label — small caps, brand red, preceded by a 28px hairline.
   The unified treatment for every section eyebrow across the site. */
.rt-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-red);
}
.rt-meta::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 0;
  border-top: 1.5px solid var(--color-red);
  flex: 0 0 auto;
}

/* Before / After column heads aren't section eyebrows — keep them quiet. */
.rt-meta.ba-col-head {
  color: var(--fg-muted);
  text-transform: none;
  font-size: var(--text-meta-size);
  letter-spacing: var(--text-meta-tracking);
}
.rt-meta.ba-col-head::before {
  display: none;
}

/* Lead paragraph (intro deck) */
.rt-lead {
  font-size: var(--text-lead-size);
  line-height: var(--text-lead-leading);
  color: var(--fg);
  max-width: var(--measure);
}

/* The button: Ink text inside a 1px Ink line on Paper.
   No fills, no gradients, no icons inside. */
.rt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: var(--text-button-size);
  font-weight: var(--text-button-weight);
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--dur-base) var(--ease-quiet),
              border-color var(--dur-base) var(--ease-quiet),
              background-color var(--dur-base) var(--ease-quiet);
}
.rt-button:hover {
  color: var(--color-red);
  border-color: var(--color-red);
}
.rt-button:active { background: rgba(189, 19, 45, 0.04); }

.rt-button--inverse {
  color: var(--fg-inverse);
  border-color: var(--fg-inverse);
}
.rt-button--inverse:hover {
  color: var(--color-red);
  border-color: var(--color-red);
}

/* Primary red variant — red outline by default, fills solid red on hover.
   Used for the hero's primary CTA. The 2% red budget is spent here. */
.rt-button--red {
  color: var(--color-red);
  border-color: var(--color-red);
}
.rt-button--red:hover {
  color: var(--color-paper);
  background: var(--color-red);
  border-color: var(--color-red);
}
.rt-button--red:active {
  background: var(--color-red);
}

/* Solid red variant — filled Brand Red with Paper text. High-contrast beacon
   for moments after the reader has confessed a pain point (e.g. mirror result).
   Use sparingly; this spends the 2% red budget. */
.rt-button--red-solid {
  color: var(--color-paper);
  background: var(--color-red);
  border-color: var(--color-red);
}
.rt-button--red-solid:hover {
  color: var(--color-paper);
  background: var(--color-ink);
  border-color: var(--color-ink);
}
.rt-button--red-solid:active {
  background: var(--color-ink);
  border-color: var(--color-ink);
}

/* Quiet variant — stays Ink on hover, with a barely-visible ink tint.
   Used for the navbar CTA so the hero's red CTA stays the dominant focal point. */
.rt-button--quiet:hover {
  color: var(--color-ink);
  border-color: var(--color-ink);
  background: rgba(22, 24, 29, 0.04);
}

/* Inline link — Ink text, on hover reveals a 1px Brand Red underline.
   No default underline. */
.rt-link {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--color-red), var(--color-red));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size var(--dur-base) var(--ease-quiet),
              color var(--dur-base) var(--ease-quiet);
  padding-bottom: 2px;
}
.rt-link:hover { background-size: 100% 1px; color: var(--color-red); }

/* Editorial rule — 1px Ink at 15% opacity */
.rt-rule { border: 0; border-top: var(--hairline); margin: 0; }

/* The header thread — 1.5pt red horizontal rule above premium docs */
.rt-thread-rule { border: 0; border-top: var(--thread-rule); margin: 0; }

/* End-of-article mark; expects <span class="rt-end"><img src=".../mark-small.svg"/></span> */
.rt-end {
  display: inline-block;
  margin-left: 0.4em;
  vertical-align: -0.1em;
}
.rt-end img { width: 18px; height: auto; display: block; }

/* Selection — quietly editorial */
::selection { background: rgba(189, 19, 45, 0.18); color: var(--color-ink); }

/* =============================================================
   Layout primitives — mobile-first
   ============================================================= */

/* Page container: gutters + max width, centered. */
.rt-page {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
}

/* Section: consistent vertical rhythm. .tight halves the padding. */
.rt-section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}
.rt-section.tight {
  padding-top: var(--section-y-tight);
  padding-bottom: var(--section-y-tight);
}

/* Stack: flex column with a gap. The default is generous; .tight,
   .loose are the two off-ramps. */
.rt-stack { display: flex; flex-direction: column; gap: var(--space-5); }
.rt-stack.tight  { gap: var(--space-3); }
.rt-stack.loose  { gap: var(--space-6); }

/* Cluster: horizontal row that wraps to multi-line on small screens. */
.rt-cluster {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  align-items: center;
}

/* Responsive grids. Mobile-first: one column by default, multi-column
   once the viewport gives them room. */
.rt-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 720px) {
  .rt-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-7); }
}

.rt-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.rt-grid-3 > * {
  padding: var(--space-6) var(--space-5);
  border-bottom: 1px solid var(--border);
}
.rt-grid-3 > *:last-child { border-bottom: 0; }
@media (min-width: 720px) {
  .rt-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rt-grid-3 > * { border-bottom: 0; border-right: 1px solid var(--border); }
  .rt-grid-3 > *:last-child { border-right: 0; }
}

/* Two-up media block (e.g. portrait + paragraph). Stacks on mobile,
   side-by-side on tablet+. .reverse swaps the visual order at the
   wide breakpoint while preserving DOM order. */
.rt-media {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
}
@media (min-width: 720px) {
  .rt-media { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-8); }
  .rt-media.reverse > :first-child { order: 2; }
}

/* Responsive visibility helpers. */
@media (max-width: 719px) { .rt-hide-sm { display: none !important; } }
@media (min-width: 720px) { .rt-only-sm { display: none !important; } }

/* Hit targets: anything tappable must be at least 44px tall. The
   button primitive already meets this; this is a backstop for links
   inside touch UIs. */
@media (pointer: coarse) {
  .rt-link { padding-top: 6px; padding-bottom: 6px; }
}

/* On mobile, the button stretches to full width when placed inside
   .rt-cluster.block — one tap target per row. */
.rt-cluster.block .rt-button { flex: 1 1 auto; min-width: 0; }
@media (min-width: 720px) {
  .rt-cluster.block .rt-button { flex: 0 0 auto; }
}
