/* Andrew Popa — late-night bench */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-mono.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-sans.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-sans-italic.woff2") format("woff2");
}

:root {
  --bg: #0C0B0A;
  --paper: #EDE6D9;
  --paper-dim: #9A9286;
  --amber: #E8B86D;
  --line: rgba(237, 230, 217, 0.09);
  --line-strong: rgba(232, 184, 109, 0.28);
  --display: "Instrument Serif", "Iowan Old Style", Palatino, serif;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --rail: 52px;
  --pad: clamp(20px, 4vw, 64px);
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 55% 45% at 78% 18%, #19140F 0%, var(--bg) 72%);
  background-attachment: fixed;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--amber); color: var(--bg); }

a { color: inherit; text-decoration: none; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus {
  left: 60px;
  z-index: 100;
  background: var(--amber);
  color: var(--bg);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.spine {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--rail);
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line-strong) 12%, var(--line-strong) 88%, transparent);
  z-index: 8;
  pointer-events: none;
}

.rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--rail);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
  pointer-events: none;
}

.rail span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(237, 230, 217, 0.38);
}

.top {
  position: absolute;
  top: 0;
  left: var(--rail);
  right: 0;
  z-index: 12;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--pad) 18px 28px;
}

.mark {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--amber);
}

.top nav {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.top nav a {
  position: relative;
  padding-bottom: 3px;
  transition: color 0.15s ease;
}

.top nav a:hover,
.top nav a:focus-visible { color: var(--paper); }

.top nav a:focus-visible { outline: 1px solid var(--amber); outline-offset: 4px; }

.top nav a::before {
  content: attr(data-i);
  color: var(--amber);
  margin-right: 8px;
  opacity: 0.7;
}

.hero {
  position: relative;
  min-height: 640px;
  height: 100vh;
  max-height: 800px;
  padding: 80px var(--pad) 28px calc(var(--rail) + 28px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(240px, 0.78fr);
  gap: clamp(20px, 3.5vw, 64px);
  align-items: center;
}

.hero-copy { max-width: 22ch; }

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 22px;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(48px, 8.6vw, 132px);
  line-height: 0.84;
  letter-spacing: -0.045em;
  color: var(--paper);
}

.hero h1 em {
  font-style: italic;
  color: var(--paper);
}

.thesis {
  margin-top: 26px;
  font-family: var(--sans);
  font-style: normal;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--paper);
  max-width: 22em;
}

.lede {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--paper-dim);
  max-width: 38ch;
}

.hero-meta {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(237, 230, 217, 0.42);
}

.portrait-stage {
  justify-self: end;
  width: min(100%, 280px, calc(52vh * 0.667));
  max-height: 52vh;
}

.portrait-bezel {
  position: relative;
  padding: 14px;
}

.portrait-frame {
  position: relative;
  margin: 0;
  aspect-ratio: 2 / 3;
  max-height: calc(52vh - 28px);
  overflow: hidden;
  background: #100E0C;
  box-shadow:
    0 0 0 1px rgba(232, 184, 109, 0.42),
    0 0 0 2px rgba(237, 230, 217, 0.12),
    0 24px 80px rgba(0, 0, 0, 0.5);
}

.portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  filter: saturate(0.52) contrast(1.08) brightness(0.78) sepia(0.22);
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(12, 11, 10, 0.04) 0%, rgba(12, 11, 10, 0.28) 100%),
    radial-gradient(ellipse 80% 70% at 50% 18%, transparent 40%, rgba(12, 11, 10, 0.22) 100%);
  mix-blend-mode: multiply;
}

.corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid var(--amber);
  opacity: 0.65;
  pointer-events: none;
}
.corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.stage {
  width: min(100%, 320px);
  justify-self: end;
  position: relative;
}

.bezel {
  position: relative;
  padding: 28px 72px 36px 18px;
}

.hud {
  position: absolute;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  opacity: 0.8;
}
.hud.tl { top: 10px; left: 22px; }
.hud.tr { top: 10px; right: 22px; }
.hud.bl { bottom: 14px; left: 22px; }

.pred {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  line-height: 1;
  pointer-events: none;
  z-index: 4;
}
.pred .lbl {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  opacity: 0.7;
  margin-bottom: 6px;
}
.pred .n {
  display: block;
  font-family: var(--display);
  font-size: 40px;
  color: var(--amber);
  letter-spacing: -0.04em;
}
.pred .c {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--paper-dim);
  margin-top: 6px;
}

