@font-face {
  font-family: 'Mirage TRIAL Text';
  src: url('/fonts/mirage/mirage-text-book-TRIAL.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  /* block: no FOUC/reflow; index.html also preloads the woff2 */
  font-display: block;
}

:root {
  --font-sans: 'Mirage TRIAL Text', Georgia, 'Times New Roman', serif;
  --bg: #ffffff;
  --text: #0a0a0a;
  --muted: #a5a4a9;
  --label: #bbbbbb;
  --footer: #bbbbbb;
  --role: #a5a4a9;
  --fab-bg: rgba(245, 245, 245, 0.72);
  --menu-bg: rgba(245, 245, 245, 0.72);
  --menu-hover: #ffffff;
  /* Figma FAB divider stroke #0A0A0A @ 0.05 — slightly stronger for legibility */
  --fab-divider: rgba(10, 10, 10, 0.14);
  /* Soften below prior 10% — ~7% matches Figma edge better */
  --logo-stroke: rgba(0, 0, 0, 0.07);
  --logo-sheen: rgba(255, 255, 255, 0.1);
  --dot: #00e300;
  color-scheme: light;
}

html[data-theme='dark'] {
  --bg: #0a0a0a;
  --text: #f5f5f5;
  --muted: #8a8a8f;
  --label: #8a8a8f;
  --footer: #8a8a8f;
  --role: #8a8a8f;
  --fab-bg: rgba(28, 28, 30, 0.72);
  --menu-bg: rgba(28, 28, 30, 0.72);
  --menu-hover: rgba(10, 10, 10, 0.6);
  /* Lighter divider on dark frost so it stays visible */
  --fab-divider: rgba(255, 255, 255, 0.42);
  --logo-stroke: rgba(255, 255, 255, 0.07);
  --logo-sheen: rgba(255, 255, 255, 0.1);
  color-scheme: dark;
}

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

html {
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

#root {
  min-height: 100dvh;
  overflow-x: clip;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

img,
video {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

p {
  margin: 0;
}

h1 {
  margin: 0;
  font-weight: 400;
}
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  /* No page pad under footer — FAB is fixed */
  padding-bottom: 0;
  /* Prefs: never clip .page — carousel peeks need to paint past page-main */
  overflow: visible;
}

.page-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  padding: 0 32px 160px;
}

/* —— Intro —— */
.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 0 0;
  gap: 20px;
}

.avatar-btn {
  position: relative;
  width: 106px;
  height: 106px;
  border-radius: 40px;
  overflow: visible;
}

.avatar {
  width: 106px;
  height: 106px;
  border-radius: 40px;
  object-fit: cover;
  /* No stroke / outline — matches design (border removed) */
  border: none;
  box-shadow: none;
  outline: none;
  image-rendering: auto;
}

/*
 * Figma Active 178:1829 + green-dot-reference: 16px lime fill with
 * 4px cutout ring OUTSIDE (content-box) → visual Ø 24 ≈ 1/5 of 106.
 * Box at 90,90 so fill flush BR; ring overlaps squircle edge.
 */
.avatar-dot {
  position: absolute;
  /* 90,90 flush BR + 2px up/left for stronger squircle overlap */
  left: 88px;
  top: 88px;
  width: 16px;
  height: 16px;
  box-sizing: content-box;
  border-radius: 50%;
  background: var(--dot);
  border: 4px solid var(--bg);
}

.intro-text {
  text-align: center;
}

.intro-text h1 {
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.intro-role {
  font-size: 21px;
  line-height: 1.35;
  color: var(--muted);
}

/* —— Reveal —— */
.reveal {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.28s cubic-bezier(0.19, 1, 0.22, 1),
    transform 0.28s cubic-bezier(0.19, 1, 0.22, 1);
  will-change: opacity, transform;
}

.reveal.is-shown {
  opacity: 1;
  transform: translateY(0);
}

/* —— Carousel —— */
.carousel-shell {
  margin-top: 40px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.carousel {
  --slide-w: 554px;
  --slide-h: calc(var(--slide-w) * 672 / 554);
  width: 100%;
  overflow: visible;
}

.carousel-viewport {
  position: relative;
  width: 100%;
  height: var(--slide-h);
  overflow: visible;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

.carousel-viewport:active {
  cursor: grabbing;
}

.carousel-track {
  position: relative;
  height: 100%;
  will-change: transform;
}

.carousel-slide {
  transform-origin: center center;
  cursor: pointer;
  box-shadow: none;
}

.carousel-slide.is-active {
  cursor: default;
  /* z-index set inline — sides stay above so inactive tap works */
}

.slide-frame {
  width: 100%;
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: #e8e8e8;
  box-shadow: none;
}

html[data-theme='dark'] .slide-frame {
  background: #1c1c1e;
}

.slide-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  box-shadow: none;
  image-rendering: auto;
  -webkit-user-drag: none;
}

/* Figma 178:1717 / 179:2044: image→caption gap 24; 17px Book; inline title+subtitle */
.carousel-caption {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  column-gap: 0.3em;
  margin-top: 24px;
  font-size: 17px;
  line-height: 1;
  overflow: visible;
  pointer-events: none;
}

.caption-title {
  color: var(--text);
}

.caption-subtitle {
  color: #a4a0a0;
}

html[data-theme='dark'] .caption-subtitle {
  color: var(--muted);
}

/* —— Content —— */
.content {
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  overflow: visible;
}

.content-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 48px;
  align-items: start;
  overflow: visible;
}

.section-label {
  font-size: 17px;
  line-height: 1.5;
  color: var(--label);
  text-align: right;
  padding-top: 2px;
}

.section-body {
  font-size: 19px;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.experience {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
}

.experience-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  overflow: visible;
}

/* Logo fill via background-image; stroke + sheen are CSS-only (prefs 10% inset). */
.exp-logo {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 4px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Soft inset stroke via --logo-stroke (~7%) */
  box-shadow: inset 0 0 0 1px var(--logo-stroke);
}

.exp-logo::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  background: linear-gradient(
    to bottom,
    var(--logo-sheen) 0%,
    transparent 55%
  );
  pointer-events: none;
}

