/* ============================================================
   Fiorella Licciardiello — Personal Site
   style.css — shared across all pages
   ============================================================ */

/* ----- Google Fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* ----- CSS Custom Properties ----- */
:root {
  --bg:        #0d1117;
  --bg-card:   #161b22;
  --bg-hover:  #1c2333;
  --border:    #30363d;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --accent:    #8fa8c8;
  --accent-dim: rgba(143, 168, 200, 0.15);
  --accent-glow: rgba(143, 168, 200, 0.35);
  --green:     #8fa8c8;
  --lilac:     #c4b5fd;
  --sky:       #7dd3fc;
  --aqua:      #5eead4;
  --rose:      #f9a8d4;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --sidebar-w: 260px;
  --transition: 220ms ease;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   LAYOUT — Sidebar + Content
   ============================================================ */

.site-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ----- Sidebar ----- */
.sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 1.75rem 2.5rem 2.25rem;
  border-left: 1px solid rgba(255, 255, 255, 0.55);
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
}

/* Thin white line decorations: a second hairline beside the edge, corner ticks, rules between sections */
.sidebar::before {
  content: '';
  position: absolute;
  top: 1.5rem;
  bottom: 1.5rem;
  left: 7px;
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 1.5rem;
  right: 1rem;
  width: 18px;
  height: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  border-right: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.sidebar-brand {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.sidebar-brand::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 32px;
  height: 1px;
  background: rgba(255, 255, 255, 0.85);
}

.sidebar-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-name span {
  color: var(--accent);
}

.sidebar-tagline {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  line-height: 1.5;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  transition: color var(--transition), background var(--transition);
  position: relative;
}

.sidebar-nav a .nav-prefix {
  color: var(--accent);
  opacity: 0.7;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--text);
  background: var(--bg-hover);
}

.sidebar-nav a.active .nav-prefix {
  opacity: 1;
}

/* underline-slide effect */
.sidebar-nav a::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  bottom: 4px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

.sidebar-nav a:hover::after,
.sidebar-nav a.active::after {
  width: calc(100% - 1.5rem);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.sidebar-footer .status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 2.5s infinite;
}

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

/* ----- Main content ----- */
.site-wrapper { padding-right: var(--sidebar-w); }

.main-content {
  margin: 0 auto;
  flex: 1;
  max-width: 900px;
  padding: 4rem 3.5rem;
  animation: fadeIn 0.4s ease both;
}

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

/* ============================================================
   MOBILE NAV
   ============================================================ */

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.mobile-brand {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
}

.mobile-brand span { color: var(--accent); }

.hamburger {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 58px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 199;
  padding: 1rem 1.5rem;
}

.mobile-menu.open { display: block; }

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-menu a {
  display: block;
  padding: 0.6rem 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.mobile-menu a:hover,
.mobile-menu a.active { color: var(--accent); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: 1.5rem; color: var(--text); margin-bottom: 1.25rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }

.section-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

p { color: var(--muted); margin-bottom: 1rem; }
p strong { color: var(--text); font-weight: 500; }

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

.cursor {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

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

/* ============================================================
   CHIPS / TAGS
   ============================================================ */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  white-space: nowrap;
}

.chip.accent {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.cv-role {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.cv-company {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.cv-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.cv-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

/* Link buttons under each experience entry */
.cv-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.cv-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.cv-link-btn:hover {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 8%, transparent);
  transform: translateY(-1px);
}

/* Skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  transition: border-color var(--transition), color var(--transition);
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Language bar */
.lang-item {
  margin-bottom: 1rem;
}

.lang-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.lang-level { color: var(--muted); }

.lang-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.lang-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 1s ease;
}

.card-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  flex: 1;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: auto;
  transition: opacity var(--transition);
}

.card-link:hover { opacity: 0.7; }

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-weight: 500;
}

.badge.soon {
  background: rgba(143, 168, 200, 0.12);
  color: var(--green);
  border: 1px solid var(--green);
}

.badge.locked {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ============================================================
   CONTACT FORM
   ============================================================ */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 560px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 1rem;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b949e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(143, 168, 200, 0.15);
}

.form-group textarea { resize: vertical; min-height: 130px; }

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  align-self: flex-start;
}

.btn-submit:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.form-note {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-top: 0.25rem;
}

/* ============================================================
   CONTACTS PAGE
   ============================================================ */

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
  margin-bottom: 2.5rem;
}

.contact-link-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color var(--transition), background var(--transition);
}

.contact-link-item:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.contact-link-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.contact-link-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
}

.contact-link-value {
  font-size: 0.8rem;
  color: var(--muted);
}

.ascii-art {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--border);
  line-height: 1.4;
  white-space: pre;
  margin: 2rem 0;
}

.uptime-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 1rem;
}

.uptime-widget .ut-label { color: var(--green); }

.stat-widgets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
}

.visitor-widget .vw-sep { color: var(--border); }

.visitor-count {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Compact counter in the sidebar footer, shown on every page */
.sidebar-visitors {
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
}

/* Same counter for the mobile menu, where the sidebar is hidden */
.mobile-menu-footer {
  padding-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}

/* ============================================================
   OPPORTUNITIES PAGE
   ============================================================ */

.collab-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.collab-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color var(--transition);
}

.collab-card:hover { border-color: var(--accent); }

.collab-card h3 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.collab-card p {
  font-size: 0.83rem;
  color: var(--muted);
  margin: 0;
}

/* ============================================================
   HOME HIGHLIGHTS
   ============================================================ */

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.highlight-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.highlight-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(143, 168, 200, 0.35), 0 4px 24px rgba(143, 168, 200, 0.15);
  transform: translateY(-2px);
}

.highlight-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
}

.highlight-card .card-desc { flex: 1; }

.now-teaser {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  transition: border-color var(--transition), color var(--transition);
}

.now-teaser:hover { border-color: var(--accent); color: var(--text); }
.now-teaser .lw-prefix { color: var(--green); }

/* ============================================================
   FILTER BAR (journey + lab)
   ============================================================ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0 1.5rem;
}

.filter-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.filter-btn:hover { border-color: var(--accent); color: var(--text); }

.filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ============================================================
   TIMELINE (journey.html)
   ============================================================ */

