:root {
  --bg: #090a0f;
  --bg-gradient: linear-gradient(135deg, #04050a 0%, #0b0c12 50%, #11131a 100%);
  --fg: #e8e8e8;
  --muted: #a0a0a0;
  --accent1: #4fc3f7;
  --accent2: #ef5350;
  --accent3: #66bb6a;
  --card: rgba(40, 40, 40, 0.9);
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

html {
  min-height: 100%;
  background: var(--bg-gradient);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  background: transparent;
  color: var(--fg);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

a {
  color: inherit;
}

canvas#physics-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -2;
  opacity: 0.3;
}

.hero {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem 3rem;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(17, 18, 20, 0.6), rgba(17, 18, 20, 0.1));
  padding: 0 2rem;
  border-radius: 0;
  box-shadow: none;
  border: none;
  backdrop-filter: none;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 3rem);
  margin: 0 0 0.5rem;
  font-weight: 400;
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 1px solid var(--border);
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
}

.pill-button[data-primary="true"] {
  background: var(--accent1);
  border-color: var(--accent1);
  color: #0e1726;
  font-weight: 600;
}

.pill-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
}

.pill-button[data-primary="true"]:hover {
  filter: brightness(1.05);
}

.pill-button.is-active {
  background: rgba(79, 195, 247, 0.15);
  border-color: rgba(79, 195, 247, 0.45);
  color: var(--fg);
  box-shadow: 0 0 0 1px rgba(79, 195, 247, 0.15);
}

.pill-button.is-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--fg);
}

.pill-button.is-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.pill-button:focus-visible {
  outline: 2px solid rgba(79, 195, 247, 0.6);
  outline-offset: 2px;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.view-section {
  display: none;
  padding-top: 1.5rem;
}

.view-section.is-active {
  display: block;
  animation: viewFade 0.55s ease;
}

.view-section .section-heading:first-of-type {
  margin-top: 0;
}

.landing-overview {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.landing-overview > .section-heading {
  margin-bottom: 0;
}

.landing-overview > p {
  margin: 0;
  color: var(--muted);
  max-width: 1000px;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.highlight-card {
  background: var(--card);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.highlight-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  color: var(--accent1);
}

.panel-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--card);
  padding: 1.5rem 1.65rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card h3 {
  margin: 0 0 0.4rem;
  font-weight: 500;
  color: var(--accent1);
}

.card p {
  margin: 0 0 0.9rem;
  color: var(--muted);
}

.card a {
  color: var(--accent1);
  text-decoration: none;
  font-weight: 500;
}

/* Accordion Panels */
.accordion-panels {
  display: flex;
  gap: 0.5rem;
  height: 280px;
  margin-top: 1.5rem;
}

.accordion-panel {
  position: relative;
  flex: 0 0 60px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: flex 0.4s ease, background 0.3s ease, transform 0.2s ease;
}

.accordion-panel:hover,
.accordion-panel.is-active {
  flex: 1 1 400px;
  background: rgba(50, 50, 50, 0.95);
  animation: panel-pulse 1.5s ease-in-out infinite;
}

.accordion-panel:hover {
  transform: scale(1.02);
}

@keyframes panel-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(79, 195, 247, 0);
  }
  50% {
    box-shadow: 0 0 12px 2px rgba(79, 195, 247, 0.25);
  }
}

.accordion-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  white-space: nowrap;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent1);
  margin: 0;
  transition: opacity 0.2s ease, transform 0.3s ease;
  pointer-events: none;
}

.accordion-panel:hover .accordion-title,
.accordion-panel.is-active .accordion-title {
  opacity: 0;
  transform: translate(-50%, -100%) rotate(90deg);
}

.accordion-content {
  position: absolute;
  inset: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
  pointer-events: none;
}

.accordion-panel:hover .accordion-content,
.accordion-panel.is-active .accordion-content {
  opacity: 1;
  pointer-events: auto;
}

.accordion-content-title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent1);
}

.accordion-content p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.5;
}

.accordion-content .pill-button {
  align-self: flex-start;
}

.highlight-card .pill-button,
.card .pill-button {
  margin-top: 0.75rem;
}

.detail-card .card-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0.55rem 0.9rem;
  margin-top: 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.detail-card .card-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(79, 195, 247, 0.45);
  color: var(--fg);
  transform: translateY(-3px);
}

.card a:hover {
  text-decoration: underline;
}


.card button.card-link:focus-visible {
  outline: 2px solid rgba(79, 195, 247, 0.6);
  outline-offset: 2px;
}
.contact-card {
  display: grid;
  gap: 0.8rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  background: rgba(10, 12, 18, 0.7);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: rgba(79, 195, 247, 0.6);
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.15);
}