.exp-company {
  font-size: 19px;
  line-height: 1.4;
}

.exp-role {
  font-size: 15px;
  line-height: 1.4;
  color: var(--role);
  overflow: visible;
}

.collab {
  font-size: 13px;
  line-height: 1.4;
  color: var(--label);
  max-width: 320px;
  overflow: visible;
}

/* —— Footer —— */
.footer {
  flex-shrink: 0;
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  line-height: 1;
  color: var(--footer);
}

/* —— Controls FAB —— */
.controls-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: 108px;
  height: 72px;
}

.controls-fab {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 108px;
  height: 72px;
  border-radius: 20px;
  background: var(--fab-bg);
  border: none;
  outline: none;
  box-shadow: none;
  -webkit-backdrop-filter: blur(100px);
  backdrop-filter: blur(100px);
  color: var(--text);
  opacity: 1;
}

.fab-divider {
  width: 1px;
  height: 28.5px;
  flex-shrink: 0;
  background: var(--fab-divider);
  opacity: 1;
}

.theme-panel,
.sound-panel {
  position: absolute;
  background: var(--menu-bg);
  border: none;
  outline: none;
  box-shadow: none;
  border-radius: 20px;
  -webkit-backdrop-filter: blur(100px);
  backdrop-filter: blur(100px);
  color: var(--text);
}

.theme-panel {
  right: 0;
  bottom: calc(72px + 8px);
  width: 130px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sound-panel {
  right: calc(108px + 8px);
  bottom: 0;
  height: 72px;
  padding: 4px;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px 0 20px;
  border-radius: 16px;
  opacity: 1;
  color: var(--text);
  transition: background 0.15s ease;
}

.menu-item.icon-only {
  width: 60px;
  justify-content: center;
  padding: 0;
}

.menu-item:hover:not(.is-selected) {
  background: var(--menu-hover);
}

.menu-item.is-selected {
  background: transparent;
}

.menu-item span {
  font-size: 15px;
  line-height: 1.2;
}

/* —— Mobile —— */
@media (max-width: 860px) {
  .page-main {
    padding: 0 24px 160px;
  }

  .intro {
    padding-top: 64px;
    gap: 16px;
  }

  .avatar-btn,
  .avatar {
    width: 80px;
    height: 80px;
    border-radius: 28px;
  }

  /* Scale Active dot with 80px avatar; +2px up/left overlap nudge */
  .avatar-dot {
    left: 66px;
    top: 66px;
    width: 12px;
    height: 12px;
    border-width: 3px;
  }

  .intro-text h1,
  .intro-role {
    font-size: 19px;
  }

  /*
   * Keep prev+next peeks visible: slideW ≤ 100vw − 2×gap(32) − 2×minPeek(48).
   * Carousel full-bleeds via .carousel-shell; html overflow-x:clip only — not .page.
   */
  .carousel {
    --slide-w: min(280px, calc(100vw - 160px));
    --slide-h: calc(var(--slide-w) * 672 / 554);
  }

  .slide-frame {
    border-radius: 24px;
  }

  .carousel-caption {
    font-size: 19px;
    margin-top: 16px;
    column-gap: 0.3em;
  }

  .content {
    margin-top: 64px;
    gap: 40px;
  }

  .content-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .section-label {
    text-align: left;
    font-size: 19px;
  }

  .section-body {
    font-size: 19px;
  }

  .exp-company {
    font-size: 19px;
  }

  .exp-role {
    font-size: 15px;
  }

  .footer {
    padding: 24px;
  }

  .controls-root {
    right: 16px;
    bottom: 16px;
  }
}