.timeline {
  list-style: none;
  position: relative;
  padding-left: 1.75rem;
}

/* The vertical rail */
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 60%);
}

.tl-item {
  position: relative;
  padding-bottom: 1.75rem;
}

.tl-item:last-child { padding-bottom: 0; }

/* The dot on the rail */
.tl-item::before {
  content: '';
  position: absolute;
  left: calc(-1.75rem + 1px);
  top: 0.45rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.tl-item[data-kind="study"]::before { border-color: var(--green); }
.tl-item[data-kind="life"]::before  { border-color: var(--muted); }

.tl-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.tl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: border-color var(--transition);
}

.tl-card:hover { border-color: var(--accent); }

.tl-kind {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.tl-card .cv-desc { margin-top: 0.35rem; }

/* ============================================================
   JOURNEY LANES (journey.html)
   Each panel sets --lane; cards, dots and rails pick it up.
   ============================================================ */

.journey-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0 1.5rem;
}

.journey-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.4rem 0.95rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

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

.journey-tab.active {
  color: var(--lane);
  border-color: var(--lane);
  background: color-mix(in srgb, var(--lane) 12%, transparent);
}

.lane-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lane);
  flex-shrink: 0;
}

.lane-dot.multi {
  background: conic-gradient(var(--lilac) 0 25%, var(--sky) 0 50%, var(--aqua) 0 75%, var(--rose) 0);
}

.lane-heads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin: 1.5rem 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--lane);
}

.lane-heads span:first-child { text-align: right; }

/* Two-sided timeline: one row per entry, left or right of a centre rail */
.split-timeline {
  list-style: none;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3rem;
}

.split-timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--lane), var(--border) 70%);
}

.st-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.st-item[data-side="left"]  { grid-column: 1; text-align: right; }
.st-item[data-side="right"] { grid-column: 2; }
.st-item[data-side="left"] .cv-links { justify-content: flex-end; }

.st-item::before {
  content: '';
  position: absolute;
  top: 0.45rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--lane);
}

.st-item[data-side="left"]::before  { right: calc(-1.5rem - 5px); }
.st-item[data-side="right"]::before { left: calc(-1.5rem - 5px); }

.journey-panel .tl-card { border-color: color-mix(in srgb, var(--lane) 30%, var(--border)); }
.journey-panel .tl-card:hover { border-color: var(--lane); }
.journey-panel .tl-kind,
.journey-panel .cv-company { color: var(--lane); }

/* Things that haven't happened yet */
.st-item[data-future] .tl-card {
  border-style: dashed;
  background: transparent;
}

.st-item[data-future]::before { border-style: dashed; }

.maybe-badge {
  display: inline-block;
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 0.05rem 0.4rem;
  border: 1px dashed var(--lane);
  border-radius: 3px;
  color: var(--lane);
}

/* Bookshelf: genre groups, read | to read around a centre rail */
.genre { margin-bottom: 2rem; }

.genre-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--lane);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid color-mix(in srgb, var(--lane) 25%, var(--border));
}

.genre-count {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 0.5rem;
}

.split-shelf {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3rem;
  align-items: start;
}

.split-shelf::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--lane), var(--border) 80%);
}

.shelf {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.shelf-empty {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--border);
  padding: 0.35rem 0;
}

.shelf[data-shelf="read"] .shelf-empty { text-align: right; }

.book {
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--lane) 22%, var(--border));
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  line-height: 1.35;
  transition: border-color var(--transition);
}

.book:hover { border-color: var(--lane); }

.book-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}

.book-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

.gr-link {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  transition: color var(--transition), border-color var(--transition);
}

.gr-link:hover { color: var(--lane); border-color: var(--lane); }

.book-author {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--lane);
}

.book-tag {
  display: inline-block;
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
}

.book-tag.now { color: var(--lane); }

.book-note {
  margin: 0.3rem 0 0;
  padding-top: 0.3rem;
  border-top: 1px dashed var(--border);
  font-size: 0.72rem;
  font-style: italic;
}

.book-note:empty { display: none; }

/* Side layout: content left, a Desert Island hall as a sticky side menu on the right (bookshelf, lab) */
.main-content:has(.journey-panel:not([hidden]) > .side-layout) { max-width: 1240px; }

.side-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
}

.side-aside {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}
.side-aside .hall { margin: 0; }
.side-aside .hall-card { grid-template-columns: 1fr; gap: 0.9rem; }
.side-aside .hall-cover { width: 96px; }

.reading-now .shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Desert Island Shelf: the hall of fame */
.hall {
  margin: 1.5rem 0 2.5rem;
  padding: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--lane) 45%, var(--border));
  border-radius: 10px;
  background: radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--lane) 10%, transparent), transparent 60%);
}

.hall-head h3 {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.hall-head p { font-size: 0.85rem; margin-bottom: 1.25rem; }

.hall-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.25rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--lane);
  border-radius: 8px;
  box-shadow: 0 4px 24px color-mix(in srgb, var(--lane) 12%, transparent);
}

.hall-cover {
  aspect-ratio: 2 / 3;
  border-radius: 3px 8px 8px 3px;
  padding: 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(160deg, color-mix(in srgb, var(--lane) 55%, var(--bg)), var(--bg) 85%);
  border-left: 6px solid color-mix(in srgb, var(--lane) 70%, black);
  box-shadow: 3px 3px 0 var(--border);
}

.hall-cover-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
  hyphens: auto;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

.hall-cover-author {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  opacity: 0.8;
}

.hall-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.hall-oneliner {
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
  color: var(--text);
  font-style: italic;
}

.hall-label {
  margin-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--lane);
}

