/* ============================================================
   Alex Reeve — Portfolio
   Swiss International Style × Bauhaus
   Palette: paper #F7F7F5 · ink #111111 · hairlines #E0E0E0
   Accents (sparing): #E63946 #1D3557 #F4A261
   ============================================================ */

:root {
  --bg: #F7F7F5;
  --ink: #111111;
  --ink-soft: #333333;
  --muted: #666666;
  --faint: #999999;
  --line: #E0E0E0;
  --red: #E63946;
  --blue: #1D3557;
  --yellow: #F4A261;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1160px;
  --gutter: clamp(20px, 4vw, 48px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "ss01" on, "cv11" on;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--red); color: #fff; }

a { color: inherit; text-decoration: none; }
ul, ol, dl, figure, blockquote { margin: 0; padding: 0; }
li { list-style: none; }
h1, h2, h3, p, dd, dt { margin: 0; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* ---------- Layering: canvas behind, content above ---------- */

#particle-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.site {
  position: relative;
  z-index: 10;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--gutter);
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.skip-link:focus { top: 12px; }

.noscript-note {
  margin: 120px auto 0;
  max-width: 60ch;
  padding: 0 var(--gutter);
  font-family: var(--serif);
  font-size: 18px;
}
.noscript-note a { text-decoration: underline; }

/* ---------- Primitives ---------- */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 900ms var(--ease-out) 150ms;
}
.rule-light { background: rgba(255, 255, 255, 0.28); }

.is-visible .rule,
.rule.is-visible { transform: scaleX(1); }

/* Underline that grows from the left */
.grow-underline { position: relative; }
.grow-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 300ms var(--ease-out);
}
.grow-underline:hover::after,
.grow-underline:focus-visible::after,
.grow-underline[aria-current="true"]::after { transform: scaleX(1); }

/* Ghost button — 1px border, fills black on hover, instant */
.btn {
  display: inline-block;
  padding: 14px 26px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: none;
}
.btn:hover,
.btn:focus-visible { background: var(--ink); color: #fff; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
}

.brand { font-weight: 500; }
.brand:hover { color: var(--red); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 3vw, 32px);
}

.nav-link { color: var(--muted); transition: color 200ms ease; }
.nav-link:hover,
.nav-link:focus-visible { color: var(--red); }
.nav-link[aria-current="true"] { color: var(--ink); }

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

.hero {
  padding-top: clamp(96px, 16vh, 180px);
  padding-bottom: clamp(72px, 12vh, 140px);
}

.hero > .eyebrow { color: var(--muted); margin-bottom: 28px; }

.hero-name {
  font-size: clamp(48px, 6vw, 96px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 12ch;
}

.hero-name .dot { color: var(--red); }

.hero-statement {
  margin-top: 36px;
  max-width: 54ch;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.55;
  color: var(--ink-soft);
  font-weight: 400;
}

.hero-meta {
  margin-top: clamp(56px, 9vh, 104px);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(32px, 6vw, 88px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.hero-meta .meta-item { min-width: 150px; }

.hero-meta dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}

.hero-meta dd { font-size: 15px; color: var(--ink); }
.hero-meta dd .status-dot {  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  margin-right: 8px;
  vertical-align: 1px;
}

@media (prefers-reduced-motion: no-preference) {
  .status-dot { animation: pulse 2.6s ease-in-out infinite; }
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
  }
}

/* ---------- Sections & the asymmetric grid ---------- */

.section { padding-top: clamp(64px, 9vh, 112px); padding-bottom: clamp(64px, 9vh, 112px); }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 60fr) minmax(0, 25fr);
  column-gap: clamp(48px, 8vw, 128px);
  align-items: start;
}

.col-primary { grid-column: 1; min-width: 0; }
.col-secondary { grid-column: 2; min-width: 0; }

.eyebrow {
  color: var(--muted);
  margin-bottom: 20px;
}
.eyebrow .index { color: var(--red); margin-right: 10px; }
.eyebrow-light { color: rgba(255, 255, 255, 0.6); }

.section-title {
  font-size: 24px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 40px 0 40px;
}

/* Biography prose */
.prose p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 1.4em;
  max-width: 62ch;
}

.prose p:first-child { font-size: 19px; line-height: 1.6; }

.prose p strong { font-weight: 600; }

.prose .pull-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink);
  border-left: 2px solid var(--red);
  padding-left: 20px;
  margin-block: 2em;
  max-width: 48ch;
}

/* Sidebar */
.sidebar { margin-top: 96px; position: sticky; top: 108px; }

.sidebar-lower { margin-top: 140px; }

