/* ============================================================================
   The Torquedaily layer

   Text and borders taken from torquedaily.com and laid over the existing
   site, so the layouts underneath are untouched:

     text     Geist for reading and chrome, Geist Mono for small labels
              (dates, field names, the scroll cue), Manrope 700 for the
              names of things (cards, sections, captions)
     colour   navy for what matters, slate for what supports it
     borders  1px light hairlines between rows and around the bar, and
              pills for anything you press

   Loaded after styles.css and blog.css, so it wins without !important.
   Remove its <link> in BaseLayout and the site is exactly as it was.
   ========================================================================== */

:root {
  /* Day: white ground, black text. */
  --paper:  #FFFFFF;
  --tray:   #FFFFFF;   /* raised surfaces: pills, footer, boxes */
  --strong: #000000;   /* titles, body copy, the menu */
  --ink:    #444444;   /* supporting text: still near-black, 9.7:1 */
  --muted:  #444444;
  --hover:  #444444;
  --hair:   #E5E5E5;   /* every border on the site */
  --wash:   #F2F2F2;
  --accent: #000000;   /* filled buttons */
  --on-accent: #FFFFFF;
  --soft:   #F2F2F2;   /* hover wash on outlined controls */
  --highlight: #9C5A26; /* the rotating word: Torquedaily's bronze, 5.6:1 — the amber is too faint on white */

  --sans:  "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono:  "Geist Mono", ui-monospace, Menlo, monospace;
  --brand: "Manrope", "Geist", sans-serif;
  --ease:  cubic-bezier(0.65, 0, 0.35, 1);
}

/* Night: the same navy, deepened into the ground. */
:root[data-theme="dark"] {
  --paper:  #121828;
  --tray:   #182033;
  --strong: #F2F0EA;
  --ink:    #A7B0C4;
  --muted:  #A7B0C4;
  --hover:  #DCE4F0;
  --hair:   #283149;
  --wash:   #1C2438;
  --accent: #DCE4F0;
  --on-accent: #1F2A44;
  --soft:   #243050;
  --highlight: #F4B66A; /* Torquedaily's amber, 10:1 on the night ground */
}

/* The footer is white, so whatever shows below it on a short page is too. */
html { background: var(--tray); }

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
}

/* --- Labels ------------------------------------------------------------- */
.meta {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink);
}

/* --- The bar ------------------------------------------------------------ */
.site-header {
  padding: 18px var(--pad);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
.site-header .wordmark {
  font-family: var(--brand);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}
.site-header nav a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 8px 2px;
  font-size: 1rem;
  font-weight: 500;
}
.site-header nav a:hover,
.site-header nav a:focus-visible { color: var(--strong); }
.site-header nav a:focus-visible { outline: none; }
.site-header nav a::after {
  bottom: 0;
  background: var(--strong);
  transition: transform 300ms var(--ease);
}
@media (max-width: 700px) {
  .site-header { padding: 12px var(--pad); gap: 4px; }
  .site-header .wordmark { font-size: 1.25rem; }
  .site-header nav a { font-size: 0.9375rem; }
}

/* --- Pills -------------------------------------------------------------- */
.button,
.form button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  transition: background 300ms var(--ease), color 300ms var(--ease);
}
.button:hover { background: var(--hover); border-color: var(--hover); color: var(--on-accent); }
.button.outline { background: transparent; border: 1px solid var(--strong); color: var(--strong); }
.button.outline:hover { background: var(--soft); color: var(--strong); }
.button .icon-arrow { display: block; width: 16px; height: 16px; }

/* --- Headings ----------------------------------------------------------- */
.page-title,
.hero-title {
  font-family: var(--sans);
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.05em;
  line-height: 1.04;
  color: var(--strong);
}
.page-title { font-size: clamp(2.5rem, 6vw, 4.25rem); }

.section-label {
  font-family: var(--brand);
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--strong);
}

.intro,
.hero-intro {
  max-width: 40rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.prose { color: var(--strong); line-height: 1.65; }

/* --- Homepage: the banner ----------------------------------------------- */
.hero { padding-block: clamp(3rem, 8vw, 6rem); }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--tray);
  box-shadow: inset 0 0 0 1px var(--hair);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--strong);
  transition: background 300ms var(--ease);
}
.hero-eyebrow:hover { background: var(--soft); color: var(--strong); }
.hero-eyebrow svg { display: block; width: 14px; height: 14px; }