.hall-list {
  margin: 0.3rem 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.hall-list li { margin-bottom: 0.2rem; }

.hall-readif { margin: 0.2rem 0 0; font-size: 0.85rem; }

.hall-slot {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px dashed color-mix(in srgb, var(--lane) 40%, var(--border));
  border-radius: 8px;
}

.hall-slot p { margin: 0; font-size: 0.8rem; }

/* The Big Picture: one rail, each card coloured by its lane */
.lane-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.lane-legend > span { display: inline-flex; align-items: center; gap: 0.4rem; }

.big-picture .tl-item::before { border-color: var(--lane); }
.big-picture .tl-card { border-left: 3px solid var(--lane); }
.big-picture .tl-kind { color: var(--lane); }
.big-picture .tl-item[data-future] .tl-card { border-style: dashed; border-left-style: solid; }

@media (max-width: 768px) {
  .lane-heads { display: none; }

  /* Collapse to one rail on the left; the tl-kind label says which side it was */
  .split-timeline {
    grid-template-columns: 1fr;
    padding-left: 1.5rem;
  }

  .split-timeline::before { left: 5px; }

  .st-item[data-side="left"],
  .st-item[data-side="right"] { grid-column: 1; text-align: left; }

  .st-item[data-side="left"] .cv-links { justify-content: flex-start; }

  .st-item[data-side="left"]::before,
  .st-item[data-side="right"]::before { left: calc(-1.5rem + 1px); right: auto; }

  .split-shelf { grid-template-columns: 1fr; row-gap: 0.75rem; }
  .split-shelf::before { display: none; }
  .shelf[data-shelf="read"] .shelf-empty { text-align: left; }

  .shelf::before {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
  }

  .shelf[data-shelf="read"]::before { content: 'read'; }
  .shelf[data-shelf="toread"]::before { content: 'to read'; }

  .hall-card { grid-template-columns: 1fr; }
  .hall-cover { width: 110px; }

  .side-layout { grid-template-columns: 1fr; }
  .side-aside { position: static; max-height: none; overflow: visible; order: -1; }
}

/* ============================================================
   LAB (lab.html)
   ============================================================ */

.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}

.lab-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

a.lab-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(143, 168, 200, 0.35), 0 4px 24px rgba(143, 168, 200, 0.15);
  transform: translateY(-2px);
}


.lab-thumb,
.lab-card iframe {
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 0;
  border-radius: 6px;
}

.lab-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, var(--accent-dim), var(--bg) 70%);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--accent);
}

.lab-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.lab-meta .tl-kind { margin-bottom: 0; }

/* Lab shelves: Facts is a tight timeline, Long Reads a compact list, Everything reuses the timeline */
.lab-item.placeholder { opacity: 0.55; }
.lab-card.placeholder { border-style: dashed; }

.fact-line {
  list-style: none;
  position: relative;
  padding-left: 0;
}
.fact-line::before {
  content: '';
  position: absolute;
  top: 0.4rem;
  bottom: 0.4rem;
  left: 52px;
  width: 1px;
  background: color-mix(in srgb, var(--lane, var(--accent)) 45%, var(--border));
}
.fact-line > li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1.1rem;
  position: relative;
  padding: 0.45rem 0;
}
.fact-line > li::after {
  content: '';
  position: absolute;
  left: 49px;
  top: 0.95rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lane, var(--accent));
}
.fact-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  padding-top: 0.35rem;
  text-align: right;
  padding-right: 0.6rem;
}
.fact-body {
  padding: 0.55rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--lane, var(--accent));
  border-radius: 6px;
}
.fact-line > li.placeholder .fact-body { border-style: dashed; }
.fact-line > li.fact .fact-date { font-size: 1.05rem; padding-top: 0.4rem; }
.fact-text { margin: 0; font-size: 0.9rem; color: var(--text); }
.fact-why { margin: 0.2rem 0 0; font-size: 0.78rem; color: var(--muted); }
.fact-src {
  display: inline-block;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}
.fact-line .tl-kind { margin-bottom: 0.15rem; color: var(--lane, var(--accent)); }

.read-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.read {
  padding: 0.7rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--lane);
  border-radius: 6px;
}
.read.placeholder { border-style: dashed; }
.read-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.read-head .tl-kind { margin-bottom: 0; }
.read .card-desc { margin: 0.3rem 0 0; }

.lab-empty { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }

/* ============================================================
   NOW (now.html)
   ============================================================ */

.now-updated {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green);
  margin-top: 0.75rem;
}

.now-list {
  display: flex;
  flex-direction: column;
  margin-top: 2rem;
  max-width: 620px;
}

.now-item {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.now-item:last-child { border-bottom: none; }
.now-item p { margin: 0; color: var(--text); }

.now-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 0.2rem;
}

.inline-link {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color var(--transition);
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .highlight-grid { grid-template-columns: 1fr; }
  .collab-grid   { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav { display: flex; }

  .site-wrapper { padding-right: 0; }

  .main-content {
    margin: 0;
    padding: 5.5rem 1.5rem 3rem;
    max-width: 100%;
  }
  .skills-grid   { grid-template-columns: repeat(2, 1fr); }
  .collab-grid   { grid-template-columns: 1fr; }
  .now-item      { grid-template-columns: 1fr; gap: 0.25rem; }
}

@media (max-width: 390px) {
  .main-content { padding: 5rem 1rem 2.5rem; }
  .chips { gap: 0.35rem; }
  h1 { font-size: 1.65rem; }
}

/* ============================================================
   CONSTELLATION CANVAS
   ============================================================ */

#constellation-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Tooltip shown on dot click */
.constellation-tooltip {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  transform: translateX(-50%) translateY(-100%);
  margin-top: -10px;
  white-space: nowrap;
  transition: opacity 0.18s ease;
}

.constellation-tooltip.visible {
  opacity: 1;
}

/* ============================================================
   HERO SECTION (index.html)
   ============================================================ */

.hero-section {
  padding: 1.5rem 0 3rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--muted);
  margin-top: 0.85rem;
  letter-spacing: 0.05em;
}

/* ============================================================
   BIO BLOCK
   ============================================================ */

.bio-block {
  max-width: 600px;
  margin-bottom: 1.5rem;
}

