/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow: hidden;
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0b;
  color: #e4e4e7;
  -webkit-font-smoothing: antialiased;
}

/* ===== App Container ===== */
.app {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ===== Scroll Hint ===== */
.scroll-hint {
  position: fixed;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.05em;
  animation: fadeHint 4s ease-out forwards;
  pointer-events: none;
}

.scroll-hint.hidden {
  display: none;
}

/* ===== Timeline Progress Bar ===== */
.timeline-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.75rem 1.5rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(10, 10, 11, 0.92) 0%, rgba(10, 10, 11, 0.7) 70%, transparent 100%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.timeline-progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.timeline-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #7dd3ff);
  border-radius: 2px;
  width: 0%;
  transition: width 0.15s ease-out;
}

.timeline-progress-years {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.6rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.05em;
}

/* ===== Year of the Dragon (2000) ===== */
.year-section-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.dragon-ornament {
  position: absolute;
  top: 1rem;
  right: 15%;
  font-size: 2.5rem;
  line-height: 1;
  opacity: 0.7;
  animation: dragonFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.4));
}

@keyframes dragonFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.6; }
  50% { transform: translateY(-6px) scale(1.05); opacity: 0.8; }
}

/* ===== Device Boot Animation ===== */
.device-screen-content,
.device-screen {
  opacity: 0;
}

.year-section.visible .device-screen-content,
.year-section.visible .device-screen {
  animation: deviceBoot 0.5s ease-out forwards;
}

@keyframes deviceBoot {
  from {
    opacity: 0;
    filter: brightness(0.4);
  }
  to {
    opacity: 1;
    filter: brightness(1);
  }
}

/* ===== Portfolio Nodes ===== */
.portfolio-nodes {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.portfolio-nodes:empty {
  display: none;
}

.portfolio-node {
  font-size: 0.75rem;
  font-weight: 500;
  color: #a855f7;
  text-decoration: none;
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 0.35rem 0.6rem;
  border-radius: 0.35rem;
  transition: all 0.2s ease;
}

.portfolio-node:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.5);
  color: #c4b5fd;
}

.portfolio-node--static {
  cursor: default;
  opacity: 0.85;
}

.portfolio-node--static:hover {
  background: transparent;
  border-color: rgba(168, 85, 247, 0.3);
  color: #a855f7;
}

@keyframes fadeHint {
  0%, 60% { opacity: 1; }
  100% { opacity: 0; }
}

