/* © 2026 Giuseppe Della Corte — All rights reserved */

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

:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #666666;
  --border: #e0e0e0;
  --accent: #1a1a1a;
  --orange: #ff6b00;
  --orange-dark: #e65c00;
  --card-bg: #fafafa;
  --hover-bg: #f0f0f0;
  --tag-border: #999999;
  --btn-hover: #444444;
  --shadow: rgba(0,0,0,0.04);
  --pixel-shadow: 4px 4px 0 var(--fg);
  --modal-overlay: rgba(0,0,0,0.6);
  --topbar-h: 52px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  background: var(--bg);
  background-image: radial-gradient(var(--border) 1px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--fg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ============ TOP BAR ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--topbar-h);
  padding: 0 1.25rem;
  background: var(--bg);
  border-bottom: 2px solid var(--fg);
}

.wordmark {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.wordmark-cursor {
  color: var(--orange);
  animation: blink 1.1s step-end infinite;
}

.topnav {
  display: flex;
  gap: 1.4rem;
}

.topnav a {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.52rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.topnav a:hover {
  color: var(--orange);
}

.nav-arrow {
  color: var(--orange);
}

/* ============ PIXEL WINDOW CARDS ============ */
.win {
  background: var(--bg);
  border: 2px solid var(--fg);
  box-shadow: var(--pixel-shadow);
  display: flex;
  flex-direction: column;
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.65rem;
  border-bottom: 2px solid var(--fg);
  flex-shrink: 0;
}

.win-dots {
  display: flex;
  gap: 4px;
}

.win-dots i {
  width: 7px;
  height: 7px;
  background: var(--fg);
  display: block;
}

.win-dots i:last-child {
  background: var(--orange);
}

.win-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.48rem;
  letter-spacing: 0.05em;
  color: var(--fg);
}

.win-file {
  color: var(--orange);
}

.card-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.05em;
  line-height: 1.6;
  color: var(--fg);
  margin-bottom: 0.7rem;
  flex-shrink: 0;
}

.win-body {
  padding: 0.9rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.btn-pixel {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  padding: 0.7rem 1rem;
  border: 2px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--fg);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
  text-align: center;
  display: inline-block;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.btn-pixel:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--fg);
}

.btn-pixel:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--fg);
}

.btn-orange {
  background: var(--orange);
  color: #fff;
}

.btn-orange:hover {
  background: var(--orange-dark);
}

.btn-black {
  background: var(--fg);
  color: var(--bg);
}

.btn-black:hover {
  background: var(--btn-hover);
}

.hero-coffee {
  display: block;
  margin: 0.9rem auto 0;
}

/* ============ HERO ============ */
.hero {
  min-height: calc(100svh - var(--topbar-h));
  display: flex;
  align-items: center;
  padding: 1.5rem;
}

.hero-grid {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 360px;
  gap: 1.2rem;
  align-items: stretch;
}

/* Identity card */
.id-card .win-body {
  gap: 0.7rem;
  justify-content: space-between;
}

.id-photo-frame {
  position: relative;
  width: 160px;
  margin: 0.2rem auto 0;
}

.id-photo-frame::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--fg);
  clip-path: polygon(0 10px, 10px 10px, 10px 0, calc(100% - 10px) 0, calc(100% - 10px) 10px, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 10px calc(100% - 10px), 0 calc(100% - 10px));
}

.id-photo {
  position: relative;
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  clip-path: polygon(0 10px, 10px 10px, 10px 0, calc(100% - 10px) 0, calc(100% - 10px) 10px, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 10px calc(100% - 10px), 0 calc(100% - 10px));
}

/* Circular variant: add class to .id-photo and hide ::before */
.id-photo.round {
  clip-path: none;
  border-radius: 50%;
  border: 2px solid var(--fg);
}

.id-photo.round + ::before,
.id-photo-frame.round::before {
  display: none;
}

.id-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

.id-role {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: -0.35rem;
}

.id-credo {
  font-size: 0.83rem;
  line-height: 1.65;
  color: var(--muted);
}

.id-credo-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.58rem;
  line-height: 1.8;
  color: var(--fg);
  margin-bottom: -0.4rem;
}

.id-icons {
  display: flex;
  gap: 0.5rem;
}

.id-writing {
  border-top: 2px solid var(--border);
  padding-top: 0.7rem;
}

.id-writing-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.48rem;
  letter-spacing: 0.05em;
  color: var(--fg);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.15s ease;
}

.id-writing-title:hover {
  color: var(--orange);
}