.bio-block p {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

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

/* ============================================================
   RESPONSIVE — constellation / hero overrides
   ============================================================ */

@media (max-width: 768px) {
  .hero-section {
    padding: 0.5rem 0 2rem;
  }
}

@media (max-width: 390px) {
  .hero-name { font-size: 2rem; }
  .hero-tagline { font-size: 0.9rem; }
}

/* ============================================================
   3D BACKGROUND (bg3d.js) + picker
   ============================================================ */

#bg3d-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.bg-picker {
  position: fixed;
  right: calc(var(--sidebar-w) + 1rem);
  bottom: 1rem;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(13, 17, 23, 0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.bg-picker-label {
  color: var(--muted);
  padding: 0 0.35rem 0 0.55rem;
}

.bg-picker button {
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.bg-picker button:hover { color: var(--text); }

.bg-picker button[aria-checked="true"] {
  color: var(--bg);
  background: var(--accent);
}

.bg-picker button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

@media (max-width: 480px) {
  .bg-picker { right: 0.5rem; bottom: 0.5rem; font-size: 0.68rem; }
  .bg-picker-label { display: none; }
  .bg-picker button { padding: 0.3rem 0.5rem; }
}

/* The home constellation only shows when the 3D background is off */
html[data-bg]:not([data-bg="off"]) #constellation-canvas,
html[data-bg]:not([data-bg="off"]) .constellation-tooltip { display: none; }

/* ----- Game Boy mode: the page runs on the console in the desk photo -----
   bg3d.js sizes .gb-photo and pins the LCD, LED and button hotspots
   onto it in the photo's own coordinates. */
html[data-bg="gameboy"] body { overflow: hidden; background: #1c140d; }
html[data-bg="gameboy"] .sidebar,
html[data-bg="gameboy"] .mobile-nav,
html[data-bg="gameboy"] .mobile-menu { display: none !important; }

.gb-shell {
  --lcd: #8d8b57;
  --lcd-light: #979460;
  --lcd-dark: #262b15;
  --lcd-mid: #474a2a;
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  background: #1c140d;
}

/* the photo again, blurred, for whatever the sharp one doesn't cover */
.gb-backdrop {
  position: absolute;
  inset: -40px;
  background: url(../assets/backgrounds/gameboy/desk-tiny.jpg) center / cover;
  filter: blur(24px) brightness(0.7);
}

.gb-photo {
  position: absolute;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  transform: translate(var(--look-x, 0px), var(--look-y, 0px)) scale(1.012);
  transition: transform 1.2s cubic-bezier(.2, .8, .2, 1);
  animation: gbIn 0.6s ease-out backwards;
}
@keyframes gbIn { from { opacity: 0; transform: scale(1.04); } }

.gb-photo > * { position: absolute; }

.gb-led {
  border-radius: 50%;
  background: radial-gradient(circle, #b9ff9a 0 25%, rgba(110, 220, 90, 0.6) 45%, transparent 72%);
  mix-blend-mode: screen;
  animation: gbLed 3s ease-in-out infinite;
}
@keyframes gbLed { 50% { opacity: 0.65; } }

/* ----- The LCD ----- */
.gb-lcd {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(100deg, rgba(0, 0, 0, 0.08), transparent 30%, rgba(255, 220, 160, 0.06) 85%),
    var(--lcd);
  box-shadow: inset 0 0 0 1px rgba(20, 22, 10, 0.6), inset 0 6px 12px rgba(0, 0, 0, 0.3);
}
/* pixel grid, glass sheen and the warm light falling on the screen */
.gb-lcd::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    repeating-linear-gradient(0deg, rgba(38, 43, 21, 0.08) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(38, 43, 21, 0.06) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, rgba(255, 230, 180, 0.12), transparent 40%),
    radial-gradient(130% 120% at 55% 45%, transparent 55%, rgba(30, 28, 12, 0.35));
}

.gb-nav {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  margin: 0 0.55rem;
  padding: 0.45rem 0.1rem 0.3rem;
  border-bottom: 2px solid var(--lcd-dark);
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  line-height: 1;
  text-transform: uppercase;
  color: var(--lcd-dark);
}
.gb-nav span { opacity: 0.7; }
.gb-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.2rem;
}
.gb-nav a:hover,
.gb-nav a.is-current { background: var(--lcd-dark); color: var(--lcd); }

.gb-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--lcd-dark) transparent;
  container: gb / inline-size;
  transition: opacity 0.12s;
}
.gb-shell.is-switching .gb-screen,
.gb-shell.is-switching .gb-nav { opacity: 0; }

/* The page itself, in the LCD's few shades of olive */
.gb-screen .main-content {
  margin: 0;
  max-width: none;
  padding: 0.8rem 0.7rem 2rem;
  animation: none;
  --bg: var(--lcd);
  --bg-card: rgba(38, 43, 21, 0.06);
  --bg-hover: rgba(38, 43, 21, 0.12);
  --border: var(--lcd-dark);
  --text: var(--lcd-dark);
  --muted: var(--lcd-mid);
  --accent: var(--lcd-dark);
  --accent-dim: rgba(38, 43, 21, 0.1);
  --accent-glow: rgba(38, 43, 21, 0.2);
  --green: var(--lcd-dark);
  --lilac: var(--lcd-dark);
  --sky: var(--lcd-dark);
  --aqua: var(--lcd-dark);
  --lane: var(--lcd-dark);
  --font-display: 'VT323', monospace;
  --font-mono: 'VT323', monospace;
  --font-sans: 'VT323', monospace;
  font-family: var(--font-sans);
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--text);
}
.gb-screen .main-content * {
  border-radius: 0 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  letter-spacing: 0 !important;
}
.gb-screen .main-content :where(p, li, .card-desc) { font-size: 1.2rem; line-height: 1.15; }
.gb-screen .main-content :is(h1, h2, h3, .hero-name, .card-title) { font-weight: 400; line-height: 1; }
.gb-screen .hero-name { font-size: 2.3rem; }
.gb-screen .hero-tagline { font-size: 1.2rem; }
.gb-screen h1 { font-size: 2.1rem; }
.gb-screen h2 { font-size: 1.6rem; }
.gb-screen .card-title { font-size: 1.45rem; }
.gb-screen .main-content :is(.cv-role, .book-title) { font-size: 1.3rem; line-height: 1.05; }
.gb-screen .main-content :is(.cv-desc, .now-item) { font-size: 1.2rem; line-height: 1.15; }
.gb-screen .hero-section { padding: 0.3rem 0 0.9rem; }
.gb-screen .divider { margin: 1rem 0; }
.gb-screen .main-content :is(.section-label, .chip, .skill-tag, .journey-tab, .filter-btn, .highlight-kicker, .card-link, .lw-prefix, .lang-level, .tl-kind, .tl-date, .cv-company, .book-tag, .book-author, .book-note, .genre-title, .genre-count, .now-label, .placeholder, .hall-head) {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  line-height: 1.1;
}
.gb-screen .chip { white-space: normal; }
.gb-screen .main-content :is(.highlight-card, .chip, .skill-tag, .tl-card, .lab-card, .now-teaser, .social-btn) {
  border: 2px solid var(--lcd-dark);
  outline: 1px solid var(--lcd-dark);
  outline-offset: -5px;
}
.gb-screen .main-content :is(.chip, .skill-tag, .social-btn) { outline: none; }
.gb-screen img,
.gb-screen iframe,
.gb-screen video {
  filter: grayscale(1) contrast(1.3) brightness(0.95);
  mix-blend-mode: multiply;
  image-rendering: pixelated;
}
.gb-screen ::selection { background: var(--lcd-dark); color: var(--lcd); }

