/* ── Design tokens ── */
:root {
  --page-bg: #ececeb;
  --page-fg: #161616;
  --stack-accent: #4f8dff;
  --muted: rgba(22, 22, 22, 0.54);
  --page-top-glow: rgba(255, 255, 255, 0.72);
  --glass-light: #ffffff;
  --glass-dark: #000000;
  --glass-tint: #bbbbbc;
  --glass-saturation: 150%;
  --dock-size: 54px;
  --dock-gap: 8px;
  --dock-radius: 23.5%;
  --case-content-width: min(720px, calc(100vw - 48px));
  --case-section-gap: 64px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    linear-gradient(to right, rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(180deg, #f4f4f3 0%, #efefee 36%, var(--page-bg) 100%);
  background-size: 24px 24px, 24px 24px, 100% 100%;
  color: var(--page-fg);
  font-family: "DM Sans", "Helvetica Neue", "Arial Nova", sans-serif;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  transition: background 420ms cubic-bezier(0.22,1,0.36,1), color 320ms ease;
}

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

/* ── Dark theme ── */
body[data-theme="dark"] {
  --page-bg: #000000;
  --page-fg: #f5f5f2;
  --stack-accent: #84b6ff;
  --muted: rgba(245,245,242,0.56);
  --page-top-glow: transparent;
  background:
    linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.06) 1px, transparent 1px),
    #000000;
  background-size: 24px 24px, 24px 24px, 100% 100%;
}

/* ── Custom cursor ── */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: #161616;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  z-index: 100;
  transition: opacity 160ms ease;
}

body[data-theme="dark"] .cursor-dot { background: #ffffff; }
.cursor-dot.is-visible { opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  [data-cursor="dot"],
  [data-cursor="dot"] * { cursor: none !important; }
  .cursor-dot { opacity: 0; }
}

/* ── Page shell ── */
.page-shell {
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  overflow: clip;
}

/* ── Page transition overlay ── */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  will-change: opacity;
  contain: strict;
}

.page-transition.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 4;
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
}

.page-transition__svg {
  width: 100%; height: 100%;
  display: block;
  transform: translateZ(0);
}