/* Center column */
.hero-main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1.5rem;
  min-width: 0;
}

.hero-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-shadow: 4px 4px 0 var(--border);
}

.hero-bio {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--fg);
}

.hero-bio mark,
.hero-now mark,
.portal-list mark {
  background: var(--orange);
  color: #fff;
  padding: 0.05em 0.35em;
  border-radius: 0.7em 0.35em 0.9em 0.4em / 0.5em 0.9em 0.4em 0.8em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero-now {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-hats {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.58rem;
  line-height: 1.8;
  color: var(--fg);
  margin: 0.2rem 0 0;
  text-align: center;
}

.blinky {
  color: var(--orange);
  animation: blink 1s step-end infinite;
}

/* Right column: portal cards */
.hero-side {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

.portal {
  color: var(--fg);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex: 1;
}

.portal:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--fg);
}

.portal-list {
  list-style: none;
  font-size: 0.8rem;
  line-height: 1.6;
}

.portal-list li {
  position: relative;
  padding-left: 0.9rem;
  margin-bottom: 0.4rem;
}

.portal-list li::before {
  content: '▪';
  position: absolute;
  left: 0;
  color: var(--orange);
}

.portal-cta {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.05em;
  margin-top: auto;
  padding-top: 0.6rem;
  display: block;
  transition: color 0.15s ease;
}

.portal:hover .portal-cta {
  color: var(--orange);
}

.portal-flame {
  gap: 0.55rem;
}

.flame-thumb {
  width: 100%;
  height: 96px;
  object-fit: cover;
  object-position: center 55%;
  display: block;
  border: 2px solid var(--fg);
  background: #000;
  filter: brightness(1.25) contrast(1.05);
}

.portal-quote {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--fg);
}

/* ============ SECTION LINKS STRIP ============ */
.marquee {
  border-top: 2px solid var(--fg);
  border-bottom: 2px solid var(--fg);
  background: var(--fg);
  padding: 0.55rem 0;
}

.marquee-track {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem 1.8rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.marquee-track a {
  color: var(--bg);
  text-decoration: none;
  transition: color 0.15s ease;
}

.marquee-track a:hover {
  color: var(--orange);
}

/* ============ SECTIONS ============ */
.section {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  scroll-margin-top: calc(var(--topbar-h) + 0.5rem);
}

/* Full-bleed 2px rule between sections (product-principles excluded: marquee borders it) */
.section ~ .section::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  height: 0;
  border-top: 2px solid var(--fg);
  pointer-events: none;
}

#working-together,
#publications-and-writing {
  z-index: 0;
}

/* Alternating tint band, full-bleed, behind section content */
#working-together::after,
#publications-and-writing::after {
  content: '';
  position: absolute;
  inset: 0 calc(50% - 50vw);
  background: var(--card-bg);
  background-image: radial-gradient(#e6e6e6 1px, transparent 1.2px);
  background-size: 22px 22px;
  z-index: -1;
  pointer-events: none;
}

.section-heading {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  line-height: 1.5;
  letter-spacing: 0.03em;
  margin-bottom: 1.2rem;
  text-shadow: 3px 3px 0 var(--border);
}

.section-lede {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.sub-heading {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

/* ============ PRODUCT PRINCIPLES ============ */
#product-principles .runner-wrap {
  margin-bottom: 2rem;
}

.lessons-list {
  list-style: decimal;
  padding-left: 1.4rem;
  font-size: 1rem;
  line-height: 1.7;
  columns: 2;
  column-gap: 2.5rem;
}

.lessons-list li {
  margin-bottom: 0.9rem;
  padding: 0.5rem 0.6rem;
  break-inside: avoid;
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}

.lesson-enemy {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.42rem;
  letter-spacing: 0.05em;
  background: var(--fg);
  color: var(--bg);
  padding: 0.3rem 0.45rem;
  margin-right: 0.55rem;
  display: inline-block;
  vertical-align: middle;
}

@keyframes lessonFlash {
  0%   { background: #ffe3cc; box-shadow: 4px 4px 0 var(--orange); }
  30%  { background: #ffc999; box-shadow: 4px 4px 0 var(--orange); }
  60%  { background: #ffe3cc; box-shadow: 4px 4px 0 var(--orange); }
  100% { background: transparent; box-shadow: none; }
}

.lesson-flash {
  animation: lessonFlash 2.2s ease forwards;
}

/* ============ JOURNEY ============ */
.journey-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}

.journey-controls .expand-all-btn {
  margin: 0;
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.journey-search {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--fg);
  box-shadow: 2px 2px 0 var(--border);
  min-width: 210px;
  flex: 1;
  max-width: 320px;
}

.journey-search::placeholder {
  color: var(--muted);
}

.journey-search:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.pill {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.05em;
  padding: 0.55rem 0.7rem;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--fg);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pill:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--border);
}

.pill.is-active {
  background: var(--orange);
  color: var(--bg);
  border-color: var(--orange);
  box-shadow: 2px 2px 0 var(--fg);
}

.pill:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 880px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  margin-bottom: 2.2rem;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 8rem;
  top: 0.5rem;
  bottom: -2.2rem;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-item[hidden] {
  display: none;
}

.timeline-date {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--fg);
  width: 6.5rem;
  flex-shrink: 0;
  text-align: right;
  padding-top: 0.15rem;
  line-height: 1.6;
  text-transform: uppercase;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  background: var(--fg);
  flex-shrink: 0;
  margin-top: 0.25rem;
  position: relative;
  z-index: 1;
}

