:root {
  --paper: #efe6d8;
  --paper-2: #f7f0e6;
  --ink: #17110d;
  --muted: #675e55;
  --line: rgba(23, 17, 13, 0.18);
  --accent: #9b1f0e;
  --hot: #ff4a1f;
  --card: rgba(255, 251, 243, 0.58);
  --shadow: 7px 7px 0 #17110d;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", Arial, sans-serif;
  --mono: "JetBrains Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { color: #fff7ec; background: var(--accent); }
::-moz-selection { color: #fff7ec; background: var(--accent); }

/* Custom scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--muted) var(--paper);
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: var(--paper); border: none; }
*::-webkit-scrollbar-thumb {
  background: var(--muted);
  border: none;
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--accent); }
*::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
*::-webkit-scrollbar-corner { background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(115deg, rgba(255,255,255,0.28), rgba(255,255,255,0) 42%), var(--paper);
  font-family: var(--sans);
  letter-spacing: 0;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: repeating-linear-gradient(0deg, rgba(23,17,13,0.025) 0, rgba(23,17,13,0.025) 1px, transparent 1px, transparent 3px), repeating-linear-gradient(90deg, rgba(23,17,13,0.016) 0, rgba(23,17,13,0.016) 1px, transparent 1px, transparent 4px);
}
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(23,17,13,0.17) 0.7px, transparent 0.8px);
  background-size: 4px 4px;
  opacity: 0.14;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.section-shell, .site-header { width: min(980px, calc(100% - 40px)); margin: 0 auto; }
.site-header {
  min-height: 104px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 9px; }
.brand span { width: 7px; height: 7px; border-radius: 99px; background: var(--hot); }
.nav { display: flex; align-items: center; gap: 24px; }
.issue { justify-self: end; margin: 0; }
.menu-button { display: none; border: 1px solid var(--ink); border-radius: 999px; background: transparent; padding: 8px 14px; font: inherit; color: var(--ink); text-transform: uppercase; }
.nav a, .footer-links a, .text-link { position: relative; }
.nav a::after, .footer-links a::after, .text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}
.nav a:hover::after, .footer-links a:hover::after, .text-link:hover::after { transform: scaleX(1); transform-origin: left; }
.hero {
  min-height: calc(100vh - 104px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 78px;
  align-items: center;
  padding: 18px 0 76px;
}
.eyebrow, .section-index {
  margin: 0 0 26px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
h1, h2, .footer-mark { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: 0; }
.hero h1 { font-size: clamp(70px, 11vw, 154px); line-height: 0.9; }
.page-hero h1 { font-size: clamp(64px, 10vw, 132px); line-height: 0.9; }
.intro h2, .split-feature h2, .editorial-grid h2 { font-size: clamp(40px, 5.4vw, 68px); line-height: 1; }
em { position: relative; z-index: 1; color: var(--accent); font-style: italic; white-space: nowrap; }
em::after { content: ""; position: absolute; left: -0.04em; right: -0.03em; bottom: 0.05em; height: 0.22em; z-index: -1; background: rgba(255, 74, 31, 0.24); }
.hero-text, .page-hero p, .intro > p, .split-feature p, .editorial-grid p {
  color: #2e2721;
  font-size: 16px;
  line-height: 1.75;
}
.hero-text { width: min(560px, 100%); margin: 34px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; margin-top: 34px; }
.button { position: relative; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden; border: 1px solid var(--ink); border-radius: 999px; padding: 0 24px; font-size: 14px; font-weight: 800; transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 360ms ease, background 360ms ease, color 360ms ease; }
.button::before {
  content: "";
  position: absolute;
  inset: 2px auto 2px 2px;
  width: 44%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(255,74,31,0.34), rgba(255,255,255,0.06));
  opacity: 0;
  transform: translateX(-120%);
}
.button::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  transform: scale(0.3);
}
.button:hover { transform: translateY(-3px); }
.button:hover::before { opacity: 1; animation: buttonLoad 1.35s ease-in-out infinite; }
.button:hover::after { opacity: 0.78; transform: scale(1); animation: pulseDot 1.35s ease-in-out infinite; }
.button.primary { color: #fff7ec; background: var(--ink); box-shadow: 0 5px 0 var(--hot); }
.button.secondary { background: transparent; }
.text-link { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.profile-card { align-self: center; }
.portrait-wrap { position: relative; z-index: 0; width: 286px; aspect-ratio: 1; margin-left: auto; border: 1px solid var(--ink); border-radius: 999px; padding: 9px; background: rgba(255,251,243,0.52); box-shadow: var(--shadow); }
.portrait-wrap::before {
  content: "";
  position: absolute;
  inset: -6px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from 0deg, transparent 0 58%, rgba(255,74,31,0.05) 66%, var(--hot) 76%, var(--accent) 86%, transparent 100%);
  opacity: 0;
  transition: opacity 420ms ease;
}
.portrait-wrap:hover::before {
  opacity: 1;
  animation: profileOrbit 3.8s linear infinite;
}
.portrait-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transition: transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 520ms ease; }
.portrait-wrap:hover img { transform: scale(1.025); filter: saturate(1.04) contrast(1.03); }
.stat-lines { margin-top: 38px; border-top: 1px solid var(--line); }
.stat-lines div { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; }
.stat-lines span { color: var(--muted); text-transform: uppercase; }
.ticker { width: min(930px, calc(100% - 40px)); height: 58px; margin: 0 auto 126px; display: flex; align-items: center; overflow: hidden; color: #f8dbc2; background: #1d120d; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ticker-track { display: flex; width: max-content; gap: 30px; padding-left: 30px; white-space: nowrap; animation: ticker 30s linear infinite; }
.ticker-track span { font-family: var(--serif); font-size: 18px; font-style: italic; font-weight: 600; }
.ticker-track span::after { content: "+"; margin-left: 26px; color: var(--hot); font-family: var(--mono); font-style: normal; }
.intro, .split-feature, .editorial-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 78px; align-items: start; padding-bottom: 126px; }
.split-feature { grid-template-columns: minmax(0, 1fr) 360px; }
.feature-panel, .contact-card, .skill-card { border: 1px solid var(--ink); border-radius: 8px; background: var(--card); transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 420ms ease, background 420ms ease; }
.feature-panel { min-height: 230px; display: flex; flex-direction: column; justify-content: space-between; padding: 28px; box-shadow: var(--shadow); }
.feature-panel span, .feature-panel small, .skill-card p, .contact-card span { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.feature-panel strong { font-family: var(--serif); font-size: 42px; font-weight: 600; }
.feature-panel:hover, .contact-card:hover, .skill-card:hover { transform: translateY(-5px); background: rgba(255,251,243,0.76); box-shadow: 5px 5px 0 var(--hot); }
.page-hero { padding: 72px 0 82px; }
.page-hero p { width: min(720px, 100%); margin: 30px 0 0; }
.roster { padding-bottom: 126px; border-top: 1px solid var(--line); }
.project-list, .roster { overflow: visible; }
.project-row {
  position: relative;
  min-height: 120px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 30px;
  gap: 28px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  isolation: isolate;
  transition: transform 620ms cubic-bezier(0.16, 1, 0.3, 1), background 620ms ease, padding 620ms cubic-bezier(0.16, 1, 0.3, 1), border-color 620ms ease, box-shadow 620ms ease;
}
.project-row::before {
  content: "";
  position: absolute;
  inset: 10px 0 10px auto;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--hot), var(--accent));
  opacity: 0;
  transform: scaleY(0.38);
  transform-origin: center;
  transition: opacity 620ms ease, transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
}
.project-row:hover { padding-left: 16px; transform: translateY(-4px); background: rgba(255,251,243,0.38); border-color: rgba(155,31,14,0.34); box-shadow: 0 18px 38px rgba(23,17,13,0.08); }
.project-row:hover::before { opacity: 1; transform: scaleY(1); }
.row-number { align-self: start; margin-top: 34px; font-family: var(--mono); font-size: 11px; color: var(--muted); transition: color 620ms ease, transform 620ms cubic-bezier(0.16, 1, 0.3, 1); }
.project-row:hover .row-number { color: var(--accent); transform: translateX(2px); }
.project-row h2, .skill-card h2 { font-size: 30px; line-height: 1.05; }
.project-row h2, .project-row p { transition: transform 620ms cubic-bezier(0.16, 1, 0.3, 1), color 620ms ease; }
.project-row:hover h2, .project-row:hover p { transform: translateX(4px); }
.project-row p, .skill-card span { display: block; margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 150px; }
.tags span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; transition: border-color 620ms ease, color 620ms ease, background 620ms ease; }
.project-row:hover .tags span { border-color: rgba(155,31,14,0.25); color: var(--accent); background: rgba(255,251,243,0.48); }
.arrow-link { display: inline-block; color: var(--accent); font-family: var(--mono); font-size: 16px; transition: transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1), color 520ms ease; }
.project-row:hover .arrow-link { transform: translateX(6px); color: var(--hot); }
.arrow-link.muted { color: var(--muted); }
.skill-grid, .contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-bottom: 126px; }
.skill-card { min-height: 196px; padding: 28px; }
.skill-card.wide { grid-column: span 2; }
.contact-grid { grid-template-columns: repeat(2, 1fr); }
.contact-card { min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; padding: 28px; }
.contact-card strong { font-family: var(--serif); font-size: 36px; font-weight: 600; }
.contact-card small { color: var(--accent); font-family: var(--mono); font-size: 11px; overflow-wrap: anywhere; }
.fact-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding-bottom: 126px; }
.fact-strip div { border-top: 1px solid var(--ink); padding-top: 14px; }
.fact-strip strong { display: block; font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.fact-strip span { display: block; margin-top: 8px; color: var(--muted); }
.footer { border-top: 1px solid var(--ink); padding: 42px 0 48px; }
.footer-mark { font-size: clamp(82px, 13vw, 164px); line-height: 0.9; font-style: italic; }
.footer-mark span { color: var(--hot); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 38px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px 26px; font-size: 14px; }
.copyright { margin: 32px 0 0; font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 650ms ease, transform 650ms ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes buttonLoad {
  0% { transform: translateX(-120%); }
  52% { transform: translateX(260%); }
  100% { transform: translateX(260%); }
}
@keyframes pulseDot {
  0%, 100% { opacity: 0.35; transform: scale(0.82); }
  50% { opacity: 0.95; transform: scale(1.12); }
}
@keyframes profileOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@media (max-width: 860px) {
  .site-header { min-height: 82px; grid-template-columns: 1fr auto; position: relative; }
  .issue { display: none; }
  .menu-button { display: inline-flex; justify-self: end; }
  .nav { position: absolute; top: 70px; left: 0; right: 0; z-index: 10; display: none; flex-direction: column; align-items: flex-start; gap: 0; border: 1px solid var(--ink); border-radius: 8px; background: var(--paper-2); }
  .nav.is-open { display: flex; }
  .nav a { width: 100%; padding: 16px; border-bottom: 1px solid var(--line); }
  .hero, .intro, .split-feature, .editorial-grid { grid-template-columns: 1fr; gap: 42px; }
  .hero { min-height: auto; padding-top: 42px; }
  .hero h1 { font-size: clamp(64px, 18vw, 118px); }
  .portrait-wrap { width: min(300px, 78vw); margin: 0; }
  .ticker { margin-bottom: 88px; }
  .project-row { grid-template-columns: 34px minmax(0, 1fr) 24px; gap: 16px; padding: 26px 0; }
  .tags { grid-column: 2 / -1; justify-content: flex-start; }
  .skill-grid, .contact-grid, .fact-strip, .footer-grid { grid-template-columns: 1fr; }
  .skill-card.wide { grid-column: auto; }
}
@media (max-width: 520px) {
  .section-shell, .site-header, .ticker { width: min(100% - 28px, 980px); }
  .hero-actions { align-items: stretch; }
  .button { width: 100%; }
  .page-hero { padding-top: 50px; }
  .contact-card strong { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

.story-block {
  display: block;
  padding-bottom: 126px;
}
.story-block h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.08;
  margin: 0 0 28px;
}
.story-block p {
  color: #2e2721;
  font-size: 16px;
  line-height: 1.75;
  width: min(720px, 100%);
  margin: 18px 0 0;
}

.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;
}

.help-hero {
  padding-bottom: 58px;
}

.help-layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-bottom: 126px;
}

.help-brief,
.chat-shell {
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: rgba(255,251,243,0.58);
}

.help-brief {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 10px;
  padding: 22px;
}

.help-brief .section-index {
  margin-bottom: 12px;
}

.help-brief button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 700 11px var(--mono);
  text-align: left;
  text-transform: uppercase;
  padding: 0 15px;
  transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 360ms ease, background 360ms ease, color 360ms ease;
}

.help-brief button:hover {
  transform: translateX(4px);
  border-color: rgba(155,31,14,0.34);
  background: rgba(255,251,243,0.72);
  color: var(--accent);
}

.chat-shell {
  min-height: 590px;
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto auto;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 24px;
  scroll-behavior: smooth;
}

.chat-message {
  width: min(82%, 620px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255,251,243,0.62);
  animation: chatIn 460ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.chat-message span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font: 700 10px var(--mono);
  text-transform: uppercase;
}

.chat-message p {
  margin: 0;
  color: #2e2721;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.chat-message.user {
  align-self: flex-end;
  background: #1d120d;
  color: #fff7ec;
}

.chat-message.user span,
.chat-message.user p {
  color: #fff7ec;
}

.chat-message.loading p::after {
  content: "";
  display: inline-block;
  width: 26px;
  height: 8px;
  margin-left: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(155,31,14,0.2), var(--hot), rgba(155,31,14,0.2));
  animation: thinking 1.35s ease-in-out infinite;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.chat-form textarea {
  width: 100%;
  min-height: 54px;
  max-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,251,243,0.7);
  color: var(--ink);
  font: 500 14px/1.5 var(--sans);
  padding: 13px 14px;
  outline: none;
  transition: border-color 280ms ease, box-shadow 280ms ease, background 280ms ease;
}

.chat-form textarea:focus {
  border-color: rgba(155,31,14,0.48);
  background: rgba(255,251,243,0.9);
  box-shadow: 0 0 0 3px rgba(255,74,31,0.12);
}

.chat-note {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
  font: 700 10px var(--mono);
  text-transform: uppercase;
}

@keyframes chatIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes thinking {
  0%, 100% { opacity: 0.35; transform: translateY(1px) scaleX(0.75); }
  50% { opacity: 1; transform: translateY(1px) scaleX(1); }
}

@media (max-width: 860px) {
  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-brief {
    position: static;
  }

  .chat-shell {
    min-height: 560px;
  }
}

@media (max-width: 520px) {
  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-message {
    width: 100%;
  }
}