/* ===== Horizontal Timeline ===== */
.timeline {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  height: 100vh;
  height: 100dvh;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

/* Hide scrollbar but keep functionality */
.timeline::-webkit-scrollbar {
  display: none;
}

.timeline {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ===== Year Sections ===== */
.year-section {
  flex: 0 0 100%;
  min-width: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

@media (min-width: 768px) {
  .year-section {
    flex: 0 0 100%;
    min-width: 100%;
  }
}

/* ===== Device Frame Base ===== */
.device-frame {
  position: relative;
  border-radius: 1.5rem;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 100px -20px rgba(168, 85, 247, 0.15);
  overflow: hidden;
  max-width: 100%;
  max-height: 80vh;
}

.device-label {
  position: absolute;
  top: -1.75rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 10;
}

.device-screen {
  background: #18181b;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.screen-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.year-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: #a855f7;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  background: rgba(168, 85, 247, 0.15);
  border-radius: 0.25rem;
  width: fit-content;
}

.screen-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fafafa;
  line-height: 1.3;
}

.screen-content p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

.screen-content .vibe {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

/* ===== PRESET: Nokia (green LCD, pixelated) ===== */
[data-preset="nokia"] .device-screen,
[data-preset="nokia"] .device-screen-content {
  background: #0a1612 !important;
  color: #52b788 !important;
  -webkit-font-smoothing: none;
}

[data-preset="nokia"] .screen-content,
[data-preset="nokia"] .screen-content h2,
[data-preset="nokia"] .screen-content p,
[data-preset="nokia"] .screen-content .vibe {
  color: #52b788 !important;
  font-family: 'VT323', monospace !important;
  font-weight: 400;
}

[data-preset="nokia"] .screen-content h2 {
  font-size: clamp(0.6rem, 2.5vh, 1rem);
  letter-spacing: 0.02em;
}

[data-preset="nokia"] .screen-content p {
  font-size: clamp(0.45rem, 2vh, 0.75rem);
  line-height: 1.4;
}

[data-preset="nokia"] .screen-content .vibe {
  font-size: clamp(0.4rem, 1.8vh, 0.65rem);
}

[data-preset="nokia"] .year-badge {
  background: rgba(82, 183, 136, 0.2) !important;
  color: #74c69d !important;
  font-family: 'VT323', monospace !important;
  font-size: clamp(0.5rem, 2vh, 0.8rem) !important;
}

/* ===== PRESET: iPhone (Apple/iOS) ===== */
[data-preset="iphone"] .device-screen {
  background: #000000 !important;
  color: #ffffff !important;
  padding: 1.5rem 1.25rem !important;
}

[data-preset="iphone"] .screen-content h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif !important;
  font-weight: 600;
  font-size: clamp(1rem, 3vh, 1.5rem);
  color: #ffffff !important;
  letter-spacing: -0.02em;
}

[data-preset="iphone"] .screen-content p {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif !important;
  font-size: clamp(0.75rem, 2.2vh, 0.95rem);
  color: rgba(255, 255, 255, 0.85) !important;
  line-height: 1.5;
}

[data-preset="iphone"] .screen-content .vibe {
  font-size: clamp(0.7rem, 2vh, 0.85rem);
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Prevent "AI" from rendering as "Al" (I vs l) in some fonts */
.ai-text {
  letter-spacing: 0.06em;
}

[data-preset="iphone"] .year-badge {
  background: rgba(255, 255, 255, 0.15) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

/* ===== PRESET: PSP (Sony handheld, widescreen) ===== */
[data-preset="psp"] .device-screen,
[data-preset="psp"] .device-screen-content {
  background: #0a0a10 !important;
  color: #e0e0e0 !important;
}

[data-preset="psp"] .screen-content h2 {
  font-size: clamp(0.9rem, 2.5vh, 1.2rem);
  color: #ffffff !important;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif !important;
}

[data-preset="psp"] .screen-content p {
  font-size: clamp(0.65rem, 1.8vh, 0.85rem);
  color: rgba(255, 255, 255, 0.85) !important;
  line-height: 1.5;
}

[data-preset="psp"] .screen-content .vibe {
  font-size: clamp(0.6rem, 1.6vh, 0.75rem);
  color: rgba(255, 255, 255, 0.5) !important;
}

[data-preset="psp"] .year-badge {
  background: rgba(0, 120, 215, 0.3) !important;
  color: #7dd3ff !important;
}

/* ===== PRESET: Nintendo Switch (gaming, dark) ===== */
[data-preset="switch"] .device-screen,
[data-preset="switch"] .device-screen-content {
  background: #0f0f12 !important;
  color: #e0e0e0 !important;
}

[data-preset="switch"] .screen-content h2 {
  font-size: clamp(0.9rem, 2.5vh, 1.2rem);
  color: #ffffff !important;
}

[data-preset="switch"] .screen-content p {
  font-size: clamp(0.65rem, 1.8vh, 0.85rem);
  color: rgba(255, 255, 255, 0.85) !important;
}

[data-preset="switch"] .screen-content .vibe {
  font-size: clamp(0.6rem, 1.6vh, 0.75rem);
  color: rgba(255, 255, 255, 0.5) !important;
}

[data-preset="switch"] .year-badge {
  background: rgba(230, 0, 18, 0.3) !important;
  color: #ff6b6b !important;
}

/* ===== PRESET: Meta Ray-Ban (smart glasses, small screen) ===== */
[data-preset="rayban"] .device-screen,
[data-preset="rayban"] .device-screen-content {
  background: #0a0a0f !important;
  color: #e0e0e0 !important;
}

[data-preset="rayban"] .screen-content h2 {
  font-size: 0.65rem !important;
  color: #ffffff !important;
  margin: 0;
  line-height: 1.2;
}

[data-preset="rayban"] .screen-content p {
  font-size: 0.48rem !important;
  color: rgba(255, 255, 255, 0.9) !important;
  margin: 0;
  line-height: 1.25;
}

[data-preset="rayban"] .year-badge {
  font-size: 0.42rem !important;
  padding: 0.15rem 0.3rem !important;
  background: rgba(0, 150, 255, 0.3) !important;
  color: #7dd3ff !important;
}

[data-preset="rayban"] .contact-links-below .btn {
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
}

/* ===== Nokia 3310 (image mockup + overlay) ===== */
.device-nokia {
  background: transparent;
  box-shadow: none;
  max-height: none;
}

.device-nokia .device-mockup {
  position: relative;
  height: 80vh;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-nokia .device-mockup img {
  display: block;
  height: 80vh;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  object-position: center;
}

/* Screen content sits BEHIND image — shows through transparent cutout */
.device-nokia .device-mockup {
  position: relative;
}

.device-nokia .device-screen-content {
  position: absolute;
  top: var(--screen-top, 22%);
  left: var(--screen-left, 12%);
  width: var(--screen-width, 76%);
  height: var(--screen-height, 15%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  overflow: hidden;
}

.device-nokia .device-frame-img {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.device-nokia .device-mockup .screen-content {
  width: 100%;
  gap: 0.2rem;
  text-align: center;
}

/* ===== Sony PSP (image mockup) ===== */
.device-psp {
  background: transparent;
  box-shadow: none;
  max-height: none;
}

.device-psp .device-mockup {
  position: relative;
  height: 80vh;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-psp .device-mockup img {
  display: block;
  height: 80vh;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  object-position: center;
}

.device-psp .device-screen-content {
  position: absolute;
  top: var(--screen-top, 15%);
  left: var(--screen-left, 12%);
  width: var(--screen-width, 76%);
  height: var(--screen-height, 55%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

.device-psp .device-frame-img {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.device-psp .device-mockup .screen-content {
  width: 100%;
  gap: 0.5rem;
  text-align: center;
}

/* ===== iPad (image mockup) ===== */
.device-ipad {
  background: transparent;
  box-shadow: none;
  max-height: none;
}

.device-ipad .device-mockup {
  position: relative;
  height: 80vh;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-ipad .device-mockup img {
  display: block;
  height: 80vh;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  object-position: center;
}

.device-ipad .device-screen-content {
  position: absolute;
  top: var(--screen-top, 10%);
  left: var(--screen-left, 13%);
  width: var(--screen-width, 74%);
  height: var(--screen-height, 78%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
}

.device-ipad .device-frame-img {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.device-ipad .device-mockup .screen-content {
  width: 100%;
  gap: 0.5rem;
}

/* ===== iPhone (image mockup - 6s, etc.) ===== */
.device-iphone-mockup {
  background: transparent;
  box-shadow: none;
  max-height: none;
}

.device-iphone-mockup .device-mockup {
  position: relative;
  height: 80vh;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-iphone-mockup .device-mockup img {
  display: block;
  height: 80vh;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  object-position: center;
}

.device-iphone-mockup .device-screen-content {
  position: absolute;
  top: var(--screen-top, 16%);
  left: var(--screen-left, 31%);
  width: var(--screen-width, 38%);
  height: var(--screen-height, 67%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

.device-iphone-mockup .device-iphone17-screen {
  border-radius: var(--screen-radius, 18%);
}

.device-iphone-mockup .device-frame-img {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.device-iphone-mockup .device-mockup .screen-content {
  width: 100%;
  gap: 0.5rem;
}

/* ===== Samsung Galaxy Fold (dual screen) ===== */
.device-fold {
  background: transparent;
  box-shadow: none;
  max-height: none;
}

.device-fold .device-mockup {
  position: relative;
  height: 80vh;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-fold .device-mockup img {
  display: block;
  height: 80vh;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  object-position: center;
}

.device-fold .device-screen-content {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.device-fold-screen-left {
  top: var(--screen-top, 6.5%);
  left: var(--screen-left, 32.2%);
  width: var(--screen-width, 18%);
  height: var(--screen-height, 87.1%);
}

.device-fold-screen-right {
  top: var(--screen-top, 6.5%);
  left: var(--screen-left, 50.2%);
  width: var(--screen-width, 17.7%);
  height: var(--screen-height, 87.1%);
}

.device-fold .device-frame-img {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.screen-content-fold-left {
  width: 100%;
  justify-content: center;
  align-items: center;
}

.screen-content-fold-right {
  width: 100%;
  gap: 0.5rem;
}

.device-fold .screen-content-fold-right h2 {
  font-size: clamp(0.65rem, 2.5vh, 1rem);
}

.device-fold .screen-content-fold-right p {
  font-size: clamp(0.5rem, 2vh, 0.8rem);
  line-height: 1.4;
}

.device-fold .screen-content-fold-right .vibe {
  font-size: clamp(0.45rem, 1.8vh, 0.7rem);
}

.device-fold .screen-content-fold-right .portfolio-node {
  font-size: clamp(0.45rem, 1.8vh, 0.65rem);
  padding: 0.25rem 0.4rem;
}

/* ===== Nothing Phone 1 (image mockup) ===== */
.device-nothing {
  background: transparent;
  box-shadow: none;
  max-height: none;
}

.device-nothing .device-mockup {
  position: relative;
  height: 80vh;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-nothing .device-mockup img {
  display: block;
  height: 80vh;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  object-position: center;
}

.device-nothing .device-screen-content {
  position: absolute;
  top: var(--screen-top, 9.1%);
  left: var(--screen-left, 46.9%);
  width: var(--screen-width, 24.6%);
  height: var(--screen-height, 81.8%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.device-nothing .device-frame-img {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.device-nothing .device-mockup .screen-content {
  width: 100%;
  gap: 0.5rem;
}

/* ===== Apple Vision Pro (dual lens) ===== */
.device-visionpro {
  background: transparent;
  box-shadow: none;
  max-height: none;
}

.device-visionpro .device-mockup {
  position: relative;
  height: 80vh;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-visionpro .device-mockup img {
  display: block;
  height: 80vh;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  object-position: center;
}

.device-visionpro .device-frame-img {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.device-visionpro-lens {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Left lens: points (275,455) (417,339) (573,441) (406,583) — bounding box 275,339,298×244 */
.device-visionpro-lens-left {
  top: var(--screen-top, 44.1%);
  left: var(--screen-left, 20.5%);
  width: var(--screen-width, 22.2%);
  height: var(--screen-height, 31.8%);
  clip-path: polygon(0% 47.5%, 47.7% 0%, 100% 41.8%, 43.9% 100%);
  -webkit-clip-path: polygon(0% 47.5%, 47.7% 0%, 100% 41.8%, 43.9% 100%);
}

/* Right lens: points (770,446) (921,339) (1068,451) (938,583) — bounding box 770,339,298×244 */
.device-visionpro-lens-right {
  top: var(--screen-top, 44.1%);
  left: var(--screen-left, 57.3%);
  width: var(--screen-width, 22.2%);
  height: var(--screen-height, 31.8%);
  clip-path: polygon(0% 43.8%, 50.7% 0%, 100% 45.9%, 56.4% 100%);
  -webkit-clip-path: polygon(0% 43.8%, 50.7% 0%, 100% 45.9%, 56.4% 100%);
}

.screen-content-lens {
  width: 100%;
  max-width: 100%;
  gap: 0.4rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.device-visionpro .screen-content-lens h2 {
  font-size: clamp(0.55rem, 2.2vh, 0.9rem);
}

.device-visionpro .screen-content-lens p {
  font-size: clamp(0.45rem, 1.8vh, 0.7rem);
  line-height: 1.35;
}

.device-visionpro .screen-content-lens .vibe {
  font-size: clamp(0.4rem, 1.6vh, 0.6rem);
}

.device-visionpro .screen-content-lens .portfolio-node {
  font-size: clamp(0.4rem, 1.6vh, 0.6rem);
  padding: 0.2rem 0.35rem;
}

.device-visionpro .screen-content-lens .portfolio-nodes {
  justify-content: center;
}

/* ===== Nintendo Switch (image mockup) ===== */
.device-switch {
  background: transparent;
  box-shadow: none;
  max-height: none;
}

.device-switch .device-mockup {
  position: relative;
  height: 80vh;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-switch .device-mockup img {
  display: block;
  height: 80vh;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  object-position: center;
}

/* Inner wrapper so screen content is positioned relative to image (fixes mobile bleed) */
.device-switch .device-switch-inner {
  position: relative;
  display: block;
}

.device-switch .device-switch-inner .device-screen-content {
  position: absolute;
  top: var(--screen-top, 24%);
  left: var(--screen-left, 24%);
  width: var(--screen-width, 52%);
  height: var(--screen-height, 52%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

.device-switch .device-switch-inner .device-frame-img {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.device-switch .device-screen-content {
  position: absolute;
  top: var(--screen-top, 24%);
  left: var(--screen-left, 24%);
  width: var(--screen-width, 52%);
  height: var(--screen-height, 52%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

.device-switch .device-frame-img {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.device-switch .device-mockup .screen-content {
  width: 100%;
  gap: 0.5rem;
}

/* ===== Meta Ray-Ban (image mockup) ===== */
.device-rayban {
  background: transparent;
  box-shadow: none;
  max-height: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.device-rayban .device-mockup {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  height: 80vh;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-rayban .device-mockup img {
  display: block;
  height: 80vh;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  object-position: center;
}

.device-rayban .rayban-buttons {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 73.6%;
  z-index: 3;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.device-rayban .device-screen-content {
  position: absolute;
  top: var(--screen-top, 47%);
  left: var(--screen-left, 62%);
  width: var(--screen-width, 11%);
  height: var(--screen-height, 11%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  overflow: hidden;
  border-radius: var(--screen-radius, 12%);
}

.device-rayban .screen-content-rayban {
  gap: 0.15rem !important;
  width: 100%;
  overflow: hidden;
}

.device-rayban .device-frame-img {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.device-rayban .device-mockup .screen-content {
  width: 100%;
  gap: 0.2rem;
}

/* ===== Nokia 1110 (CSS-only, removed - using PSP for 2005) ===== */
.device-nokia-style {
  width: 33vh;
  height: 80vh;
  background: linear-gradient(145deg, #1e2e24 0%, #0f1a14 100%);
  display: flex;
  flex-direction: column;
}

.device-nokia-style .device-screen {
  min-height: 0;
  flex: 1;
  border-radius: 0.5rem;
  margin: 0.75rem;
  border: 2px solid #1a3328;
}

/* ===== Motorola Razr (removed - using nokia-style for 2005) ===== */
.device-razr {
  width: 33vh;
  height: 80vh;
  background: linear-gradient(145deg, #374151 0%, #1f2937 100%);
  display: flex;
  flex-direction: column;
}

.device-razr .device-screen {
  min-height: 0;
  flex: 1;
  border-radius: 0 0 1rem 1rem;
}

/* ===== iPhone (2007) ===== */
.device-iphone-old {
  width: 33vh;
  height: 80vh;
  background: #1c1c1e;
  border-radius: 2rem;
  display: flex;
  flex-direction: column;
}

.device-iphone-old .device-screen {
  border-radius: 1.5rem;
  margin: 0.5rem;
  min-height: 0;
  flex: 1;
}

/* ===== iPhone 4 ===== */
.device-iphone4 {
  width: 33vh;
  height: 80vh;
  background: linear-gradient(145deg, #3f3f46 0%, #27272a 100%);
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
}

.device-iphone4 .device-screen {
  border-radius: 0.25rem;
  margin: 0.5rem;
  min-height: 0;
  flex: 1;
}

/* ===== iPhone 14 ===== */
.device-iphone14 {
  width: 35vh;
  height: 80vh;
  background: #1c1c1e;
  border-radius: 2.5rem;
  display: flex;
  flex-direction: column;
}

.device-iphone14 .device-screen {
  position: relative;
  border-radius: 2rem;
  margin: 0.5rem;
  min-height: 0;
  flex: 1;
}

/* Dynamic Island notch */
.device-iphone14 .device-screen::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 24px;
  background: #000;
  border-radius: 20px;
}

.device-iphone14 .screen-content {
  padding-top: 1.5rem;
}

/* ===== Today ===== */
.device-today {
  width: 35vh;
  height: 80vh;
  background: linear-gradient(145deg, #1e1e22 0%, #0f0f11 100%);
  border: 1px solid rgba(168, 85, 247, 0.2);
  display: flex;
  flex-direction: column;
}

.device-today .device-screen {
  min-height: 0;
  flex: 1;
}

.contact-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: rgba(168, 85, 247, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: rgba(168, 85, 247, 0.5);
  transform: translateY(-1px);
}

/* ===== Current year highlight ===== */
.year-current .device-frame {
  box-shadow: 
    0 0 0 1px rgba(168, 85, 247, 0.3),
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 80px -10px rgba(168, 85, 247, 0.25);
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 640px) {
  .year-section {
    padding: 2.5rem 0.75rem 1rem;
    min-height: 100svh;
    min-height: 100dvh;
  }

  .device-label {
    top: -1.5rem;
    font-size: 0.6rem;
  }

  .dragon-ornament {
    font-size: 1.5rem;
    right: 8%;
    top: 0.5rem;
  }

  /* Prevent timeline overlap: scale down devices more, add top clearance */
  .device-nokia .device-mockup,
  .device-psp .device-mockup,
  .device-ipad .device-mockup,
  .device-iphone-mockup .device-mockup,
  .device-fold .device-mockup,
  .device-nothing .device-mockup,
  .device-visionpro .device-mockup,
  .device-switch .device-mockup,
  .device-rayban .device-mockup {
    height: 58vh;
    min-height: 260px;
  }

  .device-nokia .device-mockup img,
  .device-psp .device-mockup img,
  .device-ipad .device-mockup img,
  .device-iphone-mockup .device-mockup img,
  .device-fold .device-mockup img,
  .device-nothing .device-mockup img,
  .device-visionpro .device-mockup img,
  .device-switch .device-mockup img,
  .device-rayban .device-mockup img {
    height: 58vh;
    max-width: 92vw;
  }

  /* Fix screen content cut-off: allow scroll + reduce padding/sizing */
  .device-nokia .device-screen-content,
  .device-psp .device-screen-content,
  .device-ipad .device-screen-content,
  .device-iphone-mockup .device-screen-content,
  .device-fold .device-screen-content,
  .device-nothing .device-screen-content,
  .device-visionpro .device-screen-content,
  .device-switch .device-screen-content,
  .device-rayban .device-screen-content {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  /* Nokia: slightly larger screen area to reduce black bars, fill screen cutout better */
  .device-nokia .device-screen-content {
    top: 26.5% !important;
    left: 21.5% !important;
    width: 52% !important;
    height: 18.5% !important;
    padding: 0.45rem;
  }

  /* PSP: fit within screen — less aggressive inset, shrink content so year + all text visible */
  .device-psp .device-screen-content {
    top: 30.6% !important;
    left: 26.6% !important;
    width: 46% !important;
    height: 34% !important;
    padding: 0.4rem;
  }

  /* Switch: position relative to image (via inner) — fit screen cutout (mobile) */
  .device-switch .device-screen-content {
    top: 29.5% !important;
    left: 25% !important;
    width: 50% !important;
    height: 41% !important;
    padding: 0.4rem;
    background: transparent !important;
  }

  /* Switch: background layer only — inset 20% top/bottom so no bleed above/below device */
  .device-switch .device-screen-content::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 20%;
    bottom: 20%;
    background: #0f0f12;
    z-index: -1;
    border-radius: 0.25rem;
  }

  .device-nokia .device-mockup .screen-content,
  .device-psp .device-mockup .screen-content,
  .device-ipad .device-mockup .screen-content,
  .device-iphone-mockup .device-mockup .screen-content,
  .device-nothing .device-mockup .screen-content,
  .device-visionpro .screen-content-lens,
  .device-switch .device-mockup .screen-content {
    gap: 0.35rem;
  }

  /* Smaller screen text so content fits without scrolling when possible */
  .device-nokia .device-mockup .screen-content h2,
  .device-psp .device-mockup .screen-content h2,
  .device-ipad .device-mockup .screen-content h2,
  .device-iphone-mockup .device-mockup .screen-content h2,
  .device-nothing .device-mockup .screen-content h2,
  .device-visionpro .screen-content-lens h2,
  .device-switch .device-mockup .screen-content h2 {
    font-size: 0.85rem !important;
  }

  .device-nokia .device-mockup .screen-content p,
  .device-psp .device-mockup .screen-content p,
  .device-ipad .device-mockup .screen-content p,
  .device-iphone-mockup .device-mockup .screen-content p,
  .device-nothing .device-mockup .screen-content p,
  .device-visionpro .screen-content-lens p,
  .device-switch .device-mockup .screen-content p {
    font-size: 0.7rem !important;
    line-height: 1.45;
  }

  .device-nokia .device-mockup .screen-content .vibe,
  .device-psp .device-mockup .screen-content .vibe,
  .device-ipad .device-mockup .screen-content .vibe,
  .device-iphone-mockup .device-mockup .screen-content .vibe,
  .device-nothing .device-mockup .screen-content .vibe,
  .device-visionpro .screen-content-lens .vibe,
  .device-switch .device-mockup .screen-content .vibe {
    font-size: 0.65rem !important;
  }

  .device-nokia .device-mockup .screen-content .year-badge,
  .device-psp .device-mockup .screen-content .year-badge,
  .device-ipad .device-mockup .screen-content .year-badge,
  .device-iphone-mockup .device-mockup .screen-content .year-badge,
  .device-nothing .device-mockup .screen-content .year-badge,
  .device-visionpro .screen-content-lens .year-badge,
  .device-switch .device-mockup .screen-content .year-badge {
    font-size: 0.55rem !important;
    padding: 0.2rem 0.4rem !important;
  }

  /* PSP: smaller content so year + all text fits within screen */
  .device-psp .device-mockup .screen-content h2 {
    font-size: 0.7rem !important;
  }

  .device-psp .device-mockup .screen-content p {
    font-size: 0.58rem !important;
    line-height: 1.35 !important;
  }

  .device-psp .device-mockup .screen-content .year-badge {
    font-size: 0.48rem !important;
    padding: 0.15rem 0.35rem !important;
  }

  .device-psp .device-mockup .screen-content .vibe {
    font-size: 0.55rem !important;
  }

  /* Switch: content sizing for screen (positioning now relative to image, no bleed) */
  .device-switch .device-mockup .screen-content {
    gap: 0.3rem !important;
  }

  .device-switch .device-mockup .screen-content h2 {
    font-size: 0.7rem !important;
  }

  .device-switch .device-mockup .screen-content p {
    font-size: 0.56rem !important;
    line-height: 1.35 !important;
  }

  .device-switch .device-mockup .screen-content .year-badge {
    font-size: 0.46rem !important;
    padding: 0.14rem 0.32rem !important;
  }

  .device-switch .device-mockup .screen-content .vibe {
    font-size: 0.52rem !important;
  }

  /* Ray-Ban: keep content IN the lens — drop just a hair on mobile for perfect fit */
  .device-rayban .device-screen-content {
    top: 39.5% !important;
    padding: 0.2rem;
    overflow-y: auto;
  }

  .device-rayban .screen-content-rayban h2 {
    font-size: 0.5rem !important;
  }

  .device-rayban .screen-content-rayban p {
    font-size: 0.38rem !important;
    line-height: 1.2 !important;
  }

  .device-rayban .screen-content-rayban .year-badge {
    font-size: 0.35rem !important;
    padding: 0.1rem 0.2rem !important;
  }

  .timeline-progress {
    padding: 0.5rem 1rem;
  }

  .timeline-progress-years {
    font-size: 0.55rem;
  }

  .scroll-hint {
    font-size: 0.7rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  /* Ray-Ban mockup + buttons overlay on mobile (same as desktop) */
  .device-rayban .device-mockup img {
    height: 58vh;
    max-width: 92vw;
  }

  .device-rayban .btn-rayban-linkedin,
  .device-rayban .btn-rayban-email,
  .device-rayban .btn-rayban-work {
    min-height: 44px;
    min-width: 44px;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  /* Touch-friendly buttons */
  .btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.65rem 1rem;
  }

  .portfolio-node {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
  }

  /* Screen content typography */
  .screen-content h2 {
    font-size: clamp(0.95rem, 4vw, 1.1rem);
  }

  .screen-content p {
    font-size: clamp(0.75rem, 3vw, 0.85rem);
  }
}

/* ===== Responsive: Tablet ===== */
@media (min-width: 641px) and (max-width: 1024px) {
  .year-section {
    padding: 1.5rem;
  }

  .device-nokia .device-mockup,
  .device-psp .device-mockup,
  .device-ipad .device-mockup,
  .device-iphone-mockup .device-mockup,
  .device-fold .device-mockup,
  .device-nothing .device-mockup,
  .device-visionpro .device-mockup,
  .device-switch .device-mockup,
  .device-rayban .device-mockup {
    height: 72vh;
    min-height: 400px;
  }

  .device-nokia .device-mockup img,
  .device-psp .device-mockup img,
  .device-ipad .device-mockup img,
  .device-iphone-mockup .device-mockup img,
  .device-fold .device-mockup img,
  .device-nothing .device-mockup img,
  .device-visionpro .device-mockup img,
  .device-switch .device-mockup img,
  .device-rayban .device-mockup img {
    height: 72vh;
  }

  .device-rayban .btn-rayban-linkedin,
  .device-rayban .btn-rayban-email,
  .device-rayban .btn-rayban-work {
    min-height: 44px;
    min-width: 44px;
    padding: 0.6rem 1rem;
  }
}

/* ===== Landscape mobile ===== */
@media (max-height: 500px) and (orientation: landscape) {
  .device-nokia .device-mockup,
  .device-psp .device-mockup,
  .device-ipad .device-mockup,
  .device-iphone-mockup .device-mockup,
  .device-fold .device-mockup,
  .device-nothing .device-mockup,
  .device-visionpro .device-mockup,
  .device-switch .device-mockup,
  .device-rayban .device-mockup {
    height: 85vh;
    min-height: 200px;
  }

  .device-nokia .device-mockup img,
  .device-psp .device-mockup img,
  .device-ipad .device-mockup img,
  .device-iphone-mockup .device-mockup img,
  .device-fold .device-mockup img,
  .device-nothing .device-mockup img,
  .device-visionpro .device-mockup img,
  .device-switch .device-mockup img,
  .device-rayban .device-mockup img {
    height: 85vh;
  }

  .device-rayban .device-mockup img {
    max-height: 280px;
  }
}

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

  .scroll-hint {
    animation: none;
  }

  .btn:hover {
    transform: none;
  }

  .dragon-ornament {
    animation: none;
    opacity: 0.6;
  }

  .year-section.visible .device-screen-content,
  .year-section.visible .device-screen {
    animation: none;
    opacity: 1;
  }

  .device-screen-content,
  .device-screen {
    opacity: 1;
  }
}