.timeline-content {
  flex: 1;
  min-width: 0;
}

.entry {
  margin-bottom: 2.2rem;
}

.entry-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.5rem;
}

.entry-header:hover {
  color: var(--btn-hover);
}

.entry-header:hover .entry-title {
  color: var(--btn-hover);
}

.entry-toggle {
  position: absolute;
  right: 0;
  top: 0.15rem;
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.timeline-content.collapsed .entry-toggle {
  transform: rotate(0deg);
}

.timeline-content:not(.collapsed) .entry-toggle {
  transform: rotate(180deg);
}

.entry-details {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  max-height: 3000px;
  opacity: 1;
}

.timeline-content.collapsed .entry-details {
  max-height: 0;
  opacity: 0;
}

.expand-all-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.35rem 0.7rem;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 1.2rem;
  margin-left: auto;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.expand-all-btn:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.expand-all-btn[aria-expanded="false"] .collapse-text,
.expand-all-btn[aria-expanded="true"] .expand-text {
  display: none;
}

.expand-all-btn[aria-expanded="false"] .expand-text,
.expand-all-btn[aria-expanded="true"] .collapse-text {
  display: inline;
}

.entry-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.entry-meta {
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.entry-role {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 0.6rem;
  letter-spacing: 0.03em;
}

.entry-list {
  list-style: disc;
  padding-left: 1.2rem;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--fg);
}

.entry-list li {
  margin-bottom: 0.5rem;
}

.entry-list li.citation {
  list-style: none;
  margin-left: -1.2rem;
  margin-top: 0.6rem;
  padding: 0.7rem 1rem;
  background: var(--card-bg);
  border-left: 3px solid var(--fg);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ============ LOOKING FOR ============ */
.seeking-grid {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 2rem;
}

.seeking-flame-frame {
  border: 2px solid var(--fg);
  box-shadow: var(--pixel-shadow);
  padding: 6px;
  background: var(--bg);
}

.flame-video {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  background: #000;
  filter: brightness(1.25) contrast(1.05);
}

.flame-defs {
  list-style: none;
  margin: 10px 0 0;
  padding: 0 4px;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--muted);
}

.flame-defs strong {
  color: var(--fg);
}

.seeking-quote {
  font-size: 1.1rem;
  line-height: 1.8;
}

.seeking-quote > p {
  margin-bottom: 0.8rem;
}

.seeking-quote sup {
  color: var(--orange);
  font-weight: 600;
}

.seeking-punch {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.72rem;
  line-height: 1.8;
  margin: 1.2rem 0;
}

.seeking-cta {
  margin-top: 0.4rem;
}

.seeking-cta-row {
  text-align: center;
  margin-top: 1.4rem;
}

.seeking-notes {
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
  margin-top: 1.2rem;
}

.seeking-notes p {
  margin-bottom: 0.3rem;
}

.seeking-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.tile .win-body h4 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.62rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.tile .win-body p {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--muted);
}

/* ============ PROJECTS (sticky rail beside journey) ============ */
.journey-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 1fr);
  gap: 2.5rem;
}

.proj-rail {
  align-self: stretch;
}

.rail-heading {
  margin-bottom: 1rem;
}

.proj-rail .proj-mini {
  position: sticky;
  top: calc(var(--topbar-h) + 1rem + (var(--stk, 0) * 3rem));
  margin-top: 0;
  cursor: pointer;
}

.proj-rail .proj-mini + .proj-mini {
  margin-top: 3rem;
}