.screen {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #100E0C;
  box-shadow:
    0 0 0 1px rgba(232, 184, 109, 0.12),
    0 24px 80px rgba(0, 0, 0, 0.45),
    0 0 60px rgba(232, 184, 109, 0.06);
}

.screen img,
.screen canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.screen canvas { z-index: 1; }

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 3px,
    rgba(12, 11, 10, 0.18) 3px 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.45;
}

.page {
  padding-left: calc(var(--rail) + 28px);
  padding-right: var(--pad);
}

section.block {
  padding: 56px 0;
  border-top: 1px solid var(--line);
  max-width: 1120px;
}

.sec-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 28px;
}

.job {
  display: grid;
  grid-template-columns: minmax(92px, 140px) minmax(0, 1fr);
  gap: 8px 28px;
  align-items: start;
  padding: 22px 0 28px;
  border-top: 1px solid var(--line);
}

.job:first-of-type { border-top: 0; padding-top: 0; }

.idx {
  font-family: var(--display);
  font-size: clamp(48px, 6.2vw, 92px);
  line-height: 0.72;
  letter-spacing: -0.06em;
  color: var(--amber);
  transform: translateY(-6px);
}

.job h2,
.project-copy h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 10px;
}

.job p,
.project-copy p {
  max-width: 58ch;
  color: #C9C1B4;
  font-size: 17px;
  line-height: 1.5;
}

.job .where,
.project-copy .where {
  margin-top: 0;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-dim);
  max-width: none;
}

.job .unit {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 12px;
  max-width: none;
}

.job.quiet {
  padding: 24px 0 8px;
  opacity: 0.72;
}

.job.quiet .idx {
  font-size: clamp(36px, 4.5vw, 56px);
  transform: none;
  opacity: 0.55;
}

.job.quiet h2 {
  font-size: clamp(20px, 2.2vw, 28px);
  margin-bottom: 6px;
}

.job.quiet .where {
  margin-bottom: 0;
  font-size: 10px;
}

.project.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding-bottom: 28px;
  margin-bottom: 4px;
}

.project-copy .idx {
  display: block;
  margin-bottom: 18px;
}

.project.featured + .job { border-top: 1px solid var(--line); }

.edu-school {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
}

.edu-degree {
  font-family: var(--display);
  font-size: clamp(26px, 2.6vw, 34px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 14px;
}

.edu-meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--paper-dim);
  margin-bottom: 6px;
}

.coursework {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237, 230, 217, 0.38);
  max-width: 42ch;
}

.coursework.in-progress {
  margin-top: 8px;
  color: rgba(232, 184, 109, 0.62);
  max-width: 46ch;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.38fr) minmax(0, 0.62fr);
  gap: 32px 48px;
  align-items: start;
}

.about-copy {
  font-size: 18px;
  line-height: 1.55;
  color: #D5CDC0;
  max-width: 42em;
}

.about-copy p + p { margin-top: 1.05em; }

.stack {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237, 230, 217, 0.4);
}

.foot {
  padding: 48px var(--pad) 44px calc(var(--rail) + 28px);
  border-top: 1px solid var(--line);
}

.foot .sec-label { margin-bottom: 20px; }

.write {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(20px, 2vw, 28px);
  color: var(--paper-dim);
  margin-bottom: 8px;
}

.mail {
  font-family: var(--display);
  font-size: clamp(18px, 2.1vw, 28px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--paper);
  border-bottom: 1px solid transparent;
  display: inline-block;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.mail:hover, .mail:focus-visible {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

.social {
  margin-top: 22px;
  display: flex;
  gap: 32px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.social a { color: var(--paper-dim); border-bottom: 1px solid transparent; }
.social a:hover, .social a:focus-visible { color: var(--amber); border-bottom-color: var(--amber); }

.colophon {
  margin-top: 32px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(237, 230, 217, 0.32);
}

@media (max-width: 900px) {
  :root { --rail: 0px; }
  .spine, .rail { display: none; }
  .hero {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    min-height: 100vh;
    padding: 96px 24px 48px;
    gap: 40px;
  }
  .hero-copy { max-width: none; }
  .portrait-stage {
    justify-self: start;
    width: min(100%, 240px);
    max-height: none;
  }
  .portrait-frame { max-height: none; }
  .stage { justify-self: start; width: min(100%, 360px); }
  .page { padding: 0 24px; }
  .about-grid { grid-template-columns: 1fr; }
  .job { grid-template-columns: 72px 1fr; }
  .project.featured { grid-template-columns: 1fr; }
  .foot { padding: 64px 24px; }
  .top { left: 0; padding-left: 24px; padding-right: 24px; }
  .top nav { gap: 14px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