/* The d-pad cursor: the selected item flips to light-on-dark */
.gb-screen .gb-selected {
  --text: var(--lcd);
  --muted: var(--lcd-light);
  --accent: var(--lcd);
  --border: var(--lcd);
  background: var(--lcd-dark) !important;
  color: var(--lcd) !important;
  outline: 2px solid var(--lcd-dark) !important;
  outline-offset: 2px !important;
  animation: gbBlink 1s steps(2, jump-none) infinite;
}
@keyframes gbBlink { 50% { outline-color: transparent; } }

/* The screen is phone-sized, so it gets the phone layout */
@container gb (max-width: 768px) {
  .highlight-grid { grid-template-columns: 1fr; }
  .skills-grid    { grid-template-columns: repeat(2, 1fr); }
  .collab-grid    { grid-template-columns: 1fr; }
  .now-item       { grid-template-columns: 1fr; gap: 0.25rem; }
  .lane-heads { display: none; }

  /* Collapse to one rail on the left; the tl-kind label says which side it was */
  .split-timeline {
    grid-template-columns: 1fr;
    padding-left: 1.5rem;
  }

  .split-timeline::before { left: 5px; }

  .st-item[data-side="left"],
  .st-item[data-side="right"] { grid-column: 1; text-align: left; }

  .st-item[data-side="left"] .cv-links { justify-content: flex-start; }

  .st-item[data-side="left"]::before,
  .st-item[data-side="right"]::before { left: calc(-1.5rem + 1px); right: auto; }

  .split-shelf { grid-template-columns: 1fr; row-gap: 0.75rem; }
  .split-shelf::before { display: none; }
  .shelf[data-shelf="read"] .shelf-empty { text-align: left; }

  .shelf::before {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
  }

  .shelf[data-shelf="read"]::before { content: 'read'; }
  .shelf[data-shelf="toread"]::before { content: 'to read'; }

  .hall-card { grid-template-columns: 1fr; }
  .hall-cover { width: 110px; }

  .side-layout { grid-template-columns: 1fr; }
  .side-aside { position: static; max-height: none; overflow: visible; order: -1; }
}

/* ----- Hotspots on the photo's buttons ----- */
.gb-hot {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 80ms, transform 80ms;
}
.gb-round { border-radius: 50%; }
.gb-pill  { border-radius: 40%; transform: rotate(-25deg); }
.gb-pad   { border-radius: 4px; }
.gb-hot:hover { background: rgba(255, 230, 190, 0.08); }
.gb-hot:active,
.gb-hot.is-pressed { background: rgba(0, 0, 0, 0.35); }
.gb-round:active,
.gb-round.is-pressed { background: radial-gradient(circle, rgba(0, 0, 0, 0.45) 55%, transparent 72%); }
.gb-hot:focus-visible { outline: 2px solid #f3e6c4; outline-offset: 2px; }

/* ----- Things on the desk ----- */
.gb-prop {
  display: block;
  border-radius: 12px;
  transition: background 0.3s;
}
.gb-prop:hover,
.gb-prop:focus-visible { background: radial-gradient(closest-side, rgba(255, 210, 140, 0.16), transparent); }
.gb-prop:focus-visible { outline: 2px dashed #f3e6c4; outline-offset: -6px; }

.gb-tip {
  position: absolute;
  left: 50%;
  top: 8%;
  transform: translate(-50%, 6px);
  padding: 0.25rem 0.55rem;
  font-family: 'VT323', monospace;
  font-size: 1.15rem;
  line-height: 1;
  white-space: nowrap;
  color: #f3e6c4;
  background: rgba(28, 20, 13, 0.85);
  border: 2px solid #f3e6c4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.gb-prop:hover .gb-tip,
.gb-prop:focus-visible .gb-tip { opacity: 1; transform: translate(-50%, 0); }

/* steam rising from the mug */
.gb-steam {
  position: absolute;
  left: 30%;
  top: -12%;
  width: 30%;
  height: 30%;
  pointer-events: none;
}
.gb-steam i {
  position: absolute;
  bottom: 0;
  width: 18%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 245, 230, 0.35), transparent 65%);
  filter: blur(6px);
  opacity: 0;
  animation: gbSteam 3.6s ease-in infinite;
}
.gb-steam i:nth-child(1) { left: 15%; }
.gb-steam i:nth-child(2) { left: 42%; animation-delay: 1.2s; }
.gb-steam i:nth-child(3) { left: 68%; animation-delay: 2.4s; }
.gb-prop-mug:hover .gb-steam i { animation-duration: 2s; }
@keyframes gbSteam {
  0%   { transform: translateY(30%) scaleX(0.8); opacity: 0; }
  30%  { opacity: 0.9; }
  100% { transform: translateY(-70%) translateX(10%) scaleX(1.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .gb-photo { transform: none; }
  .gb-led, .gb-steam i, .gb-screen .gb-selected { animation: none; }
}

/* Phones: a smaller LCD, so slightly smaller type */
@media (max-width: 768px) {
  .gb-nav { font-size: 1.05rem; gap: 0.3rem; margin: 0 0.35rem; }
  .gb-screen .main-content { font-size: 1.1rem; padding: 0.6rem 0.45rem 1.5rem; }
  .gb-screen .hero-name { font-size: 1.9rem; }
  .gb-screen h1 { font-size: 1.7rem; }
  .gb-tip { display: none; }
}

/* ----- Pinball mode: the page runs on the monitors beside the machine -----
   bg3d.js sizes .pb-photo, warps the monitors onto the glass with
   matrix3d and places the hotspots in the photo's coordinates.   */
html[data-bg="pinball"] body { overflow: hidden; background: #0c0a18; }
html[data-bg="pinball"] .sidebar,
html[data-bg="pinball"] .mobile-nav,
html[data-bg="pinball"] .mobile-menu { display: none !important; }

.pb-shell {
  --neon-text: #f4ecff;
  --neon-muted: #b9add8;
  --neon-orange: #ffb04a;
  --neon-pink: #ff5fd2;
  --neon-cyan: #6fe7ff;
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  background: #0c0a18;
  font-family: 'Roboto Condensed', var(--font-sans);
}

.pb-backdrop {
  position: absolute;
  inset: -40px;
  background: url(../assets/backgrounds/pinball/table-tiny.jpg) center / cover;
  filter: blur(26px) brightness(0.55);
}

.pb-photo {
  position: absolute;
  background-size: 100% 100%;
  transform: translate(var(--look-x, 0px), var(--look-y, 0px)) scale(1.01);
  transition: transform 1.2s cubic-bezier(.2, .8, .2, 1);
  animation: gbIn 0.6s ease-out backwards;
}
.pb-photo > * { position: absolute; }
.pb-canvas { inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ----- Monitors ----- */
.pb-monitor {
  left: 0;
  top: 0;
  transform-origin: 0 0;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(40, 30, 80, 0.55), rgba(8, 8, 22, 0.75));
  box-shadow: inset 0 0 30px rgba(120, 90, 255, 0.25), 0 0 40px rgba(120, 90, 255, 0.15);
}
/* glass glare + faint scanlines */
.pb-monitor::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px),
    linear-gradient(115deg, rgba(255, 255, 255, 0.09), transparent 35%);
}

.pb-screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--neon-pink) transparent;
  container: pb / inline-size;
}