.proj-mini {
  border: 2px solid var(--fg);
  border-left: 5px solid var(--orange);
  box-shadow: 6px 6px 0 var(--fg);
  padding: 0.9rem 1rem;
  margin-top: 1rem;
  background: var(--bg);
  transition: box-shadow 0.15s ease;
}

/* CTA block atop the rail: same card shape, inverted orange accent */
.proj-cta {
  border: 2px solid var(--orange);
  border-left: 5px solid var(--orange);
  box-shadow: 6px 6px 0 var(--orange);
  padding: 0.9rem 1rem;
  margin-bottom: 1.2rem;
  background: var(--bg);
}

.proj-cta-title {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.05em;
  line-height: 1.7;
  margin-bottom: 0.7rem;
}

.proj-cta-label {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.proj-cta-input {
  width: 100%;
  box-sizing: border-box;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 0.45rem 0.6rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  resize: vertical;
  margin-bottom: 0.7rem;
}

.proj-cta-input:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}

.proj-cta-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.proj-cta-actions .btn-pixel {
  flex: 1;
  min-width: max-content;
}

/* Blurred CV details behind the contact gate */
.cv-gated > :not(.cv-gate) {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

.cv-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  margin-top: 0.6rem;
  padding: 0.7rem 0.6rem;
  border: 1px dashed var(--border);
  background: var(--card-bg);
}

/* SOLUTION row in rail cards: collapsed dropdown revealing the CTA */
.proj-solution {
  position: relative;
  flex-wrap: wrap;
  cursor: pointer;
  padding-right: 3.6rem;
}

.proj-solution:hover {
  color: var(--btn-hover);
}

.proj-solution::after {
  content: '▸ REVEAL';
  position: absolute;
  right: 0.2rem;
  top: 0.6rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.34rem;
  letter-spacing: 0.04em;
  color: var(--orange);
}

.proj-solution.open::after {
  content: '▾ HIDE';
}

.proj-solution > dd {
  display: none;
}

.proj-solution .cv-gate {
  display: none;
  flex-basis: 100%;
  margin-top: 0.4rem;
}

.proj-solution.open .cv-gate {
  display: flex;
}

.cv-gate-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  letter-spacing: 0.05em;
}

.cv-gate-sub {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 26ch;
}

.cv-gate-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.proj-mini.is-flash {
  box-shadow: 0 0 0 3px var(--orange), 8px 8px 0 var(--fg);
}

.proj-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.entry-kind {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.38rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.2rem 0.35rem;
  flex-shrink: 0;
}

.entry-kind-edu {
  color: var(--orange);
  border-color: var(--orange);
}

.proj-tags {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.chip {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.42rem;
  letter-spacing: 0.06em;
  background: var(--fg);
  color: var(--bg);
  padding: 0.3rem 0.45rem;
}

.proj-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.proj-desc {
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 0.7rem;
}

.proj-fields {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.proj-fields > div {
  display: flex;
  gap: 0.7rem;
  padding: 0.28rem 0;
}

.proj-fields dt {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: var(--muted);
  width: 4.6rem;
  flex-shrink: 0;
  padding-top: 0.3rem;
  line-height: 1.7;
}

.proj-fields dd {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--fg);
}

/* ============ PAPERS / WRITING ============ */
.papers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.tile-link {
  color: var(--fg);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--fg);
}

.tile-click {
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile-click:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--fg);
}

.tile-stretch {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.tile-click .paper-icons a {
  position: relative;
  z-index: 2;
}

.tile-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.tile-head h4 {
  margin-bottom: 0 !important;
}

.tile-logo {
  width: 34px;
  height: auto;
  flex-shrink: 0;
}

.tile-meta {
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.tile-text {
  font-size: 0.85rem;
  line-height: 1.65;
  margin-bottom: 0.8rem;
}

.tile-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border: 2px solid var(--fg);
  display: block;
  margin-bottom: 0.6rem;
}

.tile-link-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--fg);
  font-weight: 500;
}

.tile-link:hover .tile-link-text {
  color: var(--orange);
}

/* Publications */
.paper-link {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.1rem;
  transition: border-color 0.2s ease;
}

.paper-link:hover {
  border-bottom-color: var(--accent);
}

.paper-icons {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.paper-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.paper-icon:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* ============ CONTACT ============ */
.section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.9rem;
  font-weight: 400;
  margin-bottom: 1.2rem;
}

.gdpr {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 520px;
}

/* ============ RUNNER GAME ============ */
.runner-wrap {
  margin: 0.5rem 0 0;
}