.page-transition__path {
  transform-origin: center bottom;
  shape-rendering: geometricPrecision;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* Hide header when in project/about view */
body[data-view]:not([data-view="home"]):not([data-view="about"]) {
  --page-bg: #ececeb;
  --page-fg: #161616;
  --muted: rgba(22,22,22,0.54);
  --page-top-glow: rgba(255,255,255,0.72);
  background:
    radial-gradient(circle at 50% 8%, var(--page-top-glow), rgba(255,255,255,0) 34%),
    radial-gradient(circle at 20% 18%, rgba(255,255,255,0.34), rgba(255,255,255,0) 28%),
    linear-gradient(180deg, #f4f4f3 0%, #efefee 36%, var(--page-bg) 100%);
  transition: background 640ms cubic-bezier(0.22,1,0.36,1), color 320ms ease;
}

body[data-view]:not([data-view="home"]):not([data-view="about"]) .page-header {
  opacity: 0; visibility: hidden; pointer-events: none;
}

body[data-view]:not([data-view="home"]) .hero {
  opacity: 0; visibility: hidden; pointer-events: none;
}

body[data-view]:not([data-view="home"]) .hero__mobile-apps {
  opacity: 0; visibility: hidden; pointer-events: none;
}

/* About view — keep header visible, show clean background */
body[data-view="about"] {
  background:
    linear-gradient(to right, rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(180deg, #f4f4f3 0%, #efefee 36%, var(--page-bg) 100%);
  background-size: 24px 24px, 24px 24px, 100% 100%;
}

body[data-view="about"] .page-header {
  opacity: 1; visibility: visible; pointer-events: auto;
}

body[data-view="about"] .project-screen {
  background: transparent;
  overflow: hidden;
}

body[data-theme="dark"][data-view="about"] {
  background:
    linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.06) 1px, transparent 1px),
    #000000;
  background-size: 24px 24px, 24px 24px, 100% 100%;
}

body[data-theme="dark"][data-view="about"] .project-screen {
  background: transparent;
}

body[data-theme="dark"] .about-screen__typing-host {
  color: rgba(245, 245, 242, 0.9);
}

body[data-theme="dark"] .about-screen__paragraph a {
  text-decoration-color: rgba(245, 245, 242, 0.25);
}

body[data-theme="dark"] .about-screen__paragraph a:hover {
  text-decoration-color: rgba(245, 245, 242, 0.8);
}

body[data-theme="dark"] .about-screen__paragraph--connect {
  color: rgba(245, 245, 242, 0.45);
}

body[data-theme="dark"] .about-screen__paragraph--links a {
  color: rgba(245, 245, 242, 0.45);
}

body[data-theme="dark"] .about-screen__paragraph--links a:hover {
  color: rgba(245, 245, 242, 0.9);
}

body[data-theme="dark"] .about-screen__paragraph--oss::before {
  color: rgba(245, 245, 242, 0.35);
}

/* ── Header / Site switcher ── */
.page-header {
  display: flex;
  justify-content: center;
  position: fixed;
  top: 40px;
  left: 0; right: 0;
  z-index: 3;
  pointer-events: none;
  transition: opacity 320ms ease, visibility 320ms ease;
}

.site-switcher {
  --switcher-pad: 3px;
  --switcher-segment-height: 28px;
  --switcher-progress-width: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: var(--switcher-pad);
  border: 1px solid color-mix(in srgb, var(--page-fg) 14%, transparent);
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #ffffff 24%, transparent),
    0 2px 12px rgba(0,0,0,0.06);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  overflow: hidden;
  pointer-events: auto;
}

.site-switcher.is-audio-expanded {
  --switcher-progress-width: 78px;
}

.site-switcher__button {
  appearance: none;
  border: none;
  background: transparent;
  min-height: var(--switcher-segment-height);
  height: var(--switcher-segment-height);
  padding: 0 10px;
  display: inline-flex;
  position: relative;
  isolation: isolate;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 999px;
  color: color-mix(in srgb, var(--page-fg) 72%, transparent);
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1;
  letter-spacing: 0.01em;
  cursor: pointer;
  z-index: 1;
  transition: color 220ms ease, background-color 220ms ease;
}

.site-switcher__button:active {
  transform: scale(0.97);
  transition: transform 120ms ease-out;
}

@media (hover: hover) and (pointer: fine) {
  .site-switcher__button:hover {
    color: color-mix(in srgb, var(--page-fg) 92%, transparent);
  }
}

.site-switcher__button::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background-color 220ms ease;
  pointer-events: none;
  z-index: 0;
}

@media (hover: hover) and (pointer: fine) {
  .site-switcher__button:hover::after {
    background: color-mix(in srgb, var(--page-bg) 88%, transparent);
  }
}

.site-switcher__theme {
  width: 32px; min-width: 32px;
  padding: 0;
  position: relative;
}
.site-switcher__theme::after { inset: 4px; }

.site-switcher__icon {
  width: 18px; height: 18px;
  position: relative;
  z-index: 1;
  transition: opacity 260ms ease, transform 260ms ease;
}

.site-switcher__icon--sun {
  position: absolute;
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.site-switcher__icon--moon {
  opacity: 0;
  transform: rotate(-30deg) scale(0.8);
}

body[data-theme="dark"] .site-switcher__icon--sun {
  opacity: 0;
  transform: rotate(30deg) scale(0.8);
}
body[data-theme="dark"] .site-switcher__icon--moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.site-switcher__sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Audio controls */
.site-switcher__audio {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-left: 1px solid color-mix(in srgb, var(--page-fg) 10%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--page-fg) 10%, transparent);
}

.site-switcher__play {
  width: 32px; min-width: 32px;
  padding: 0;
  position: relative;
}
.site-switcher__play::after { inset: 4px; }

.site-switcher__play-icon {
  width: 16px; height: 16px;
  position: relative;
  z-index: 1;
  transition: opacity 180ms ease, transform 180ms ease;
}

.site-switcher__play-icon--play {
  position: absolute;
  opacity: 1; transform: scale(1);
}
.site-switcher__play-icon--pause {
  opacity: 0; transform: scale(0.8);
}

.site-switcher.is-audio-playing .site-switcher__play-icon--play {
  opacity: 0; transform: scale(0.8);
}
.site-switcher.is-audio-playing .site-switcher__play-icon--pause {
  opacity: 1; transform: scale(1);
}

.site-switcher__progress {
  width: var(--switcher-progress-width);
  overflow: hidden;
  transition: width 320ms cubic-bezier(0.22,1,0.36,1);
}

.site-switcher__progress-track {
  width: 72px;
  height: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--page-fg) 14%, transparent);
  cursor: pointer;
  margin-right: 6px;
}