.pb-screen .main-content {
  margin: 0;
  max-width: none;
  padding: 0.9rem 1rem 2rem;
  animation: none;
  --bg: transparent;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(185, 160, 255, 0.35);
  --text: var(--neon-text);
  --muted: var(--neon-muted);
  --accent: var(--neon-orange);
  --accent-dim: rgba(255, 176, 74, 0.15);
  --accent-glow: rgba(255, 95, 210, 0.35);
  --green: var(--neon-cyan);
  --lilac: #c9a8ff;
  --sky: var(--neon-cyan);
  --aqua: var(--neon-cyan);
  --font-display: 'Roboto Condensed', sans-serif;
  --font-sans: 'Roboto Condensed', sans-serif;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
}
.pb-screen .hero-name,
.pb-screen h1,
.pb-screen h2 {
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--neon-orange);
  text-shadow: 0 0 6px rgba(255, 140, 40, 0.7), 0 0 18px rgba(255, 95, 210, 0.45);
}
.pb-screen .hero-name { font-size: 1.7rem; line-height: 1.1; }
.pb-screen h1 { font-size: 1.5rem; line-height: 1.15; }
.pb-screen h2 { font-size: 1.15rem; }
.pb-screen .hero-tagline { font-size: 0.85rem; }
.pb-screen .hero-section { padding: 0.2rem 0 1rem; }
.pb-screen .divider { margin: 1.2rem 0; }
.pb-screen .section-label { color: var(--neon-cyan); text-shadow: 0 0 8px rgba(111, 231, 255, 0.6); }
.pb-screen .main-content :is(.highlight-card, .tl-card, .lab-card, .chip, .skill-tag, .now-teaser) {
  border-color: rgba(185, 160, 255, 0.4);
}
.pb-screen .main-content :is(.highlight-card, .tl-card, .lab-card):hover {
  border-color: var(--neon-pink);
  box-shadow: 0 0 14px rgba(255, 95, 210, 0.4);
}

@container pb (max-width: 768px) {
  .highlight-grid { grid-template-columns: 1fr; }
  .skills-grid    { grid-template-columns: repeat(2, 1fr); }
  .collab-grid    { grid-template-columns: 1fr; }
  .now-item       { grid-template-columns: 1fr; gap: 0.25rem; }
  .lane-heads { display: none; }
  .split-timeline { grid-template-columns: 1fr; padding-left: 1.5rem; }
  .split-timeline::before { left: 5px; }
  .st-item[data-side="left"],
  .st-item[data-side="right"] { grid-column: 1; text-align: left; }
  .st-item[data-side="left"] .cv-links { justify-content: flex-start; }
  .st-item[data-side="left"]::before,
  .st-item[data-side="right"]::before { left: calc(-1.5rem + 1px); right: auto; }
  .split-shelf { grid-template-columns: 1fr; row-gap: 0.75rem; }
  .split-shelf::before { display: none; }
  .hall-card { grid-template-columns: 1fr; }
  .side-layout { grid-template-columns: 1fr; }
  .side-aside { position: static; max-height: none; overflow: visible; order: -1; }
}

