/* ============================================================
 * matthirst.work design system
 * Mirrors Hirst Media's editorial dark-mode language:
 *   - Playfair Display (display) + Inter (body) + Space Mono (kickers)
 *   - #0b0b0a near-black bg, warm white text, #e07a3a accent
 * ============================================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url('fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url('fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: optional;
  src: url('fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url('fonts/playfair-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: optional;
  src: url('fonts/playfair-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 900;
  font-display: optional;
  src: url('fonts/playfair-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400;
  font-display: optional;
  src: url('fonts/playfair-italic-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url('fonts/spacemono-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: optional;
  src: url('fonts/spacemono-700-latin.woff2') format('woff2');
}

:root {
  --bg: #0b0b0a;
  --accent: #e07a3a;
  --accent-hover: #f08a4a;
  --accent-dim: rgba(224, 122, 58, 0.15);
  --text: #f2f1ef;
  --text-muted: #d4d3d0;
  --border: #222;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Space Mono', "Courier New", monospace;

  --max: 760px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(ellipse at 20% 80%, rgba(224, 122, 58, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(224, 122, 58, 0.02) 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease, color 0.18s ease;
}
a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
li {
  margin-bottom: 0.6rem;
  padding-left: 1.4rem;
  position: relative;
}
li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

strong {
  color: var(--text);
  font-weight: 600;
}

em {
  font-style: italic;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ---- Layout ---- */

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 6rem 2rem 6rem;
}

/* ---- Masthead ---- */

header.masthead {
  margin-bottom: 3rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

header.masthead-with-photo {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
}

button.mode-toggle-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.45rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

button.mode-toggle-btn:hover,
button.mode-toggle-btn:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

button.mode-toggle-btn:active {
  background: var(--accent-dim);
}

.masthead-row {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

/* ---- Sticky top bar (nav + paper toggle) ---- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 10, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

.topnav a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  text-decoration: none;
  padding: 0.15rem 0;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.topnav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

body.paper-mode .topbar {
  background: rgba(243, 234, 216, 0.92);
  border-bottom-color: var(--border);
}

@media (max-width: 768px) {
  .topbar {
    padding: calc(env(safe-area-inset-top, 0px) + 0.7rem) 1rem 0.7rem;
  }
  .topnav {
    gap: 0.9rem;
  }
  .topnav a {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }
  .topbar button.mode-toggle-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.masthead-text {
  flex: 1;
  min-width: 0;
}

@media (max-width: 600px) {
  header.masthead-with-photo {
    gap: 1.25rem;
  }
  .avatar {
    width: 72px;
    height: 72px;
  }
}

header.masthead .kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
}

h1 {
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1.05;
  color: var(--text);
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

h1 em {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}

.lede {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.45;
  color: var(--text);
  font-weight: 400;
  margin: 1.25rem 0 0;
}

/* Quick "who I am" block on bespoke pages — sits between masthead and body. */
.who {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
  background: rgba(224, 122, 58, 0.04);
  border-left: 2px solid var(--accent);
  padding: 1.1rem 1.25rem;
  margin: 0 0 2.5rem;
}

/* ---- Section heads ---- */

h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin: 3rem 0 1rem;
  letter-spacing: -0.005em;
}

/* ---- Ask block (the CTA box on bespoke pages) ---- */

.ask {
  background: linear-gradient(180deg, rgba(224, 122, 58, 0.04), rgba(224, 122, 58, 0.01));
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 2rem 2.25rem;
  margin: 3rem 0;
}

.ask h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.55rem;
}

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

/* ---- Footer ---- */

/* ---- Ask my agent (chatbot widget) ---- */

.ask-agent {
  display: none; /* hidden until JS detects MATTHIRST_CHAT_ENDPOINT */
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.ask-agent.ask-enabled {
  display: block;
}

.ask-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
}

.ask-headline {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 1.25rem;
}

.ask-blurb {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.ask-form {
  margin-bottom: 1.5rem;
}

.ask-input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  resize: vertical;
  transition: border-color 0.18s ease;
}

.ask-input:focus {
  outline: none;
  border-color: var(--accent);
}

.ask-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.ask-submit {
  appearance: none;
  background: var(--accent);
  border: 0;
  border-radius: 3px;
  padding: 0.55rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bg);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.18s ease, opacity 0.18s ease;
}