#runner-game {
  width: 100%;
  height: auto;
  display: block;
  background: var(--fg);
  border: 2px solid var(--fg);
  box-shadow: var(--pixel-shadow);
  image-rendering: pixelated;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button.press-start {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.runner-wrap.runner-fs {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #000;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.runner-wrap.runner-fs #runner-game {
  width: 100vw;
  border: none;
  box-shadow: none;
}

.runner-close {
  display: none;
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--bg);
  color: var(--fg);
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.runner-wrap.runner-fs .runner-close {
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-cta {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.game-cta[hidden] {
  display: none;
}

.game-cta .press-start {
  width: auto;
  animation: none;
  border: 2px solid var(--fg);
  padding: 0.55rem 1.1rem;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  transition: background 0.15s ease, color 0.15s ease;
}

.game-cta .press-start:hover {
  background: var(--fg);
  color: var(--bg);
}

.press-orange {
  color: #fff !important;
  background: var(--orange) !important;
  border-color: var(--orange) !important;
}

.press-orange:hover {
  background: var(--orange-dark) !important;
  color: #fff !important;
}

.runner-wrap.runner-fs .game-cta .press-start {
  color: #fff;
  border-color: #fff;
}

.runner-wrap.runner-fs .game-cta .press-start:hover {
  background: #fff;
  color: #1a1a1a;
}

.runner-wrap.runner-fs .game-cta .press-orange {
  background: var(--orange) !important;
  border-color: var(--orange) !important;
  color: #fff !important;
}

/* ============ ARCADE / PERSONAS ============ */
.arcade-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  text-align: center;
  color: var(--fg);
  margin-bottom: 0.8rem;
  letter-spacing: 0.08em;
  text-shadow: 2px 2px 0px var(--border);
  word-break: break-word;
}

.arcade-strip {
  padding: 0.6rem 0 0.8rem;
  position: relative;
}

.arrow-btn {
  display: none;
  background: var(--fg);
  color: var(--bg);
  border: none;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.arrow-btn:hover {
  background: var(--btn-hover);
}

.press-start {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  text-align: center;
  color: var(--fg);
  margin-top: 0.8rem;
  animation: blink 1.2s step-end infinite;
  word-break: break-word;
  display: block;
  width: 100%;
  text-decoration: none;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.personas {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.persona {
  position: relative;
  padding: 0.6rem;
  text-align: center;
  transition: background 0.15s ease;
  border: 2px solid transparent;
  min-width: 0;
}

.persona:hover {
  background: var(--bg);
  border-color: var(--fg);
  box-shadow: var(--pixel-shadow);
}

.persona.selected::before {
  content: '►';
  position: absolute;
  left: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--orange);
  font-size: 0.6rem;
  animation: blink 0.8s step-end infinite;
  z-index: 1;
}

.persona-img {
  max-width: 120px;
  max-height: 120px;
  width: auto;
  height: auto;
  border-radius: 2px;
  margin: 0 auto 0.5rem;
  display: block;
  filter: grayscale(100%) contrast(1.1);
  image-rendering: pixelated;
  transition: filter 0.25s ease;
}

.persona:hover .persona-img,
.persona.selected .persona-img {
  filter: grayscale(0%) contrast(1);
}

.persona-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.58rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
  color: var(--fg);
  line-height: 1.4;
  word-break: break-word;
}

.persona-desc {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  font-weight: 400;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--tag-border);
  border-radius: 0;
  letter-spacing: 0;
  cursor: default;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.tag-data {
  background: transparent;
  color: var(--fg);
  border-color: var(--tag-border);
}

.tag-data:hover {
  background: #dbeafe;
  color: #1e3a5f;
  border-color: #1e3a5f;
}

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal[hidden] {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg);
  border: 2px solid var(--fg);
  box-shadow: var(--pixel-shadow);
  width: 95%;
  max-width: 960px;
  height: 90vh;
  overflow: hidden;
  z-index: 101;
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.6rem 2.8rem 0.6rem 0.9rem;
  border-bottom: 2px solid var(--fg);
  flex-shrink: 0;
}

.modal-contact-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  line-height: 1.6;
  color: var(--fg);
  margin: 0;
}

.modal-contact-text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-contact-text a:hover {
  color: var(--orange);
}

.modal-icons {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--fg);
  color: var(--bg);
  border: none;
  width: 2rem;
  height: 2rem;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 102;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--btn-hover);
}

.modal-content iframe {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: none;
}