/* right monitor: the stage select */
.pb-nav {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.5rem;
  text-transform: uppercase;
  color: var(--neon-text);
}
.pb-nav-title {
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(111, 231, 255, 0.7);
  margin-bottom: 0.2rem;
}
.pb-nav a {
  font-size: 1.05rem;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0 0.8rem;
  border: 2px solid transparent;
  border-radius: 6px;
  transition: color 0.2s, border-color 0.2s, text-shadow 0.2s;
}
.pb-nav a:hover,
.pb-nav a:focus-visible,
.pb-nav a.is-current {
  color: var(--neon-orange);
  border-color: var(--neon-orange);
  text-shadow: 0 0 8px rgba(255, 140, 40, 0.8);
  box-shadow: 0 0 12px rgba(255, 140, 40, 0.4), inset 0 0 12px rgba(255, 140, 40, 0.25);
}
.pb-help, .pb-hiscore {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--neon-muted);
  margin-top: 0.35rem;
}
.pb-help b { color: var(--neon-text); }
.pb-hiscore { margin-top: 0; color: var(--neon-pink); text-shadow: 0 0 6px rgba(255, 95, 210, 0.6); }

/* ----- Hotspots on the photo ----- */
.pb-hot {
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.pb-hot:focus-visible { outline: 2px solid var(--neon-orange); outline-offset: 2px; }
/* the photo's own buttons: text is drawn in the photo, we add the glow */
.pb-btn {
  color: transparent;
  font-size: 0;
  transition: box-shadow 0.2s, background 0.2s;
}
.pb-btn:hover,
.pb-btn:focus-visible {
  background: rgba(255, 176, 74, 0.08);
  box-shadow: 0 0 18px rgba(255, 176, 74, 0.55), inset 0 0 12px rgba(255, 176, 74, 0.35);
}
.pb-btn:active { background: rgba(255, 176, 74, 0.2); }
.pb-btn[data-spot="play"] { animation: pbPulse 2.4s ease-in-out infinite; }
@keyframes pbPulse {
  50% { box-shadow: 0 0 22px rgba(255, 176, 74, 0.6), inset 0 0 10px rgba(255, 176, 74, 0.3); }
}
.pb-hot[data-spot="menu"]:hover { background: rgba(255, 255, 255, 0.08); }

/* backglass message panel (covers the printed one while you play) */
.pb-backglass {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.8rem, 1.6vw, 1.6rem);
  color: var(--neon-orange);
  text-shadow: 0 0 8px rgba(255, 140, 40, 0.7);
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.pb-backglass.is-on { opacity: 1; background: #2a1414; }

.pb-score {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-weight: 700;
  font-size: clamp(0.7rem, 1.45vw, 1.5rem);
  letter-spacing: 0.02em;
  color: #fff2f7;
  text-shadow: 0 0 6px rgba(255, 140, 220, 0.9), 0 0 14px rgba(255, 95, 210, 0.6);
  pointer-events: none;
  white-space: nowrap;
}

/* ----- Hamburger menu ----- */
.pb-menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(8, 6, 20, 0.88);
  backdrop-filter: blur(6px);
}
.pb-menu[hidden] { display: none; }
.pb-menu a {
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neon-text);
}
.pb-menu a:hover,
.pb-menu a.is-current { color: var(--neon-orange); text-shadow: 0 0 12px rgba(255, 140, 40, 0.8); }
.pb-menu-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--neon-text);
  background: none;
  border: 0;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .pb-photo { transform: none; }
  .pb-btn[data-spot="play"] { animation: none; }
}

/* Phones: the table on top, the page in a glowing panel below */
@media (max-width: 768px) {
  .pb-photo { transform: none; animation: none; }
  .pb-monitor-left {
    position: fixed;
    left: 0.5rem;
    right: 0.5rem;
    top: calc(var(--pb-table-h, 50vh) + 0.5rem);
    bottom: 3.2rem;
    border: 2px solid rgba(185, 160, 255, 0.45);
    border-radius: 10px;
  }
  .pb-shell .pb-photo .pb-monitor-left { position: fixed; }
}

/* Scenes that hide the sidebar take back its space on the right */
html[data-bg="cosmos"] .site-wrapper,
html[data-bg="gameboy"] .site-wrapper,
html[data-bg="pinball"] .site-wrapper { padding-right: 0; }
html[data-bg="cosmos"] .bg-picker,
html[data-bg="gameboy"] .bg-picker,
html[data-bg="pinball"] .bg-picker { right: 1rem; }
@media (max-width: 768px) {
  .bg-picker { right: 0.5rem; }
}

/* Bookshelf: finished books as a timeline, first list on the shelf */
.read-line .fact-line { --lane: var(--aqua); }
.read-line .fact-body.book { padding: 0.5rem 0.8rem; }
.read-line .fact-line > li .fact-date { font-size: 0.95rem; padding-top: 0.45rem; }

/* ----- Cosmos mode (default): the page floats in a glass panel over
   Andre's astronaut illustration. bg3d.js draws the picture in layers
   on #bg3d-canvas, sizes .cs-sky to it and pins the sparkle links on. */
html[data-bg="cosmos"] body {
  overflow: hidden;
  background: #120e26 url(../assets/backgrounds/cosmos/tiny.jpg) center / cover fixed;
}
html[data-bg="cosmos"] .sidebar,
html[data-bg="cosmos"] .mobile-nav,
html[data-bg="cosmos"] .mobile-menu { display: none !important; }

.cs-shell {
  --cs-text: #f3eeff;
  --cs-muted: #bdb3dc;
  --cs-gold: #ffc98e;
  --cs-pink: #ee96dc;
  --cs-glass: rgba(16, 12, 38, 0.58);
  --cs-line: rgba(214, 196, 255, 0.22);
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  font-family: 'Quicksand', var(--font-sans);
  color: var(--cs-text);
}