.side-block { padding-block: 22px; border-bottom: 1px solid var(--line); }
.side-block:last-child { border-bottom: 0; }

.side-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}

.fact-row { display: flex; justify-content: space-between; gap: 16px; padding-block: 5px; }
.fact-key {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}
.fact-val { font-size: 14px; text-align: right; }

.reading-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
}
.reading-author { font-size: 13px; color: var(--muted); margin-top: 4px; }

.side-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  padding-block: 5px;
}
.side-link:hover { color: var(--red); }
.side-link .arrow { font-size: 11px; color: var(--faint); transition: transform 200ms ease, color 200ms ease; }
.side-link:hover .arrow { transform: translate(2px, -2px); color: var(--red); }

.side-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
.side-cite {
  display: block;
  margin-top: 10px;
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- Interstitial (full-bleed) ---------- */

.interstitial {
  margin-top: clamp(64px, 9vh, 112px);
  padding-block: clamp(80px, 13vh, 152px);
  background: var(--ink);
  color: #fff;
}

.interstitial .rule { margin-bottom: 20px; }

.statement {
  font-size: clamp(38px, 6vw, 84px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 14ch;
}

.statement .outline {
  color: transparent;
  -webkit-text-stroke: 1.5px #fff;
}

.shape-strip {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 48px;
}

.shape { display: block; }
.shape-square { width: 14px; height: 14px; background: var(--red); }
.shape-bar { width: 44px; height: 14px; background: var(--yellow); }
.shape-circle { width: 14px; height: 14px; border-radius: 50%; background: var(--blue); }

/* ---------- Selected Work ---------- */

.work-list { counter-reset: work; }

.work-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  column-gap: 24px;
  padding-block: 30px;
  border-bottom: 1px solid var(--line);
}
.work-item:first-child { border-top: 1px solid var(--line); }

.work-index {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  padding-top: 5px;
}

.work-body h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.work-body .work-link:hover h3,
.work-body .work-link:focus-visible h3 { color: var(--red); }

.work-arrow {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--faint);
  transition: transform 200ms ease, color 200ms ease;
}
.work-link:hover .work-arrow { transform: translate(3px, -3px); color: var(--red); }

.work-desc {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 56ch;
  margin-top: 8px;
}

.work-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 10px;
}

.work-year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding-top: 5px;
  white-space: nowrap;
}

/* ---------- Principles ---------- */

.principle-list { counter-reset: principle; }

.principle-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 24px;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
}
.principle-item:first-child { border-top: 1px solid var(--line); }

.principle-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  padding-top: 4px;
}

.principle-item h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.principle-item p {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 58ch;
}

/* ---------- Writing & Speaking ---------- */

.writing-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  column-gap: 24px;
  align-items: baseline;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
}
.writing-item:first-child { border-top: 1px solid var(--line); }

.writing-year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.writing-title {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
}
.writing-venue {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.writing-type {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.writing-link:hover .writing-title,
.writing-link:focus-visible .writing-title { color: var(--red); }

/* ---------- Contact ---------- */

.contact-lede {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 44px;
}

.contact-email {
  display: inline-block;
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.contact-email::after { bottom: 0; transform-origin: right center; }
.contact-email:hover { color: var(--red); }
.contact-email:hover::after { transform-origin: left center; }

.contact-actions { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }

.contact-socials {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 3vw, 32px);
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

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

.site-footer { border-top: 1px solid var(--line); margin-top: clamp(48px, 8vh, 96px); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-block: 32px;
  color: var(--faint);
}

.footer-note { color: var(--faint); }

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 600ms ease-out,
    transform 600ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .grid { column-gap: clamp(32px, 5vw, 64px); }
  .sidebar { margin-top: 48px; }
  .sidebar-lower { margin-top: 48px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  .header-inner { padding-block: 18px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-nav { gap: 18px; }

  .hero { padding-top: 72px; }
  .hero-meta { gap: 24px 40px; }

  .grid { grid-template-columns: minmax(0, 1fr); }
  .col-secondary { grid-column: 1; }
  .sidebar { position: static; margin-top: 56px; }
  .sidebar-lower { margin-top: 56px; }

  .work-item { grid-template-columns: 40px minmax(0, 1fr); }
  .work-year { grid-column: 2; padding-top: 12px; }

  .principle-item { grid-template-columns: 40px minmax(0, 1fr); }

  .writing-item { grid-template-columns: minmax(0, 1fr) auto; }
  .writing-year { grid-column: 1 / -1; order: -1; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .rule { transform: scaleX(1); }
}