.ask-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}

.ask-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ask-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ask-transcript {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ask-turn {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ask-turn-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ask-turn-user .ask-turn-label {
  color: var(--accent);
}

.ask-turn-body {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.ask-turn-user .ask-turn-body {
  color: var(--text);
}

footer.signoff {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

footer.signoff a {
  color: var(--text-muted);
}
footer.signoff a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.signoff-phone {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .signoff-sep {
    display: none;
  }
  .signoff-phone {
    display: block;
    margin-top: 0.4rem;
  }
}

/* ---- Stat callouts (homepage hero strip) ---- */

.stats {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  margin: 3rem 0 1rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--border);
}

.stat-row {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.stat-row-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.stat-row-values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 2.5rem;
}

.stat-row-single .stat-row-values {
  grid-template-columns: 1fr;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.stat-value em {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}

.stat-arrow {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
  padding: 0 0.2em;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.6rem;
}

/* ---- Hover-reveal footnote (lede) ---- */

.footnote-mark {
  position: relative;
  display: inline;
  color: var(--accent);
  font-size: 0.75em;
  margin-left: 0.05em;
  cursor: help;
  vertical-align: super;
  line-height: 1;
  outline: none;
}

.footnote-text {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 260px;
  background: #1a1a18;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  padding: 0.55rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.45;
  color: var(--text-muted);
  letter-spacing: 0;
  vertical-align: baseline;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.footnote-mark:hover .footnote-text,
.footnote-mark:focus .footnote-text {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- On AI section ---- */

.on-ai {
  margin: 3.5rem 0 0;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.on-ai-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
}

.on-ai-headline {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
}

.on-ai p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.on-ai p:last-child {
  margin-bottom: 0;
}

/* ---- Pull-quotes inside work entries ---- */

.work-quote {
  margin: 1.25rem 0 1.5rem;
  padding: 0.4rem 0 0.4rem 1.15rem;
  border-left: 2px solid var(--accent);
}

.work-quote blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.work-quote figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quote-name {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

a.quote-name {
  color: var(--text);
  border-bottom-color: transparent;
}

a.quote-name:hover {
  color: var(--accent);
  border-bottom-color: transparent;
}

.quote-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.quote-role::before {
  content: '— ';
  font-family: var(--font-mono);
  color: var(--accent);
  margin-right: 0.15rem;
}

/* ---- Tab navigation ---- */

.tabs {
  display: flex;
  gap: 2.5rem;
  border-bottom: 1px solid var(--border);
  margin: 4rem 0 0;
  padding: 0 0 0.5rem;
}

.tab {
  background: transparent;
  border: 0;
  padding: 0.5rem 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.18s ease;
  letter-spacing: -0.005em;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
}

.tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.6rem;
  height: 2px;
  background: var(--accent);
}

.panel {
  display: none;
  padding-top: 2.5rem;
}

.panel.active {
  display: block;
}

/* ---- Work cards (entries inside a panel) ---- */

.work {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  padding-left: 0;
  transition: padding-left 0.28s ease, opacity 0.7s ease, transform 0.7s ease;
}

.work::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 0.1rem;
  bottom: 2.5rem;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transform: scaleY(0.5);
  transform-origin: top;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.work:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.work:hover {
  padding-left: 0.6rem;
}

.work:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.work-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.work-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.005em;
}

.work-title em {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}

.work-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.work-role {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--accent);
  font-style: italic;
  margin: 0 0 0.25rem;
  letter-spacing: 0.01em;
}

.work-location {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin: 0 0 1rem;
}

.work-skills {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}

.work-skills strong {
  color: var(--text-muted);
  font-weight: 700;
  margin-right: 0.5rem;
}

/* LinkedIn-detail expandables (one per work card with LinkedIn data) */

details.linkedin-detail {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

details.linkedin-detail summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0;
}

details.linkedin-detail summary::-webkit-details-marker,
details.linkedin-detail summary::marker {
  display: none;
  content: '';
}

details.linkedin-detail summary::before {
  content: '+';
  font-family: var(--font-mono);
  font-weight: 700;
  display: inline-block;
  width: 0.9rem;
  text-align: center;
  color: var(--accent);
}

details.linkedin-detail[open] summary::before {
  content: '−';
}

details.linkedin-detail summary:hover {
  color: var(--accent-hover);
}

details.linkedin-detail .linkedin-content {
  margin-top: 1rem;
  padding: 0.5rem 0 0 1.25rem;
  border-left: 2px solid var(--border);
}

details.linkedin-detail .linkedin-content h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin: 2rem 0 0.2rem;
}

/* Anchors inside titles must inherit font properties exactly so linked
   and unlinked text render at the same visual size. */
details.linkedin-detail .linkedin-content h4 a,
.work-title a {
  font: inherit;
  color: var(--accent);
  border-bottom: 0;
  text-decoration: none;
}

details.linkedin-detail .linkedin-content h4 a:hover,
.work-title a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
  border-bottom: 0;
}

details.linkedin-detail .linkedin-content h4:first-child {
  margin-top: 0;
}

details.linkedin-detail .linkedin-content .li-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 0.65rem;
}

details.linkedin-detail .linkedin-content p {
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 0.85rem;
}

details.linkedin-detail .linkedin-content ul {
  margin: 0 0 0.85rem;
}

details.linkedin-detail .linkedin-content li {
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 0.4rem;
}

/* Resume download CTA in the looking-for box */

.resume-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.resume-download {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  transition: background 0.15s ease, color 0.15s ease;
}

.resume-download:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.work-body {
  margin-top: 0.5rem;
}

.work-body p {
  margin-bottom: 0.85rem;
}

.work-body p:last-child {
  margin-bottom: 0;
}

/* "Looking for" callout in footer area */

.looking {
  background: linear-gradient(180deg, rgba(224, 122, 58, 0.06), rgba(224, 122, 58, 0.01));
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 1.5rem 1.75rem;
  margin: 4rem 0 2rem;
}

.looking h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
}

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