/* sparkle links, in the picture's coordinates */
.cs-sky { position: absolute; pointer-events: none; }
.cs-mark {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transform: translate(-1.4rem, -50%);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--cs-text);
  text-decoration: none;
  text-shadow: 0 1px 8px rgba(10, 6, 30, 0.9);
  pointer-events: auto;
}
.cs-mark-star {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: radial-gradient(circle, rgba(255, 240, 220, 0.22), rgba(120, 100, 200, 0.12) 60%, transparent 72%);
  box-shadow: 0 0 18px rgba(200, 170, 255, 0.35);
  transition: transform 0.4s cubic-bezier(.2, .8, .2, 1), box-shadow 0.4s;
}
.cs-mark-star::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 220, 190, 0.35);
  animation: csRing 3.2s ease-out infinite;
}
.cs-mark:nth-child(2) .cs-mark-star::before { animation-delay: -0.8s; }
.cs-mark:nth-child(3) .cs-mark-star::before { animation-delay: -1.6s; }
.cs-mark:nth-child(4) .cs-mark-star::before { animation-delay: -2.4s; }
.cs-mark svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: #fff6ea;
  filter: drop-shadow(0 0 6px rgba(255, 230, 200, 0.95));
  animation: csTwinkle 2.6s ease-in-out infinite;
}
.cs-mark:hover .cs-mark-star,
.cs-mark:focus-visible .cs-mark-star {
  transform: scale(1.15) rotate(45deg);
  box-shadow: 0 0 30px rgba(255, 200, 150, 0.6);
}
.cs-mark:focus-visible { outline: none; }
.cs-mark:focus-visible .cs-mark-label { text-decoration: underline; }
.cs-mark.is-current .cs-mark-star { border-color: var(--cs-gold); }
.cs-mark.is-current .cs-mark-label { color: var(--cs-gold); }
@keyframes csRing {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes csTwinkle {
  50% { transform: scale(0.8) rotate(12deg); opacity: 0.75; }
}

/* header like the design: name left, pages right */
.cs-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem clamp(1rem, 4vw, 4rem);
  pointer-events: none;
}
.cs-header > * { pointer-events: auto; }
.cs-name {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--cs-text);
  text-decoration: none;
  text-shadow: 0 1px 10px rgba(10, 6, 30, 0.8);
}
.cs-nav { display: flex; gap: 2.2rem; margin-right: 7rem; }
.cs-nav a,
.cs-menu a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--cs-text);
  text-decoration: none;
  text-transform: capitalize;
  text-shadow: 0 1px 8px rgba(10, 6, 30, 0.9);
  transition: color 0.2s;
}
.cs-nav a:hover,
.cs-nav a.is-current,
.cs-menu a.is-current { color: var(--cs-gold); }
.cs-menu-btn {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid var(--cs-line);
  background: rgba(16, 12, 38, 0.45);
  backdrop-filter: blur(8px);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.cs-menu-btn span { width: 1rem; height: 1.5px; background: var(--cs-text); transition: transform 0.25s; }
.cs-shell.is-menu .cs-menu-btn span:first-child { transform: translateY(3.25px) rotate(45deg); }
.cs-shell.is-menu .cs-menu-btn span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
.cs-menu {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  background: rgba(12, 8, 30, 0.82);
  backdrop-filter: blur(10px);
}
.cs-menu[hidden] { display: none; }
.cs-menu a { font-size: 1.8rem; }

/* the page itself, in glass */
.cs-panel {
  position: absolute;
  z-index: 1;
  left: clamp(1rem, 4vw, 4.5rem);
  top: 6.2rem;
  bottom: 1.5rem;
  width: min(560px, 42vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 22px;
  border: 1px solid var(--cs-line);
  background: linear-gradient(160deg, rgba(30, 22, 64, 0.62), var(--cs-glass));
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  box-shadow: 0 20px 60px rgba(4, 2, 16, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 196, 255, 0.35) transparent;
  /* reuses the pinball phone-layout rules for the narrow panel */
  container: pb / inline-size;
}

.cs-panel .main-content {
  margin: 0;
  max-width: none;
  padding: 1.6rem 1.6rem 2.5rem;
  animation: none;
  --bg: transparent;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-hover: rgba(255, 255, 255, 0.09);
  --border: var(--cs-line);
  --text: var(--cs-text);
  --muted: var(--cs-muted);
  --accent: var(--cs-gold);
  --accent-dim: rgba(255, 201, 142, 0.14);
  --accent-glow: rgba(238, 150, 220, 0.3);
  --green: #9fe3c8;
  --lilac: #cdb8ff;
  --sky: #9fd3ff;
  --aqua: #8ff0e0;
  --font-display: 'Quicksand', sans-serif;
  --font-sans: 'Quicksand', sans-serif;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--text);
}
.cs-panel .hero-name,
.cs-panel h1,
.cs-panel h2 {
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cs-text);
}
.cs-panel .hero-name { font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.08; }
.cs-panel .hero-tagline {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cs-muted);
}
.cs-panel .section-label { color: var(--cs-pink); }
.cs-panel .main-content :is(.highlight-card, .tl-card, .lab-card):hover {
  border-color: rgba(255, 201, 142, 0.55);
  box-shadow: 0 0 22px rgba(238, 150, 220, 0.22);
}


@media (max-width: 1100px) {
  .cs-nav { gap: 1.4rem; margin-right: 0; }
}

/* Phones: the picture on top, the page in a sheet below */
@media (max-width: 768px) {
  html[data-bg="cosmos"] body { background-attachment: scroll; }
  .cs-header { padding: 0.9rem 1rem; }
  .cs-name { font-size: 1.05rem; }
  .cs-nav { display: none; }
  .cs-menu-btn { display: flex; }
  .cs-sky { display: none; }
  .cs-panel {
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    top: calc(var(--cs-scene-h, 44vh) - 1.2rem);
    bottom: 3rem;
    border-radius: 20px;
  }
  .cs-panel .main-content { padding: 1.2rem 1.1rem 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-mark svg,
  .cs-mark-star::before { animation: none; }
}

/* Moving between pages: a soft crossfade instead of a hard cut
   (browsers without cross-document view transitions just swap) */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
  animation-timing-function: ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ----- The Archive (journey.html): old projects as a card grid ----- */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.archive-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--lane);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--transition), transform var(--transition);
}

a.archive-card:hover { border-color: var(--lane); transform: translateY(-2px) rotate(-0.4deg); }

.archive-card .tl-kind { color: var(--lane); }
.archive-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.archive-desc { color: var(--muted); font-size: 0.88rem; line-height: 1.5; flex: 1; }

.archive-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.archive-status {
  border: 1px dashed var(--lane);
  color: var(--lane);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.archive-open { color: var(--muted); }
a.archive-card:hover .archive-open { color: var(--lane); }

.archive-card.placeholder { border-style: dashed; border-top-style: solid; opacity: 0.6; }