/* ============ 404 ============ */
.error-404 {
  text-align: center;
  padding: 3rem 0;
}

.error-code {
  font-family: 'Press Start 2P', monospace;
  font-size: 3rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
  text-shadow: 4px 4px 0px var(--border);
}

.error-message {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg);
  margin-bottom: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Visually hidden for screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============ COOKIE WIDGET ============ */
.cookie-widget {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 200;
}

.cookie-icon {
  width: 2.4rem;
  height: 2.4rem;
  background: var(--fg);
  color: var(--bg);
  border: 2px solid var(--fg);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.cookie-icon:hover {
  background: var(--btn-hover);
}

.cookie-popup {
  display: none;
  position: absolute;
  bottom: 3rem;
  right: 0;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--fg);
  padding: 0.8rem 1rem;
  width: 260px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  line-height: 1.7;
  box-shadow: var(--pixel-shadow);
}

.cookie-popup.show {
  display: block;
}

.cookie-popup p {
  margin-bottom: 0.6rem;
}

.cookie-status {
  font-size: 0.42rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.cookie-popup a {
  color: var(--fg);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 0.5rem;
}

.cookie-accept,
.cookie-deny {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.48rem;
  padding: 0.3rem 0.5rem;
  border: 2px solid var(--fg);
  cursor: pointer;
  line-height: 1.4;
}

.cookie-accept {
  background: var(--fg);
  color: var(--bg);
}

.cookie-accept:hover {
  background: var(--btn-hover);
}

.cookie-deny {
  background: var(--bg);
  color: var(--fg);
}

.cookie-deny:hover {
  background: var(--hover-bg);
}

/* ============ FOOTER ============ */
.site-footer {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border-top: 2px solid var(--fg);
  text-align: center;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.site-footer-id {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.site-footer a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--fg);
  text-decoration: underline;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1240px) {
  .hero-grid {
    grid-template-columns: 260px minmax(0, 1fr) 320px;
  }
}

@media (max-width: 1024px) {
  .hero {
    min-height: 0;
    align-items: flex-start;
    padding-top: 2rem;
  }

  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }

  .id-card {
    grid-column: 1;
    grid-row: 1;
  }

  .hero-main {
    grid-column: 2;
    grid-row: 1;
  }

  .hero-side {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
  }
}

@media (max-width: 780px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .id-card,
  .hero-main,
  .hero-side {
    grid-column: 1;
    grid-row: auto;
  }

  .hero-side {
    grid-template-columns: 1fr;
    display: flex;
  }

  .seeking-grid {
    grid-template-columns: 1fr;
  }

  .seeking-flame-col {
    max-width: 360px;
  }

  .seeking-tiles,
  .papers-grid {
    grid-template-columns: 1fr;
  }

  .lessons-list {
    columns: 1;
  }

  .journey-layout {
    grid-template-columns: 1fr;
  }

  .proj-rail .proj-mini {
    position: static;
  }

  .proj-rail .proj-mini + .proj-mini {
    margin-top: 1rem;
  }
}

@media (max-width: 640px) {
  .topnav {
    gap: 0.8rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 1;
    min-width: 0;
  }

  .topnav::-webkit-scrollbar {
    display: none;
  }

  .topnav a {
    font-size: 0.42rem;
  }

  .personas {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 2.5rem 1.2rem;
  }

  .timeline-item {
    gap: 0.8rem;
  }

  .timeline-date {
    width: 5rem;
    font-size: 0.42rem;
  }

  .timeline-item::before {
    left: 6.2rem;
  }

  .persona-img {
    max-width: 110px;
    max-height: 110px;
    filter: none;
  }

  .persona-name {
    font-size: 0.55rem;
    white-space: normal;
  }

  .tag {
    font-size: 0.48rem;
  }

  .arcade-title {
    font-size: 0.65rem;
  }

  .press-start {
    font-size: 0.5rem;
    margin-top: 1rem;
    text-align: center;
    display: block;
    width: 100%;
  }

  .persona.selected::before {
    display: none;
  }

  .error-code {
    font-size: 2rem;
  }

  .error-message {
    font-size: 0.92rem;
  }

  .cookie-widget {
    position: relative;
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    padding: 0 1.2rem;
  }

  .cookie-popup {
    bottom: calc(100% + 0.5rem);
    top: auto;
    right: 0;
    left: auto;
    width: calc(100vw - 2.4rem);
    max-width: 260px;
  }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .blinky,
  .wordmark-cursor,
  .press-start,
  .persona.selected::before {
    animation: none;
  }
}