/* ---- Mobile ---- */

@media (max-width: 768px) {
  .wrap {
    padding: 4rem 1.5rem 4rem;
  }
  h1 {
    font-size: 2.4rem;
  }
  .lede {
    font-size: 1.2rem;
  }
  h2 {
    font-size: 1.5rem;
    margin: 2.25rem 0 0.85rem;
  }
  .ask {
    padding: 1.5rem 1.5rem;
  }
  .ask h2 {
    font-size: 1.35rem;
  }
  .stats {
    gap: 1.75rem;
  }
  .stat-row-values {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .stat-value {
    font-size: 2.1rem;
  }
  .on-ai-headline {
    font-size: 1.7rem;
  }
  .work-quote {
    padding-left: 0.95rem;
  }
  .work-quote blockquote {
    font-size: 1rem;
  }
  .tabs {
    gap: 1.5rem;
  }
  .tab {
    font-size: 1.3rem;
  }
  .work-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }
}

/* ============================================================
 * Enhanced design behaviors (progressive — degrade gracefully)
 * ============================================================ */

/* ---- Reading-progress hairline ---- */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 1000;
  pointer-events: none;
  transition: transform 0.08s linear;
}

/* On mobile/touch — give the bar 15px of breathing room from the iOS
   status bar / hidden-address-bar edge (no browser chrome between
   viewport-top and page content like there is on desktop). */
@media (max-width: 768px) {
  .reading-progress {
    top: calc(env(safe-area-inset-top, 0px) + 15px);
  }
}

/* ---- Scroll-reveal on .work cards (larger translate + slower) ---- */

body.has-scroll-reveal .work {
  opacity: 0;
  transform: translateY(22px);
}

body.has-scroll-reveal .work.revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  body.has-scroll-reveal .work {
    opacity: 1;
    transform: none;
  }
}

/* ---- Paper mode (web/paper toggle in masthead, or type "hirst") ---- */

body.paper-mode {
  --bg: #f3ead8;
  --text: #14110d;
  --text-muted: #3d362b;
  --border: #b8ad94;
  --accent: #a13510;
  --accent-hover: #7e260a;
  --accent-dim: rgba(161, 53, 16, 0.18);
  background: #f3ead8 !important;
  color: var(--text);
}

body.paper-mode strong {
  color: var(--text);
}

body.paper-mode .footnote-text {
  background: #fff8e8;
  color: var(--text);
  border-color: var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

body.paper-mode .resume-download {
  background: transparent;
}

body.paper-mode .reading-progress {
  background: var(--accent);
  opacity: 0.85;
}