.hero-title {
  max-width: 820px;
  margin-top: clamp(1.5rem, 3.5vw, 2rem);
  font-size: clamp(2.5rem, 7vw, 4.75rem);
}

/* The rotating word picked out in Torquedaily's amber, with no block
   behind it. Each phrase is shrunk to its own width and centred. */
.hero-rotator { padding-block: 0.16em; }
.hero-word {
  inset-inline: auto;
  left: 50%;
  top: 0.1em;
  width: max-content;
  max-width: 100%;
  padding: 0;
  background: none;
  color: var(--highlight);
  font-weight: 600;
  letter-spacing: -0.04em;
  white-space: nowrap;
  /* Parked well clear of the line: a phrase's own height is the unit
     here, and the old 150% left the navy block of the next one in view. */
  transform: translate(-50%, 260%);
}
.hero-word.is-current { transform: translate(-50%, 0); }
.hero-word.is-past    { transform: translate(-50%, -260%); }
.hero-rotator .spacer { white-space: nowrap; }

/* On a phone the line is sized to the width, so the longest phrase stays
   on one line inside its block rather than breaking in two. */
@media (max-width: 560px) {
  .hero-rotator { font-size: clamp(1.5rem, 8.6vw, 2.25rem); }
}

.hero-actions { gap: 12px; }

.scroll-cue {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* --- Homepage: the gallery ---------------------------------------------- */
.stage-item img { border-radius: 12px; }

.stage-caption .title,
.lightbox-caption .title {
  font-family: var(--brand);
  font-size: 1.1875rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.02em;
  color: var(--strong);
}
.stage-caption .line,
.lightbox-caption .line {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--ink);
}

/* --- The enlarged photo ------------------------------------------------- */
.lightbox img { border-radius: 8px; }
.lightbox-close,
.lightbox-nav {
  min-height: 36px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--tray);
  box-shadow: inset 0 0 0 1px var(--hair);
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--strong);
}
.lightbox-close:hover,
.lightbox-nav:hover { background: var(--soft); color: var(--strong); }
.lightbox-close { top: 16px; }
.lightbox-nav { bottom: 22px; }

/* --- About -------------------------------------------------------------- */
.atlas-hint { font-family: var(--mono); font-size: 0.75rem; font-weight: 400; }
.atlas-label { font-family: var(--sans); }
.atlas-loose .title { font-family: var(--brand); text-transform: none; letter-spacing: -0.02em; }

/* Education and experience: dates in mono on the left, a hairline between
   each entry. These rows had lost their styles and were showing bullets. */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hair);
}
.row {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0 2rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--hair);
}
.row .meta { padding-top: 0.3rem; }
.row-title {
  margin: 0;
  font-family: var(--brand);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--strong);
}
.row-sub { margin: 0.2rem 0 0; font-size: 0.9375rem; color: var(--ink); }
.row-detail {
  margin: 0.6rem 0 0;
  max-width: 62ch;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink);
}

/* --- Contact ------------------------------------------------------------ */
.contact-row { padding-block: 1.1rem; }
.contact dt { padding-top: 0.15rem; }
.contact dd a { font-weight: 500; }

/* --- Blog --------------------------------------------------------------- */
.blog-card-media,
.post .media { border-radius: 16px; }
.post-cover img { border-radius: 20px; }
.post-body img { border-radius: 12px; }

.blog-card-title,
.post-title,
.venture h3,
.strand h3,
.post-nav-title {
  font-family: var(--brand);
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.02em;
  color: var(--strong);
}
.blog-card-sub,
.post-summary { font-size: 0.9375rem; line-height: 1.55; color: var(--ink); }

.post-heading {
  font-family: var(--sans);
  font-weight: 500;
  text-transform: none;
  letter-spacing: -0.04em;
  line-height: 1.08;
}
.post-subtitle { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.6; color: var(--ink); }
.post-body { color: var(--strong); line-height: 1.7; }
.post-body h2,
.post-body h3,
.post-body h4 { font-family: var(--brand); letter-spacing: -0.02em; }
.post-body blockquote { border-left-color: var(--strong); }
.post-body :not(pre) > code,
.post-body pre { font-family: var(--mono); }