.site-switcher__progress-fill {
  width: 100%; height: 100%;
  border-radius: 2px;
  background: color-mix(in srgb, var(--page-fg) 52%, transparent);
  transform-origin: left center;
  transform: scaleX(0);
}

.site-switcher__about {
  padding-inline: 8px;
  text-transform: lowercase;
  position: relative;
  z-index: 2;
}

.site-switcher__label {
  position: relative;
  z-index: 1;
}

/* ── Hero ── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 80px 24px 160px;
  position: relative;
  transition: opacity 320ms ease, visibility 320ms ease;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  width: 100%;
  max-width: 720px;
}

/* Avatar */
.hero__identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero__avatar-stack {
  position: relative;
  width: 160px; height: 160px;
  cursor: pointer;
}

.hero__avatar {
  width: 160px; height: 160px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0; left: 0;
  transition: opacity 320ms ease;
}

.hero__avatar--light { opacity: 1; }
.hero__avatar--dark { opacity: 0; }

body[data-theme="dark"] .hero__avatar--light { opacity: 0; }
body[data-theme="dark"] .hero__avatar--dark { opacity: 1; }

.hero__name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--page-fg);
  letter-spacing: 0.01em;
}

/* Avatar bubble */
.avatar-bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 5;
  opacity: 0;
}

.avatar-bubble.is-active { opacity: 1; }

.avatar-bubble__content {
  position: relative;
  background: var(--page-fg);
  color: var(--page-bg);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.avatar-bubble__tail {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 10px;
  background: var(--page-fg);
  border-radius: 0 0 2px 0;
  transform: translateX(-50%) rotate(45deg);
}

.avatar-bubble__text { position: relative; z-index: 1; }

/* Title */
.hero__title {
  margin: 0;
  display: grid;
  justify-items: center;
  justify-self: center;
  width: max-content;
  max-width: 100%;
  gap: 0;
  font-size: clamp(3.2rem, 1.2vw + 2.4rem, 4.2rem);
  line-height: 0.92;
  letter-spacing: normal;
  font-weight: 400;
  text-align: center;
}

.hero__line {
  display: block;
}

.hero__line--with-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.12em;
  flex-wrap: wrap;
}