.contact-form .form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.contact-form .form-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.contact-form.is-sent {
  display: none;
}

.form-success {
  text-align: center;
  color: #66bb6a;
  padding: 2rem 1rem;
  font-size: 1.05rem;
}

.form-error {
  text-align: center;
  color: #ef5350;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.contact-links {
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.contact-links-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.page-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
}

.build-notes .page-header {
  display: block;
}

.build-notes .header-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: nowrap;
}

.build-notes .header-row h1 {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.build-notes .site-nav {
  flex: 0 0 auto;
  margin-left: auto;
}

.page-header .header-row {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header h1 {
  margin-bottom: 0.35rem;
}

.site-nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.site-nav.site-nav-inline {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.site-nav a {
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  transition: all 0.2s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.page-intro {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}

.build-notes .page-intro {
  color: var(--fg);
}

.build-notes p {
  color: var(--muted);
}

.build-notes.ronin-notes .page-intro {
  color: var(--muted);
}

.build-notes.ronin-notes .detail-table {
  color: var(--muted);
}

.build-notes.ronin-notes .detail-table th {
  color: var(--muted);
}

.build-notes.ronin-notes .detail-table code {
  color: var(--muted);
}

.build-notes.ronin-notes .mermaid text,
.build-notes.ronin-notes .mermaid svg text,
.build-notes.ronin-notes .mermaid .label {
  fill: var(--muted) !important;
  color: var(--muted) !important;
}

.build-notes.dry-cleaning-notes .page-intro {
  color: var(--muted);
}

.build-notes.wireless-timecode-notes .page-intro {
  color: var(--muted);
}

.build-notes.wireless-timecode-notes .detail-table {
  color: var(--muted);
}

.build-notes.wireless-timecode-notes .detail-table code {
  color: var(--muted);
}

.build-notes.router-notes .page-intro {
  color: var(--muted);
}

.build-notes.canon-ccu-notes .page-intro {
  color: var(--muted);
}

.build-notes.canon-ccu-notes .page-intro + .page-intro {
  margin-top: 0.9rem;
}

.build-notes.zoom-notes .page-intro {
  color: var(--muted);
}


.section-heading {
  font-size: 1.35rem;
  margin: 3.5rem 0 1rem;
  font-weight: 500;
}

.list-grid {
  display: grid;
  gap: 1.35rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.list-grid.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.credit-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.credit-list li {
  margin-bottom: 0.45rem;
}

.credit-list-columns {
  columns: 2;
  column-gap: 1.5rem;
}

.credit-list-columns li {
  break-inside: avoid;
}

.detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.75rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.detail-card.panel-free {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  padding: 1.25rem;
}

.simple-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.75rem;
}

.simple-columns.two-col {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.simple-columns h3 {
  margin: 0 0 0.5rem;
  color: var(--accent1);
  font-size: 1.05rem;
}

.simple-columns .credit-list {
  padding-left: 1rem;
}

.credit-lines {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.credit-lines p {
  margin: 0;
  color: var(--muted);
}

.timeline-subentry {
  position: relative;
  display: block;
  padding-left: 0;
  color: var(--muted);
}

.timeline-subentry::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.5rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent1);
  opacity: 0.35;
}

.timeline-subentry .subdate {
  position: absolute;
  left: calc(-10rem - 2rem);
  width: 10rem;
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  top: 0.15rem;
}

.timeline-subentry .subtext {
  color: var(--muted);
}


.detail-card h3 {
  margin-top: 0;
  color: var(--accent1);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-card h3.edu-compact {
  font-size: 1.05rem;
}

.detail-card h3 .role-title {
  color: var(--accent1);
  font-weight: 500;
}

.detail-card h3 .role-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
  white-space: nowrap;
  text-align: right;
}

.view-section[data-view="engineering"] .list-grid.grid-3 .detail-card {
  display: flex;
  flex-direction: column;
}

.language-block {
  margin-top: auto;
}

.language-bar {
  margin-top: 1rem;
  height: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.lang-segment {
  height: 100%;
  display: block;
}

.language-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.1rem;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.build-notes-image {
  width: 100%;
  height: auto;
  max-width: 720px;
  margin: 0 auto;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: var(--fg);
}

.detail-table th,
.detail-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

.detail-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.detail-table code {
  color: var(--accent1);
}

.lang-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.lang-cpp { background: #f34b7d; }
.lang-c { background: #555555; }
.lang-html { background: #e34c26; }
.lang-python { background: #3572a5; }
.lang-tex { background: #3d6117; }
.lang-other { background: #6c757d; }
.lang-swift { background: #f05138; }
.lang-shell { background: #89e051; }
.lang-dtrace { background: #b2b7f8; }

.detail-card h3 .role-time {
  margin-left: 0.5rem;
  color: var(--muted);
}

.list-grid.grid-3 .detail-card h3 {
  font-size: 1rem;
  white-space: nowrap;
}

@keyframes subtle-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes spark-travel {
  0% {
    offset-distance: 0%;
  }
  100% {
    offset-distance: 100%;
  }
}

@keyframes border-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(79, 195, 247, 0);
  }
  50% {
    box-shadow: 0 0 15px 3px rgba(79, 195, 247, 0.35);
  }
}

.flip-card {
  perspective: 1200px;
  position: relative;
  animation: subtle-float 3s ease-in-out infinite;
}

/* The wire - static dim border */
.flip-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 1px solid rgba(79, 195, 247, 0.25);
  pointer-events: none;
}

/* All flip cards: The spark - follows the rectangular border with a tail */
.flip-card:not(.flip-card-glow)::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(79, 195, 247, 0.04) 35%,
    rgba(79, 195, 247, 0.12) 60%,
    rgba(79, 195, 247, 0.25) 80%,
    rgba(255, 255, 255, 0.45) 100%
  );
  border-radius: 999px;
  offset-path: inset(0 round 12px);
  offset-anchor: 100% 50%;
  offset-rotate: auto;
  animation: spark-travel 14s linear infinite;
  pointer-events: none;
  filter: blur(2px);
  opacity: 0.7;
}

/* Force glow effect on specific cards */
.flip-card-glow::before {
  animation: border-glow 3s ease-in-out infinite !important;
}

.flip-card-glow::after {
  display: none !important;
}

.flip-card-glow:nth-child(1)::before {
  animation-delay: 0s;
}

.flip-card-glow:nth-child(2)::before {
  animation-delay: 0.5s;
}

.flip-card-glow:nth-child(3)::before {
  animation-delay: 1s;
}

.flip-card-glow:hover::before {
  animation-play-state: paused;
  box-shadow: 0 0 18px 4px rgba(79, 195, 247, 0.45);
}

.flip-card:nth-child(2) {
  animation-delay: 0.5s;
}
.flip-card:nth-child(2)::after {
  animation-delay: -0.5s;
}

.flip-card:nth-child(3) {
  animation-delay: 1s;
}
.flip-card:nth-child(3)::after {
  animation-delay: -1s;
}

.flip-card:nth-child(4) {
  animation-delay: 1.5s;
}
.flip-card:nth-child(4)::after {
  animation-delay: -1.5s;
}

.flip-card:nth-child(5) {
  animation-delay: 2s;
}
.flip-card:nth-child(5)::after {
  animation-delay: -2s;
}

.flip-card:nth-child(6) {
  animation-delay: 2.5s;
}
.flip-card:nth-child(6)::after {
  animation-delay: -2.5s;
}

.flip-card:hover {
  animation-play-state: paused;
}

.flip-card:not(.flip-card-glow):hover::after {
  animation-duration: 3s;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  display: grid;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  backface-visibility: hidden;
  grid-area: 1 / 1;
}

.flip-card-front {
  transform: rotateY(0deg);
}

.flip-card-back {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  height: 100%;
}

.flip-card-front .detail-card,
.flip-card-back .detail-card {
  height: 100%;
}


.view-section[data-view="engineering"] .list-grid.grid-3 {
  align-items: stretch;
}

.view-section[data-view="engineering"] .list-grid.grid-3 .flip-card {
  height: 100%;
}

.view-section[data-view="engineering"] .list-grid.grid-3 .detail-card {
  display: flex;
  flex-direction: column;
}


.flip-card-backside {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
}

.flip-card-backside h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--accent1);
}

.flip-card-backside .diagram-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  flex: 1;
  object-fit: contain;
}

.flip-card-backside .mermaid {
  margin: 0.75rem 0 1rem;
  max-width: 100%;
}

.flip-card-backside .card-dates {
  margin: 0.75rem 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.flip-card-backside .card-link {
  margin-top: auto;
}

.backside-image-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.75rem 0;
}

.backside-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  flex: 1;
  object-fit: cover;
  margin: 0.75rem 0;
}

.detail-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.body-text {
  color: var(--muted);
}

.detail-meta.meta-location {
  display: block;
  margin-top: -0.4rem;
  margin-bottom: 0.25rem;
}

.detail-meta.meta-location::before {
  content: '';
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.25rem;
  vertical-align: -0.05em;
  background: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.detail-meta .meta-location {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.6rem;
}

.detail-meta .meta-location::before {
  content: '';
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  vertical-align: -0.05em;
  background: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.detail-meta .meta-time-inline {
  font-weight: 500;
  color: var(--muted);
}

.education-desc {
  margin: 0;
  color: var(--fg);
}

.role-meta .meta-location {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.4rem;
}

.role-meta .meta-location::before {
  content: '';
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  vertical-align: -0.05em;
  background: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.detail-meta.meta-time {
  display: block;
  gap: 0;
  margin-top: -0.15rem;
}

.detail-meta .meta-primary {
  font-weight: 500;
}

.detail-meta .meta-secondary::before {
  content: '•';
  margin: 0 0.35rem;
  color: var(--muted);
}

/* ── Timeline ── */

.timeline {
  display: grid;
  gap: 1.35rem;
  position: relative;
}

.timeline::after {
  content: '';
  position: absolute;
  left: calc(10rem + 0.75rem);
  top: 1rem;
  bottom: 1rem;
  width: 1px;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.timeline::before {
  content: '';
  position: absolute;
  right: calc(10rem + 0.75rem);
  top: 1rem;
  bottom: 1rem;
  width: 1px;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 10rem 1fr 10rem;
  gap: 2rem;
  align-items: start;
  position: relative;
  padding: 0.4rem 0 1.6rem;
}


.timeline-entry:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}


.timeline-location {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: left;
  position: relative;
  padding-left: 0;
  padding-top: 1.25rem;
  line-height: 1.2;
}

.timeline-content {
  padding-top: 1.1rem;
}

.timeline-content h3 {
  margin-top: 0;
  color: var(--accent1);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 1.05rem;
  font-weight: 600;
}


.timeline-content p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: none;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: calc(10rem + 0.75rem);
  top: 2.2rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent1);
  opacity: 0.4;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.timeline-entry::after {
  content: '';
  position: absolute;
  right: calc(10rem + 0.75rem);
  top: 2.2rem;
  width: 12px;
  height: 12px;
  background: rgba(79, 195, 247, 0.55);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transform: translate(50%, -50%);
  pointer-events: none;
}

.timeline-entry.no-location-pin::after {
  display: none;
}

.timeline-entry.no-location-pin::before {
  top: 4.15rem;
}

.timeline-entry.subdots-only::before {
  display: none;
}


.timeline-date {
  font-size: 0.85rem;
  color: var(--muted);
  padding-top: 1.25rem;
  white-space: nowrap;
  text-align: right;
}

.timeline-entry.no-location-pin .timeline-date {
  padding-top: 3.1rem;
}

.timeline-entry.no-location-pin .timeline-content {
  padding-top: 3.1rem;
}

.timeline .detail-card {
  margin: 0;
}

footer {
  text-align: center;
  padding: 1.25rem 0 2rem;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 4rem;
}

footer a {
  color: var(--accent1);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ── Film reel ── */

.film-reel {
  position: relative;
  margin-bottom: 2.5rem;
  overflow: visible;
  clip-path: inset(-200px 0);
  background: #111;
  border-radius: 6px;
  box-shadow: var(--shadow);
  cursor: grab;
}

.film-reel::before,
.film-reel::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3rem;
  z-index: 10;
  pointer-events: none;
}

.film-reel::before {
  left: 0;
  background: linear-gradient(to right, #111 0%, transparent 100%);
  border-radius: 6px 0 0 6px;
}

.film-reel::after {
  right: 0;
  background: linear-gradient(to left, #111 0%, transparent 100%);
  border-radius: 0 6px 6px 0;
}

.film-reel-perf {
  position: relative;
  z-index: 1;
  height: 24px;
  background-color: #1a1a1a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='24'%3E%3Crect x='18' y='5' width='20' height='14' rx='2.5' fill='%23090a0f'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 56px 24px;
}

.film-reel-track {
  position: relative;
  z-index: 2;
  overflow: visible;
  padding: 4px 0;
  background: #1a1a1a;
}

.film-reel-slides {
  display: flex;
  gap: 4px;
  width: max-content;
  animation: filmScroll 40s linear infinite;
}

.film-reel-frame {
  position: relative;
  width: 240px;
  height: 136px;
  flex-shrink: 0;
  overflow: hidden;
  background: #2a2a2a;
  border-radius: 2px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.film-reel-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
  transform-origin: center;
}

.film-reel-frame:hover {
  transform: scale(2.5);
  z-index: 2;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.film-reel-frame:hover img {
  transform: scale(1.02);
}

.film-reel-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 8px;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 30%),
    linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 30%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.film-reel-frame:hover .film-reel-caption {
  opacity: 1;
}

.film-reel-caption-title {
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.film-reel-caption-meta {
  color: rgba(255, 255, 255, 0.85);
  font-size: 9px;
  font-weight: 400;
}

@keyframes filmScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .film-reel-slides {
    animation-play-state: paused;
  }

  body,
  body.page-exit {
    animation: none;
  }
}

@keyframes viewFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Page transitions ── */

body {
  animation: pageEnter 0.4s ease both;
}

body.page-exit {
  animation: pageExit 0.35s ease both;
}

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

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

@media (max-width: 900px) {
  .list-grid.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .list-grid.grid-3 .detail-card h3 {
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 3.5rem 1.35rem 2.5rem;
  }

  .hero::after {
    inset: 1.25rem;
  }

  main {
    padding: 0 1.35rem 3.5rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 2.75rem 1.35rem 1.25rem;
  }

  .site-nav {
    gap: 0.45rem;
  }

  .timeline::after,
  .timeline-entry::before {
    display: none;
  }

  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .timeline-date {
    text-align: left;
    padding-top: 0;
    padding-bottom: 0.35rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE / TOUCH DEVICE STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Touch devices - disable hover-dependent features */
@media (hover: none) {
  /* Accordion panels - vertical stack, tap to expand */
  .accordion-panels {
    flex-direction: column;
    height: auto;
    gap: 0.75rem;
  }

  .accordion-panel {
    flex: none;
    min-height: 60px;
    transition: min-height 0.3s ease, background 0.3s ease;
  }

  .accordion-panel.is-active {
    min-height: 180px;
  }

  .accordion-panel:hover {
    transform: none;
    animation: none;
  }

  .accordion-panel.is-active {
    animation: panel-pulse 1.5s ease-in-out infinite;
  }

  .accordion-title {
    transform: translate(-50%, -50%);
    writing-mode: horizontal-tb;
  }

  .accordion-panel.is-active .accordion-title {
    opacity: 0;
  }

  /* Flip cards - tap to flip */
  .flip-card:hover .flip-card-inner {
    transform: none;
  }

  .flip-card.is-flipped .flip-card-inner {
    transform: rotateY(180deg);
  }

  .flip-card:hover {
    transform: none;
  }

  .flip-card:hover::after {
    opacity: 0.7;
  }

  /* Film reel - always show captions */
  .film-reel-caption {
    opacity: 1;
  }

  .film-reel-frame:hover img {
    transform: none;
  }

  .film-reel-frame img {
    clip-path: none;
  }
}

/* Small screens - layout adjustments */
@media (max-width: 600px) {
  .accordion-panels {
    flex-direction: column;
    height: auto;
    gap: 0.75rem;
  }

  .accordion-panel {
    flex: none;
    min-height: 55px;
  }

  .accordion-panel.is-active {
    min-height: 160px;
  }

  .accordion-title {
    transform: translate(-50%, -50%);
    writing-mode: horizontal-tb;
    font-size: 1rem;
  }

  .accordion-content-title {
    font-size: 1.15rem;
  }

  .accordion-content p {
    font-size: 0.95rem;
  }

  /* Film reel adjustments */
  .film-reel {
    margin: 0 -1.35rem;
    width: calc(100% + 2.7rem);
  }

  .film-reel-frame {
    width: 200px;
    height: 133px;
  }

  .film-reel-caption {
    opacity: 1;
    padding: 3px;
  }

  .film-reel-caption-title {
    font-size: 0.7rem;
  }

  .film-reel-caption-meta {
    font-size: 0.55rem;
  }

  /* Flip cards - single column */
  .list-grid.grid-3 {
    grid-template-columns: 1fr;
  }

  .flip-card {
    animation: none;
  }

  /* Hero adjustments */
  .hero h1 {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .pill-button {
    text-align: center;
  }

  /* Section headings */
  .section-heading {
    font-size: 1.35rem;
  }

  /* Featured projects grid */
  .featured-grid {
    grid-template-columns: 1fr;
  }

  /* Detail cards */
  .detail-card {
    padding: 1rem;
  }

  /* Particles - reduce count on mobile via JS, hide trails */
  #physics-canvas {
    opacity: 0.4;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .hero h1 {
    font-size: 1.7rem;
  }

  .hero-subtitle {
    font-size: 0.85rem;
  }

  .accordion-panel.is-active {
    min-height: 180px;
  }

  .accordion-content p {
    font-size: 0.9rem;
  }

  .film-reel-frame {
    width: 160px;
    height: 107px;
  }
}