.subscribe-cta {
  border: 1px solid var(--hair);
  border-radius: 24px;
  background: var(--tray);
}

.strand { border-top-width: 1px; border-top-color: var(--hair); }

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  background: var(--tray);
  border-top: 1px solid var(--hair);
  padding: 40px var(--pad) 56px;
}
.footer-links a,
.copyright,
.theme-toggle { font-size: 0.875rem; }
.footer-links a { color: var(--strong); }
.footer-links a:hover { color: var(--ink); }
.copyright { color: var(--ink); }

.theme-toggle {
  min-height: 32px;
  padding: 4px 14px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--hair);
  color: var(--strong);
  transition: background 300ms var(--ease);
}
.theme-toggle:hover { background: var(--soft); color: var(--strong); }

@media (max-width: 40rem) {
  .row { grid-template-columns: 1fr; gap: 0.25rem; }
  .row .meta { padding-top: 0; }
}

/* --- Icons ---------------------------------------------------------------
   Beside the menu and footer labels, as Torquedaily sets its menu. They
   take the colour of the text, so they follow hover and night mode. */
.site-header nav a { gap: 8px; }
.nav-icon { width: 20px; height: 20px; flex: none; }

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.foot-icon { width: 16px; height: 16px; flex: none; }

@media (max-width: 700px) {
  .site-header nav a { gap: 6px; }
  .nav-icon { width: 18px; height: 18px; }
}

/* --- The contact form ----------------------------------------------------
   Torquedaily's fields: white, a hairline round them, fully rounded for a
   single line and softly rounded for the message. The border darkens to
   navy on focus, with the usual ring as well for the keyboard. */
.form { max-width: 36rem; }
.field { margin-bottom: 1.25rem; }
.field label {
  margin-bottom: 0.5rem;
  padding-left: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--strong);
}
.field input,
.field textarea {
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--tray);
  font-family: var(--sans);
  color: var(--strong);
  transition: border-color 300ms var(--ease);
}
.field textarea { border-radius: 20px; min-height: 9rem; }
.field input:hover,
.field textarea:hover { border-color: var(--ink); }
.field input:focus,
.field textarea:focus { border-color: var(--strong); }
.field input:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--strong); outline-offset: 3px; }

.form button[type="submit"] { margin-top: 0.25rem; padding-inline: 28px; }
.form-status { padding-left: 20px; font-size: 0.875rem; }

/* --- Homepage stats ------------------------------------------------------
   The figures in a row between the banner and the gallery, at every
   width, with no rules round them: they stand on their own, tight and
   tabular. */
.stats { padding-block: 0; margin-bottom: clamp(1rem, 3vw, 2rem); }
.stats-grid {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 56rem;
  display: grid;
  /* One column per figure, however many there are. */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}
.stat {
  padding: clamp(1.5rem, 3vw, 2.25rem) 1rem;
  text-align: center;
}
.stat-value {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--strong);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  margin: 0.6rem 0 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--ink);
  text-wrap: balance;
}
/* Three still fit across a phone, set a size smaller. */
@media (max-width: 640px) {
  .stat { padding: 1.25rem 0.5rem; }
  .stat-value { font-size: 1.625rem; }
  .stat-label { font-size: 0.8125rem; }
}

/* --- No lines --------------------------------------------------------------
   The hairlines are gone: under the bar, above the footer, between rows,
   round the subscribe box. Spacing alone separates things now. Kept: the
   outline button and the form fields, where the edge is the control. */
.site-header,
.site-footer,
.rows,
.row,
.contact-row,
.contact-row:first-child,
.subscribe-cta,
.strand,
.venture,
.post-nav,
.post-body th,
.post-body td,
.outcomes li,
.ask { border: 0; }

/* --- Contour field behind the banner ---------------------------------------
   Full width, under the hero only. Fades out towards every edge, so the
   lines never meet the menu bar or the figures in a hard edge. */
.topo-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.topo-field {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1200ms var(--ease);
  -webkit-mask-image: radial-gradient(ellipse closest-side at 50% 50%, #000 60%, transparent 100%);
          mask-image: radial-gradient(ellipse closest-side at 50% 50%, #000 60%, transparent 100%);
}
.topo-field.is-on { opacity: 1; }