.hero__line-copy {
  display: inline-block;
  opacity: 0;
  filter: blur(4px);
  transform: translateY(0.4em);
  animation: hero-word-appear 480ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__line--with-stack .hero__line-copy:first-child {
  animation-delay: 80ms;
}

.hero__line--with-stack .hero__line-copy:last-child {
  animation-delay: 220ms;
}

@keyframes hero-word-appear {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.hero__stack-slot {
  width: 1.2em;
  height: 1.3em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  opacity: 0;
  transform: translateY(-0.5em) scale(0.82);
  animation:
    hero-stack-appear 500ms cubic-bezier(0.22, 1, 0.36, 1) 720ms forwards,
    hero-stack-pulse 3.2s ease-in-out 1380ms infinite;
  position: relative;
  isolation: isolate;
  cursor: pointer;
  outline: none;
}

@keyframes hero-stack-appear {
  0% { opacity: 0; transform: translateY(-0.5em) scale(0.82); }
  100% { opacity: 1; transform: translateY(0.04em) scale(1); }
}

@keyframes hero-stack-pulse {
  0%, 100% { transform: translateY(0.04em) scale(1); }
  35% { transform: translateY(0.01em) scale(1.08); }
}

.hero__stack-slot:hover { transform: translateY(0.04em) scale(1.1); }
.hero__stack-slot:active { transform: translateY(0.04em) scale(0.95); }

.hero__stack-hint {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.hero__title:hover .hero__stack-hint {
  opacity: 0.7;
}

.hero__stack-icon {
  width: 1.2em; height: 1.2em;
  display: block;
  object-fit: contain;
}

/* Skill burst layer */
.hero__skill-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.hero__skill-pill {
  position: absolute;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  background: var(--skill-pill-bg);
  color: var(--skill-pill-ink);
  box-shadow: 0 2px 8px var(--skill-pill-shadow);
  will-change: transform, opacity;
}

/* Words stagger animation */
.words-stagger {
  display: block;
  min-height: 1.05em;
}

.words-stagger__word {
  display: inline-block;
  opacity: 0;
  filter: blur(4px);
  transform: translateY(0.4em);
  will-change: opacity, transform, filter;
  transition:
    opacity 480ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 480ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 480ms cubic-bezier(0.16, 1, 0.3, 1);
}

.words-stagger__word + .words-stagger__word {
  margin-left: 0.26em;
}

.words-stagger__word.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* ── Dock / Mobile app grid ── */
.hero__mobile-apps {
  position: fixed;
  left: 50%;
  bottom: 102px;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 22px;
  background-color: color-mix(in srgb, #bbbbbc 15%, rgba(255, 255, 255, 0.16));
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.12),
    inset 1.6px 2.4px 0 -1.6px rgba(255,255,255,0.82),
    inset -1.4px -1.8px 0 -1.4px rgba(255,255,255,0.66),
    inset -2px -5px 1px -4px rgba(255,255,255,0.42),
    inset -0.4px -1px 4px 0 rgba(0,0,0,0.12),
    inset 0 2px 3px -1px rgba(0,0,0,0.16),
    0 12px 28px 0 rgba(0,0,0,0.10);
  flex-shrink: 0;
}

.hero__mobile-apps::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.54),
    inset 0 -1px 0 rgba(0,0,0,0.06);
  opacity: 0.62;
}

body[data-theme="dark"] .hero__mobile-apps {
  background-color: color-mix(in srgb, #bbbbbc 15%, rgba(0, 0, 0, 0.3));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    inset 1.6px 2.4px 0 -1.6px rgba(255,255,255,0.08),
    inset -1.4px -1.8px 0 -1.4px rgba(255,255,255,0.06),
    inset -2px -5px 1px -4px rgba(255,255,255,0.04),
    inset -0.4px -1px 4px 0 rgba(0,0,0,0.24),
    inset 0 2px 3px -1px rgba(0,0,0,0.32),
    0 12px 28px 0 rgba(0,0,0,0.20);
}

/* Inner track for dock items */
.hero__dock-track {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  height: var(--dock-size);
  position: relative;
  z-index: 1;
}

/* Dock item — container width grows, icon stays fixed → pushes neighbors apart */
.hero__mobile-app {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: var(--dock-size);
  height: var(--dock-size);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero__mobile-app-icon {
  width: var(--dock-size);
  height: var(--dock-size);
  border-radius: 22%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.1),
    0 0 0 0.5px rgba(0,0,0,0.06);
  transition: filter 0.3s ease;
}

.hero__mobile-app-icon--css {
  background: var(--icon-bg);
  background-image: linear-gradient(
    160deg,
    color-mix(in srgb, var(--icon-bg) 100%, white 0%) 0%,
    var(--icon-bg) 50%,
    color-mix(in srgb, var(--icon-bg) 85%, black) 100%
  );
}

.hero__mobile-app-icon--ig {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

.hero__mobile-app-icon--mail {
  background: linear-gradient(160deg, #5EB3F6 0%, #1E90FF 50%, #0066CC 100%);
}

/* Tile inside — always fills container */
.hero__mobile-app-tile {
  width: 100%;
  height: 100%;
  display: block;
}

.hero__mobile-app-letter {
  font-size: 15px;
  font-weight: 700;
  color: white;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.hero__mobile-app-svg {
  width: 26px; height: 26px;
}

.hero__mobile-app-image {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* Floating tooltip label — appears ABOVE on hover */
.hero__mobile-app-label {
  position: absolute;
  bottom: calc(100% + 18px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--page-fg) 88%, transparent);
  color: color-mix(in srgb, var(--page-bg) 96%, white);
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: 0.01em;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
  transition:
    opacity 150ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 150ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.hero__mobile-app:hover .hero__mobile-app-label,
.hero__mobile-app:focus-within .hero__mobile-app-label {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}


.dock__link {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  outline: none;
  text-decoration: none;
}

.dock__link:active .hero__mobile-app-icon {
  transform: scale(0.93);
  transition: transform 120ms ease-out;
}

@media (hover: hover) and (pointer: fine) {
  .dock__link:hover .hero__mobile-app-icon {
    filter: saturate(1.06) brightness(1.02);
  }
}

.hero__mobile-app-separator {
  width: 6px;
  height: calc(var(--dock-size) * 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  pointer-events: none;
  align-self: center;
}

.hero__mobile-app-separator-line {
  width: 1px;
  height: 100%;
  border-radius: 999px;
  background: rgba(0,0,0,0.15);
  box-shadow: 1px 0 0 rgba(255,255,255,0.3);
}

body[data-theme="dark"] .hero__mobile-app-separator-line {
  background: rgba(255,255,255,0.15);
  box-shadow: 1px 0 0 rgba(255,255,255,0.05);
}

/* Dock magnification — container widens, icon stays same size, neighbors spread */
.hero__mobile-app.hover {
  width: calc(var(--dock-size) * 1.24);
}

.hero__mobile-app.sibling-close {
  width: calc(var(--dock-size) * 1.12);
}

.hero__mobile-app.sibling-far {
  width: calc(var(--dock-size) * 1.04);
}

/* ── Project screen ── */
.project-screen {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: transparent;
  transition: opacity 320ms ease, visibility 320ms ease;
}

body[data-view="home"] .project-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.project-screen__inner {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 clamp(16px, 4vw, 24px);
}

/* Generic panel (transition state) */
.project-screen__panel--generic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  text-align: center;
  max-width: var(--case-content-width);
  gap: 24px;
}

.project-screen__panel--generic[hidden] {
  display: none !important;
}

.project-screen__eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: lowercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.project-screen__title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.project-screen__lede {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 480px;
}

.project-screen__facts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin-top: 8px;
}

.project-screen__fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 0.85rem;
}

.project-screen__label {
  color: var(--muted);
  font-weight: 400;
  text-transform: lowercase;
  flex-shrink: 0;
}

.project-screen__value {
  font-weight: 500;
  text-align: right;
}

/* Back button */
.project-screen__back {
  appearance: none;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 4px;
  border-radius: 999px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.project-screen__back:hover {
  color: var(--page-fg);
  background: color-mix(in srgb, var(--page-fg) 6%, transparent);
}

.project-screen__back--fixed {
  display: none;
}

.project-screen__back--inline {
  margin: 48px auto;
}

.project-screen__back-icon {
  width: 20px; height: 20px;
}

.project-screen__back-label {
  line-height: 1;
}

/* ── Case project panels ── */
.case-project {
  width: 100%;
  max-width: var(--case-content-width);
  padding-top: 100px;
  padding-bottom: 48px;
}

.case-project__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: var(--case-section-gap);
}

.case-project__title {
  margin: 0;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.case-project__badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  background: color-mix(in srgb, var(--page-fg) 8%, transparent);
  color: var(--muted);
}

.case-project__years {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.case-project__summary {
  margin: 8px 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 520px;
}

.case-project__body {
  margin-bottom: var(--case-section-gap);
}

.case-project__placeholder {
  padding: 48px 32px;
  border: 2px dashed color-mix(in srgb, var(--page-fg) 14%, transparent);
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.case-project__placeholder code {
  font-size: 0.78rem;
  background: color-mix(in srgb, var(--page-fg) 6%, transparent);
  padding: 2px 6px;
  border-radius: 4px;
}

.case-project__footer {
  display: flex;
  justify-content: center;
}

/* ── About screen ── */
.about-screen {
  width: min(516px, calc(100vw - 120px));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 10px 0 40px;
  box-sizing: border-box;
}

.about-screen__content {
  width: 100%;
}

.about-screen__typing-host {
  position: relative;
  width: 100%;
  color: color-mix(in srgb, var(--page-fg) 68%, transparent);
  text-align: left;
}

.about-screen__paragraph {
  margin: 0;
  max-width: 100%;
  font-size: 0.88rem;
  line-height: 1.78;
  letter-spacing: -0.008em;
}

.about-screen__paragraph + .about-screen__paragraph {
  margin-top: 1.4em;
}

.about-screen__paragraph a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 160ms ease;
}

.about-screen__paragraph a:hover {
  text-decoration-color: currentColor;
}

.about-screen__paragraph--greeting {
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 500;
  color: var(--page-fg);
}

.about-screen__paragraph--oss {
  font-size: 0.84rem;
  padding-left: 1.2em;
  position: relative;
  margin-top: 0.7em !important;
}

.about-screen__paragraph--oss::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* Hide bullets during typing — only show when line has revealed text */
.about-screen__typing-host.is-typing .about-screen__paragraph--oss {
  visibility: hidden;
}

.about-screen__typing-host.is-typing .about-screen__paragraph--oss .about-screen__type-line {
  visibility: visible;
}

.about-screen__typing-host:not(.is-typing):not(.is-revealed) .about-screen__paragraph--oss::before {
  display: none;
}

.about-screen__paragraph--oss a:first-child {
  font-weight: 500;
}

.about-screen__paragraph--connect {
  margin-top: 1.6em;
  font-weight: 500;
  color: var(--page-fg) !important;
  font-size: clamp(0.9rem, 0.08vw + 0.88rem, 0.98rem);
  line-height: 1.4;
  color: var(--muted);
}

.about-screen__paragraph--links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 0.6em !important;
}

.about-screen__paragraph--links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: color-mix(in srgb, var(--page-fg) 56%, transparent);
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 180ms ease;
}

.about-screen__paragraph--links a::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
  background: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.about-screen__paragraph--links a[data-icon="linkedin"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z'/%3E%3C/svg%3E");
}

.about-screen__paragraph--links a[data-icon="github"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E");
}

.about-screen__paragraph--links a[data-icon="email"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1.5 8.67v8.58a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V8.67l-8.928 5.493a3 3 0 0 1-3.144 0L1.5 8.67Z'/%3E%3Cpath d='M22.5 6.908V6.75a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3v.158l9.714 5.978a1.5 1.5 0 0 0 1.572 0L22.5 6.908Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1.5 8.67v8.58a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V8.67l-8.928 5.493a3 3 0 0 1-3.144 0L1.5 8.67Z'/%3E%3Cpath d='M22.5 6.908V6.75a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3v.158l9.714 5.978a1.5 1.5 0 0 0 1.572 0L22.5 6.908Z'/%3E%3C/svg%3E");
}

.about-screen__paragraph--links a:hover {
  color: color-mix(in srgb, var(--page-fg) 94%, transparent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-screen__paragraph--links a:hover::before {
  opacity: 1;
}

.about-screen__footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 20px;
}

@media (max-width: 640px) {
  .about-screen {
    width: min(100%, calc(100vw - 32px));
    padding: 80px 0 60px;
  }
  .about-screen__paragraph {
    font-size: 0.98rem;
    line-height: 1.5;
  }
  .about-screen__paragraph + .about-screen__paragraph {
    margin-top: 1.24em;
  }
}

/* Typewriter effect */
.about-screen__type-line {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  opacity: 0;
}

.about-screen__typing-host.is-typing .about-screen__type-line {
  animation:
    typing-reveal var(--duration, 0.8s) steps(var(--chars, 20), end) var(--delay, 0s) forwards,
    typing-opacity 0.01s var(--delay, 0s) forwards;
  width: 0;
}

.about-screen__typing-host.is-revealed .about-screen__type-line {
  width: auto;
  opacity: 1;
  overflow: visible;
  white-space: normal;
  animation: none;
}

@keyframes typing-reveal {
  from { width: 0; }
  to { width: var(--target-width, 100%); }
}

@keyframes typing-opacity {
  to { opacity: 1; }
}

/* ── Gallery ── */
.case-gallery {
  position: relative;
  margin-bottom: 24px;
}

.case-gallery__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
}

.case-gallery__track::-webkit-scrollbar { display: none; }

.case-gallery__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.case-gallery__media {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

.case-gallery__media img,
.case-gallery__media video {
  width: 100%;
  display: block;
}

.case-gallery__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.case-gallery__nav {
  appearance: none;
  border: none;
  background: color-mix(in srgb, var(--page-fg) 8%, transparent);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 180ms ease, opacity 180ms ease;
}

.case-gallery__nav:hover {
  background: color-mix(in srgb, var(--page-fg) 14%, transparent);
}

.case-gallery__nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.case-gallery__nav.is-next {
  transform: rotate(180deg);
}

.case-gallery__nav-icon {
  width: 18px; height: 18px;
}

.case-gallery__nav-icon path {
  fill: var(--page-fg);
}

.case-gallery__dots {
  display: flex;
  gap: 6px;
}

.case-gallery__dot {
  appearance: none;
  border: none;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--page-fg) 18%, transparent);
  cursor: pointer;
  padding: 0;
  transition: background-color 180ms ease, transform 180ms ease;
}

.case-gallery__dot.is-active {
  background: color-mix(in srgb, var(--page-fg) 56%, transparent);
  transform: scale(1.3);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero__line-copy {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
  }
  .hero__stack-slot {
    animation: none;
    opacity: 1;
    transform: translateY(0.04em) scale(1);
  }
  .words-stagger__word {
    filter: none;
    transform: none;
    transition: opacity 200ms ease;
  }
}

/* ── Responsive: tablet ── */
@media (max-width: 900px) {
  .page-header { top: 28px; }

  .site-switcher {
    --switcher-segment-height: 26px;
  }
  .site-switcher__button { font-size: 0.76rem; }

  .hero {
    padding: 22px;
  }
  .hero__content {
    gap: 38px;
  }
  .hero__avatar-stack { width: 102px; height: 102px; }
  .hero__avatar { width: 102px; height: 102px; }

  .hero__name { font-size: 1rem; }

  .hero__title {
    font-size: clamp(2.475rem, 1.2vw + 1.575rem, 3.15rem);
    line-height: 0.94;
  }

  .hero__mobile-apps {
    bottom: 72px;
  }

  .project-screen__inner {
    width: min(700px, calc(100vw - 44px));
  }

  .case-project {
    padding-top: 80px;
    max-width: min(600px, calc(100vw - 48px));
  }

  .case-project__summary {
    max-width: 100%;
  }

  .about-screen {
    width: min(480px, calc(100vw - 44px));
  }
}

/* ── Responsive: mobile ── */
@media (max-width: 640px) {
  :root {
    --dock-size: 56px;
    --dock-gap: 5px;
  }

  .page-header { top: 24px; }

  .site-switcher {
    --switcher-segment-height: 24px;
  }
  .site-switcher__button {
    padding-inline: 8px;
    font-size: 0.74rem;
  }
  .site-switcher__icon { width: 13px; height: 13px; }

  .hero {
    min-height: 100svh;
    padding: 136px 20px 30px;
    justify-content: flex-start;
  }

  .hero__content {
    width: min(100%, 344px);
    gap: 14px;
  }

  .hero__identity { gap: 6px; }

  .hero__avatar-stack { width: 72px; height: 72px; }
  .hero__avatar { width: 72px; height: 72px; }

  .hero__name {
    font-size: 0.88rem;
    color: color-mix(in srgb, var(--page-fg) 74%, transparent);
  }

  .hero__title {
    margin-top: 14px;
    width: min(100%, 17ch);
    font-size: clamp(1.9rem, 1.7vw + 1.52rem, 2.28rem);
    line-height: 0.93;
    letter-spacing: -0.03em;
  }

  .hero__line--with-stack { gap: 0.08em; }

  /* Dock becomes a 4-column app grid on mobile */
  .hero__mobile-apps {
    position: static;
    transform: none;
    left: auto;
    bottom: auto;
    display: block;
    width: min(100%, 332px);
    margin-top: 56px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .hero__mobile-apps::before { display: none; }

  .hero__dock-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-items: center;
    gap: 20px 12px;
    height: auto;
  }

  .hero__mobile-app {
    width: 100%;
    height: auto;
    display: grid;
    justify-items: center;
    gap: 6px;
    transition: none;
  }

  .hero__mobile-app-icon {
    width: 56px;
    height: 56px;
    border-radius: 22%;
    box-shadow:
      0 12px 24px rgba(15, 23, 42, 0.07),
      0 2px 5px rgba(15, 23, 42, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.42),
      inset 0 0 0 1px rgba(15, 23, 42, 0.04);
  }

  body[data-theme="dark"] .hero__mobile-app-icon {
    background: linear-gradient(180deg, rgba(34,34,38,0.92), rgba(16,16,19,0.96));
    box-shadow:
      0 18px 30px rgba(0,0,0,0.34),
      0 4px 10px rgba(0,0,0,0.22),
      inset 0 1px 0 rgba(255,255,255,0.08),
      inset 0 0 0 1px rgba(255,255,255,0.06);
  }

  .hero__mobile-app-label {
    display: block;
    position: static;
    transform: none;
    padding: 0;
    border-radius: 0;
    background: none;
    color: color-mix(in srgb, var(--page-fg) 72%, transparent);
    font-size: 0.68rem;
    line-height: 1.15;
    text-align: center;
    opacity: 1;
    pointer-events: auto;
    white-space: normal;
  }

  .hero__mobile-app-separator {
    display: none;
  }

  /* Dock magnification disabled on mobile */
  .hero__mobile-app.hover,
  .hero__mobile-app.sibling-close,
  .hero__mobile-app.sibling-far {
    width: 100%;
  }

  .hero__mobile-app-svg { width: 26px; height: 26px; }

  /* Project screen */
  .project-screen { padding: 16px; }

  .project-screen__inner {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .project-screen__back {
    height: 28px;
    padding: 0 10px 0 9px;
    gap: 5px;
    font-size: 0.74rem;
  }

  .project-screen__back-icon { width: 10px; height: 10px; }

  .project-screen__eyebrow { font-size: 0.72rem; }
  .project-screen__title { font-size: clamp(1.6rem, 7vw + 0.4rem, 2.8rem); }
  .project-screen__lede { font-size: 0.88rem; line-height: 1.4; max-width: 100%; }

  .case-project {
    padding-top: 60px;
    padding-bottom: 32px;
    max-width: 100%;
  }

  .case-project__hero { gap: 8px; }
  .case-project__summary { font-size: 0.88rem; max-width: 100%; }

  .case-project__placeholder {
    padding: 28px 16px;
    font-size: 0.82rem;
  }

  .project-screen__panel--generic {
    padding: 0 8px;
    min-height: auto;
  }

  .project-screen__facts {
    max-width: 100%;
  }

  .project-screen__fact {
    font-size: 0.78rem;
    gap: 8px;
  }

  /* About screen mobile */
  .about-screen {
    width: min(100%, calc(100vw - 32px));
    padding: 20px 0;
  }

  .about-screen__paragraph {
    font-size: 0.84rem;
    line-height: 1.5;
  }

  .about-screen__paragraph + .about-screen__paragraph {
    margin-top: 1.24em;
  }
}

/* ── Responsive: small mobile ── */
@media (max-width: 480px) {
  .avatar-bubble {
    bottom: auto;
    top: 100%;
    margin-top: 8px;
  }

  .hero__title {
    font-size: clamp(1.7rem, 6vw, 2.1rem);
  }
}
