/* ==========================================
   TOKENS & THEME
   ========================================== */

:root {
  --font-display: 'Gasoek One', Impact, sans-serif;
  --font-body: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Spline Sans Mono', 'SF Mono', monospace;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 20px;

  --sidebar-width: 340px;
  --gap: 16px;

  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-card: #161616;
  --bg-card-hover: #1e1e1e;
  --bg-tag: rgba(255, 255, 255, 0.06);
  --bg-badge: #2a2a2a;

  --text-primary: #f0f0f0;
  --text-secondary: #888888;
  --text-tertiary: #555555;

  --border-primary: rgba(255, 255, 255, 0.08);
  --placeholder-bg: #1c1c1c;
  --placeholder-text: #333333;
  --marquee-text: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] {
  --bg-primary: #f5f5f5;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-tag: rgba(0, 0, 0, 0.05);
  --bg-badge: #e8e8e8;

  --text-primary: #111111;
  --text-secondary: #666666;
  --text-tertiary: #999999;

  --border-primary: rgba(0, 0, 0, 0.08);
  --placeholder-bg: #eeeeee;
  --placeholder-text: #cccccc;
  --marquee-text: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .status-pill {
  background: #ffffff;
}

/* ==========================================
   RESET & BASE
   ========================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Match body so iOS / overscroll doesn’t show a hairline above the page */
  background-color: var(--bg-primary);
  /* hidden + clip: clip avoids the “other axis becomes auto” quirk that breaks position:sticky on .sidebar */
  overflow-x: hidden;
  overflow-x: clip;
}

/* Extra space above section when scrolling to anchor */
#work,
#experience,
#side-projects,
#education {
  scroll-margin-top: 30px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
  overflow-x: clip;
  min-height: 100vh;
  min-height: 100dvh;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity var(--transition-base);
}

a:hover { opacity: 0.7; }
strong { font-weight: 600; }

p {
  font-size: 14px;
}

h4 {
  font-size: 12px;
}

/* ==========================================
   LAYOUT
   ========================================== */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  border-right: 1px solid var(--border-primary);
  overflow: hidden;
}

/* Logo flip card: text on front, photo on back */
.logo-flip {
  display: inline-block;
  cursor: pointer;
  perspective: 520px;
  margin-bottom: 0;
}

.logo-flip-inner {
  position: relative;
  display: inline-block;
  min-height: 72px;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.logo-flip:hover .logo-flip-inner,
.logo-flip.flipped .logo-flip-inner {
  transform: rotateY(180deg);
}

.logo-flip-front,
.logo-flip-back {
  position: relative;
  display: inline-block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.logo-flip-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card, #1a1a1a);
}

.logo-flip-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

.logo-flip-front {
  min-height: 72px;
  display: flex;
  align-items: center;
}

.sidebar-name {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 400;
  line-height: 46px;
  height: fit-content;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.sidebar-role {
  font-family: "Spline Sans Mono";
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-location {
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--bg-tag);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

a.status-pill:hover {
  background: var(--bg-tag);
  color: var(--text-primary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00D54B;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}


@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 213, 75, 0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(0, 213, 75, 0); }
}

/* ==========================================
   MARQUEE (main area)
   ========================================== */

.main-marquee {
  overflow: hidden;
  padding: 0.45rem 0 36px;
  margin-left: calc(-1 * var(--space-lg));
  margin-right: calc(-1 * var(--space-lg));
}

.main-marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 24px;
  width: max-content;
  animation: marquee 35s linear infinite;
  will-change: transform;
}

.marquee-track > span,
.marquee-track > a {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.06em;
}

.marquee-track > a {
  text-decoration: none;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.marquee-item:hover {
  opacity: 1;
  color: var(--text-primary) !important;
}

.marquee-logo {
  height: 1.1rem;
  width: auto;
  opacity: 0.25;
  transition: filter var(--transition-base);
}

[data-theme="dark"] .marquee-logo { filter: invert(1); }

.marquee-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
  opacity: 0.3;
  flex-shrink: 0;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-33.333%); }
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}

.sidebar-nav a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
}

.sidebar-nav a:hover {
  color: var(--text-primary);
  opacity: 1;
}

/* Mobile-only menu control (shown from 768px breakpoint below) */
.nav-burger {
  display: none;
  box-sizing: border-box;
}

.nav-backdrop {
  display: none;
}

.theme-toggle {
  /* Grid centers more reliably than flex inside <button> on iOS/WebKit */
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-primary);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-base), background var(--transition-base);
  margin-top: var(--space-sm);
  flex-shrink: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  /* Kill inherited text metrics: whitespace between SVGs + font: inherit otherwise add a strut and push icons down (esp. WebKit). */
  font-size: 0;
  line-height: 0;
}

.theme-toggle svg {
  display: block;
  grid-area: 1 / 1;
  width: 16px;
  height: 16px;
}

/* Desktop: theme sits under nav links (nav block is already at bottom via margin-top: auto) */
@media (min-width: 769px) {
  .sidebar-nav .theme-toggle {
    margin-top: var(--space-sm);
    align-self: flex-start;
  }
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-tag);
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
html[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
html[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}
html[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* ==========================================
   MAIN
   ========================================== */

.main {
  padding: var(--space-lg);
  overflow-x: hidden;
  min-width: 0;
}

.main > *:not(.main-marquee):not(.work-section):not(.main-hero) {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero: marquee + blurb fill viewport on desktop so first load shows only these */
.main-hero {
  width: 100%;
  position: relative;
}
@media (min-width: 768px) {
  .main-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  /* Blurb + CTA centered in viewport (hero) */
  .main-hero .main-hero-content {
    position: absolute;
    top: 46%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
  }
}
.main-hero .main-hero-content {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.main-hero .main-blurb {
  margin-bottom: var(--space-md);
}

/* Hidden until typewriter starts (avoids flash of full text) */
.main-blurb--loading {
  opacity: 0;
}
.main-blurb--typing {
  opacity: 1;
}

.main-blurb {
  font-family: "SF Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 40px;
  width: auto;
  text-align: left;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
  padding-top: 100px;
  padding-bottom: 100px;
}

/* ==========================================
   BENTO GRID
   ========================================== */

.bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: auto;
  gap: var(--gap);
}

.bento-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bento-card-visual {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--placeholder-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--placeholder-text);
}

.bento-card-body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.bento-card-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.bento-card-sub {
  font-family: "SF Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
}

.bento-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.bento-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: auto;
  padding-top: 8px;
}

.bento-card-stats span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bento-card-stats strong {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 400;
  margin-right: 0.08em;
}

/* ==========================================
   CAROUSEL (Apple-style Selected Work)
   ========================================== */

.work-section {
  margin-bottom: var(--space-xl);
}

.work-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.work-section-head .section-title--work {
  margin: 0;
  line-height: 1;
}

/* Side projects block inside Experience: breathing room + gap under title row */
.work-section--side {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.work-section--side .work-section-head {
  margin-bottom: var(--space-md);
}

.carousel {
  margin-left: calc(-1 * var(--space-lg));
  margin-right: calc(-1 * var(--space-lg));
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-primary);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base), opacity var(--transition-base);
}

.carousel-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-tertiary);
}

.carousel-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--text-tertiary);
}

.carousel-btn--play .carousel-icon-pause {
  display: none;
}

.carousel-btn--play .carousel-icon-play {
  display: block;
}

.carousel-btn--play[data-playing="true"] .carousel-icon-pause {
  display: block;
}

.carousel-btn--play[data-playing="true"] .carousel-icon-play {
  display: none;
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--text-tertiary);
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-base);
}

.carousel-dot:hover {
  background: var(--text-secondary);
}

.carousel-dot[aria-selected="true"] {
  background: var(--text-primary);
  transform: scale(1.25);
}

.carousel-viewport {
  overflow: hidden;
  cursor: grab;
  padding: 12px 20px 32px 20px;
}

.carousel-viewport.is-dragging {
  cursor: grabbing;
}

.carousel-track {
  display: flex;
  gap: var(--gap);
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  margin: -12px -20px -32px -20px;
}

.carousel-slide {
  flex: 0 0 746px;
  min-width: 0;
}

.carousel-slide .bento-card {
  height: 100%;
}

.carousel-slide .bento-card-body {
  padding: var(--space-sm);
  gap: 6px;
  min-width: 0;
}

.carousel-slide .bento-card-title {
  font-size: 24px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.carousel-slide .bento-card-sub {
  font-size: 14px;
}

.carousel-slide .bento-card-desc {
  font-size: 14px;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.carousel-slide .bento-card-visual {
  aspect-ratio: 16 / 10;
}

.carousel-slide .bento-card-stats {
  gap: 16px;
  padding-top: 4px;
}

.carousel-slide .bento-card-stats span {
  font-size: 0.6rem;
}

.carousel-slide .bento-card-stats strong {
  font-size: 24px;
}

/* Selected Work card themes (company colors) – scoped to carousel only */
.carousel-slide .bento-card--cash {
  background: #00b840;
  color: #fff;
}
.carousel-slide .bento-card--cash .bento-card-visual { background: rgba(0, 0, 0, 0.12); }
.carousel-slide .bento-card--cash .bento-card-visual--phones {
  gap: 16px;
  padding: 28px 20px;
}
.carousel-slide .bento-card--cash .phone-mockup {
  background: rgba(255, 255, 255, 0.15);
  border: 3px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}
.carousel-slide .bento-card--cash .bento-card-title { color: #fff; }
.carousel-slide .bento-card--cash .bento-card-sub,
.carousel-slide .bento-card--cash .bento-card-desc { color: rgba(255, 255, 255, 0.9); }
.carousel-slide .bento-card--cash .bento-card-stats span { color: rgba(255, 255, 255, 0.8); }
.carousel-slide .bento-card--cash .bento-card-stats strong { color: #fff; }
.carousel-slide .bento-card--square {
  background: #0a0a0a;
  color: #fff;
}
.carousel-slide .bento-card--square .bento-card-body {
  background: #141414;
}
.carousel-slide .bento-card--square .bento-card-visual { background: rgba(255, 255, 255, 0.12); }

/* Square card: three phone mockups in a row */
.bento-card-visual--phones {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
}
.carousel-slide .bento-card--square .bento-card-visual--phones {
  gap: 16px;
  padding: 28px 20px;
}
.bento-card-visual--phones .phone-mockup {
  flex: 1;
  max-width: min(28%, 160px);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  background: #1a1a1a;
  border: 3px solid rgba(255, 255, 255, 0.08);
}
.bento-card-visual--phones .phone-mockup img {
  width: 100%;
  height: auto;
  display: block;
}

.carousel-slide .bento-card--square .bento-card-title { color: #fff; }
.carousel-slide .bento-card--square .bento-card-sub,
.carousel-slide .bento-card--square .bento-card-desc { color: rgba(255, 255, 255, 0.8); }
.carousel-slide .bento-card--square .bento-card-stats span { color: rgba(255, 255, 255, 0.65); }
.carousel-slide .bento-card--square .bento-card-stats strong { color: #fff; }
.carousel-slide .bento-card--meta {
  background: #1877F2;
  color: #fff;
}
.carousel-slide .bento-card--meta .bento-card-visual { background: rgba(0, 0, 0, 0.15); }
.carousel-slide .bento-card--meta .bento-card-visual--phones {
  gap: 16px;
  padding: 28px 20px;
}
.carousel-slide .bento-card--meta .phone-mockup {
  background: rgba(255, 255, 255, 0.15);
  border: 3px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}
.carousel-slide .bento-card--meta .bento-card-title { color: #fff; }
.carousel-slide .bento-card--meta .bento-card-sub,
.carousel-slide .bento-card--meta .bento-card-desc { color: rgba(255, 255, 255, 0.9); }
.carousel-slide .bento-card--meta .bento-card-stats span { color: rgba(255, 255, 255, 0.8); }
.carousel-slide .bento-card--meta .bento-card-stats strong { color: #fff; }
.carousel-slide .bento-card--ogilvy {
  background: #C41230;
  color: #fff;
}
.carousel-slide .bento-card--ogilvy .bento-card-visual { background: rgba(0, 0, 0, 0.2); }

/* Ogilvy card: embedded YouTube video */
.bento-card-visual--video {
  padding: 0;
  display: block;
}
.bento-card-visual--video iframe {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: block;
  border: none;
}

.carousel-slide .bento-card--ogilvy .bento-card-title { color: #fff; }
.carousel-slide .bento-card--ogilvy .bento-card-sub,
.carousel-slide .bento-card--ogilvy .bento-card-desc { color: rgba(255, 255, 255, 0.9); }
.carousel-slide .bento-card--ogilvy .bento-card-stats span { color: rgba(255, 255, 255, 0.8); }
.carousel-slide .bento-card--ogilvy .bento-card-stats strong { color: #fff; }

/* ==========================================
   SIDE PROJECTS & PROTOTYPES (bento cards, no carousel hover)
   ========================================== */

.carousel-slide .side-project-card {
  height: 100%;
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: none;
}

/* Do not change card background on hover — was forcing Future Proof body to white */
.carousel-slide .side-project-card:hover {
  transform: none;
}

.carousel-slide .side-project-card .bento-card-body {
  padding: var(--space-sm);
  gap: 6px;
  min-width: 0;
}

.carousel-slide .side-project-card .bento-card-title {
  font-size: 24px;
  overflow-wrap: break-word;
  word-wrap: break-word;
  line-height: 1.2;
  color: var(--text-primary);
}

.carousel-slide .side-project-card .bento-card-sub {
  font-size: 14px;
  color: var(--text-tertiary);
}

.carousel-slide .side-project-card .bento-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.side-project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--border-primary);
  background: var(--bg-tag);
  color: var(--text-primary);
  text-decoration: none;
  align-self: flex-start;
  transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base), opacity var(--transition-base);
}

.side-project-link:hover {
  opacity: 0.85;
  background: var(--bg-badge);
}

.side-project-link svg {
  flex-shrink: 0;
}

.carousel-slide .side-project-card .bento-card-visual {
  aspect-ratio: 16 / 10;
}

.side-project-visual {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--placeholder-bg);
}

.side-project-visual--video {
  background: linear-gradient(145deg, #1a1a1a 0%, #0d0d0d 50%, #141414 100%);
}

[data-theme="light"] .side-project-visual--video {
  background: linear-gradient(145deg, #e8e8e8 0%, #d4d4d4 50%, #dedede 100%);
}

.side-project-visual--image {
  background: var(--placeholder-bg);
}

.side-project-visual--devmeetdesign {
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--placeholder-bg);
}

.side-project-visual--devmeetdesign img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
  display: block;
}

.side-project-placeholder-inner {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--placeholder-text);
  opacity: 0.85;
  text-align: center;
  padding: var(--space-md);
}

.side-project-visual--video .side-project-placeholder-inner {
  color: rgba(255, 255, 255, 0.35);
}

[data-theme="light"] .side-project-visual--video .side-project-placeholder-inner {
  color: rgba(0, 0, 0, 0.35);
}

/* Future Proof — only the top media area is brand purple */
.side-project-visual--future-proof {
  background: #5b3df5;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  overflow: hidden;
}

.side-project-visual--future-proof img {
  width: 100%;
  height: 100%;
  max-height: none;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  box-shadow: none;
  display: block;
}

/* Reuse the same “phone frame” look as Selected Work */
.side-project-visual--future-proof .phone-mockup--single {
  flex: 0 0 auto;
  width: min(60%, 240px);
  height: 100%;
  max-width: min(60%, 240px);
  max-height: 100%;
  border-radius: 24px;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.side-project-visual--future-proof .phone-mockup--single img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ==========================================
   EXPERIENCE
   ========================================== */

.experience {
  padding: 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.section-title--work {
  margin: 0;
  line-height: 1;
}

/* Match title-to-content rhythm with carousel section headers */
.experience > .section-title,
#education.section-title {
  line-height: 1;
  margin-bottom: var(--space-md);
}

.exp-grid {
  display: grid;
  gap: var(--gap);
}

.exp-block {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: background var(--transition-base);
}

.exp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.exp-company {
  font-family: "SF Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.exp-date {
  font-family: "SF Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9375rem;
  color: var(--text-tertiary);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.exp-body {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: var(--space-lg);
}

.exp-body .exp-col:last-child {
  padding-right: var(--space-lg);
}

.exp-col h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.exp-role-primary {
  font-weight: 600;
  margin-bottom: 14px;
}

.exp-role-note {
  font-family: var(--font-body);
  font-size: 12px;
  margin-bottom: 32px;
  letter-spacing: 0.01em;
}

.exp-role-secondary {
  font-weight: 600;
  margin-bottom: 14px;
}

/* Role names use theme primary text so they stay readable on dark cards */
.exp-col .exp-role-primary,
.exp-col .exp-role-note,
.exp-col .exp-role-secondary {
  color: var(--text-primary);
}

.exp-col p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exp-tags span {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--bg-tag);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ==========================================
   EDUCATION
   ========================================== */

.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.edu-item {
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  transition: background var(--transition-base);
}

.edu-item h4 {
  font-family: "SF Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
  padding: var(--space-lg) 0;
}

.footer-copyright {
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* ==========================================
   FLOATING ACTION BUTTON (Scroll hint)
   ========================================== */

.fab {
  position: fixed;
  bottom: max(var(--space-md), env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  transition: opacity var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
  max-width: calc(100vw - 2 * var(--space-md));
  box-sizing: border-box;
}

.fab:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.2);
  transform: translateX(-50%) translateY(-2px);
}

.fab:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--text-tertiary);
}

.fab.fab-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}

.fab.fab-levitate {
  animation: fab-levitate 2.8s ease-in-out infinite;
  transition: opacity var(--transition-base), box-shadow var(--transition-base);
  will-change: transform;
}

.fab.fab-levitate:hover {
  animation-play-state: paused;
}

@keyframes fab-levitate {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

.fab-icon {
  flex-shrink: 0;
}

/* ==========================================
   BRAND THEME OVERRIDE
   ========================================== */

body.brand-active {
  transition: background 0.4s ease, color 0.4s ease;
}

body.brand-active .sidebar,
body.brand-active .exp-block,
body.brand-active .edu-item,
body.brand-active .bento-card,
body.brand-active .bento-card-visual {
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

body.brand-active .status-pill {
  background: rgba(255, 255, 255, 0.95);
  color: #0a0a0a;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

.fade-in {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 1024px) {
  .exp-body {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .main {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-primary);
    padding: var(--space-md);
  }

  /* Burger: floating (viewport-fixed), same chrome as theme-toggle */
  .nav-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    position: fixed;
    top: max(var(--space-md), env(safe-area-inset-top));
    right: max(var(--space-md), env(safe-area-inset-right));
    left: auto;
    z-index: 300;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border-primary);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-base), background var(--transition-base);
  }

  .nav-burger:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
  }

  .nav-burger-bar {
    display: block;
    width: 15px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    transform-origin: center;
  }

  html.nav-menu-open .nav-burger-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  html.nav-menu-open .nav-burger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  html.nav-menu-open .nav-burger-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
  }

  html.nav-menu-open .nav-backdrop:not([hidden]) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar-nav {
    flex: none;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    padding: max(var(--space-lg), env(safe-area-inset-top)) var(--space-md) var(--space-lg);
    gap: 4px;
    position: fixed;
    top: 0;
    right: 0;
    width: min(100vw - 2.5rem, 19rem);
    max-width: calc(100vw - 2rem);
    height: 100dvh;
    height: 100vh;
    max-height: 100dvh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-primary);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.2);
    z-index: 210;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.38s;
  }

  html.nav-menu-open .sidebar-nav {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  html.nav-menu-open body {
    overflow: hidden;
    touch-action: none;
  }

  .sidebar-nav a {
    flex-shrink: 0;
    white-space: normal;
    padding: 14px 0;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-primary);
  }

  .sidebar-nav > a:last-of-type {
    border-bottom: none;
    /* Space before theme row (don’t use padding on the 36px circle — it crushes the icon) */
    margin-bottom: var(--space-sm);
  }

  /* Theme toggle inside drawer (bottom; align with burger side) */
  .sidebar-nav .theme-toggle {
    position: relative;
    z-index: 1;
    margin-top: auto;
    margin-bottom: 0;
    /* Never use padding-top here: height is 36px border-box — ~24px padding leaves ~10px for the icon and it sits on the bottom edge. */
    padding: 0;
    align-self: flex-end;
  }

  /* Room for burger (right), same diameter as theme button */
  .sidebar-top {
    padding-right: calc(36px + var(--space-md));
    padding-left: 0;
  }

  /* ----- Mobile intro: logo + blurb first, then full site (soft fades) ----- */
  html {
    /* Long, ease-out–biased curves = gentler fades */
    --mobile-intro-fade-ease: cubic-bezier(0.12, 0.88, 0.32, 1);
    --mobile-intro-fade-slow: cubic-bezier(0.08, 0.82, 0.22, 1);
    --mobile-intro-fade-duration: 1.55s;
    --mobile-intro-marquee-fade: 1.35s;
    /* Light stagger after reveal; 0.5s pause is in JS after typewriter finishes */
    --mobile-intro-delay: 0.18s;
  }

  @keyframes mobile-intro-reveal-soft {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes mobile-intro-reveal-fade {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  /* Intro blurb: ⅓ smaller than desktop (40px → ~26.67px) on mobile */
  .main-blurb {
    font-size: calc(40px * 2 / 3);
    line-height: calc(40px * 2 / 3);
    padding-top: calc(100px * 2 / 3);
    padding-bottom: calc(100px * 2 / 3);
    transition:
      padding-top 1.55s var(--mobile-intro-fade-slow),
      padding-bottom 1.55s var(--mobile-intro-fade-slow),
      margin-bottom 1.55s var(--mobile-intro-fade-slow);
  }

  /* Intro: logo + “Product designer in Vancouver” (role); pill, burger, nav drawer, theme hidden until done */
  html:not(.mobile-intro-done) .sidebar {
    gap: var(--space-sm);
  }

  html:not(.mobile-intro-done) .sidebar-top .status-pill {
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
    pointer-events: none;
    border-width: 0;
  }

  html:not(.mobile-intro-done) .nav-burger {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  html:not(.mobile-intro-done) .theme-toggle {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  html:not(.mobile-intro-done) .fab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(12px);
  }

  html:not(.mobile-intro-done) .main {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding-top: max(var(--space-lg), env(safe-area-inset-top));
    padding-bottom: max(var(--space-md), env(safe-area-inset-bottom));
  }

  html:not(.mobile-intro-done) .main > *:not(.main-hero) {
    display: none;
  }

  html:not(.mobile-intro-done) .main-hero {
    min-height: 0;
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
  }

  html:not(.mobile-intro-done) .main-marquee {
    display: none;
  }

  /* Flush left: full-width intro column so typewriter starts from the left */
  html:not(.mobile-intro-done) .main-hero .main-hero-content {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: none;
    text-align: left;
    align-self: stretch;
  }

  html:not(.mobile-intro-done) .main-blurb {
    text-align: left;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    width: 100%;
  }

  html.mobile-intro-done .main {
    min-height: 0;
  }

  html.mobile-intro-done .sidebar-top .status-pill {
    opacity: 1;
    visibility: visible;
    max-height: 80px;
    margin-top: 12px;
    padding: 6px 14px;
    transition:
      opacity var(--mobile-intro-fade-duration) var(--mobile-intro-fade-ease) calc(var(--mobile-intro-delay) + 0.1s),
      max-height 1.1s var(--mobile-intro-fade-slow) calc(var(--mobile-intro-delay) + 0.08s),
      margin-top 1s var(--mobile-intro-fade-slow) calc(var(--mobile-intro-delay) + 0.06s),
      padding 0.9s var(--mobile-intro-fade-slow) calc(var(--mobile-intro-delay) + 0.06s),
      visibility 0s linear calc(var(--mobile-intro-delay) + 0.1s);
  }

  html.mobile-intro-done .sidebar {
    gap: var(--space-md);
  }

  html.mobile-intro-done .nav-burger {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      opacity 1.2s var(--mobile-intro-fade-ease) calc(var(--mobile-intro-delay) + 0.14s),
      visibility 0s linear calc(var(--mobile-intro-delay) + 0.14s);
  }

  html.mobile-intro-done .theme-toggle {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      opacity 1.2s var(--mobile-intro-fade-ease) calc(var(--mobile-intro-delay) + 0.22s),
      visibility 0s linear calc(var(--mobile-intro-delay) + 0.22s);
  }

  html.mobile-intro-done .fab {
    transition:
      opacity 1.25s var(--mobile-intro-fade-ease) calc(var(--mobile-intro-delay) + 0.28s),
      transform 1.2s var(--mobile-intro-fade-ease) calc(var(--mobile-intro-delay) + 0.24s),
      visibility 0s linear calc(var(--mobile-intro-delay) + 0.24s);
  }

  html.mobile-intro-done .fab:not(.fab-hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  html.mobile-intro-done .main > *:not(.main-hero) {
    animation: mobile-intro-reveal-soft var(--mobile-intro-fade-duration) var(--mobile-intro-fade-ease) both;
    animation-delay: var(--mobile-intro-delay);
  }

  html.mobile-intro-done .main > *:not(.main-hero):nth-child(2) {
    animation-delay: calc(var(--mobile-intro-delay) + 0.07s);
  }

  html.mobile-intro-done .main > *:not(.main-hero):nth-child(3) {
    animation-delay: calc(var(--mobile-intro-delay) + 0.14s);
  }

  html.mobile-intro-done .main > *:not(.main-hero):nth-child(4) {
    animation-delay: calc(var(--mobile-intro-delay) + 0.21s);
  }

  html.mobile-intro-done .main > *:not(.main-hero):nth-child(5) {
    animation-delay: calc(var(--mobile-intro-delay) + 0.28s);
  }

  html.mobile-intro-done .main > *:not(.main-hero):nth-child(6) {
    animation-delay: calc(var(--mobile-intro-delay) + 0.35s);
  }

  html.mobile-intro-done .main-marquee {
    animation: mobile-intro-reveal-fade var(--mobile-intro-marquee-fade) var(--mobile-intro-fade-ease) both;
    animation-delay: calc(var(--mobile-intro-delay) + 0.08s);
  }

  /* Experience + Education: horizontal snap “carousel” (mobile only) */
  .experience .exp-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: var(--gap);
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--space-md);
    -webkit-overflow-scrolling: touch;
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    padding-bottom: 8px;
    scrollbar-width: thin;
  }

  .experience .exp-grid .exp-block {
    flex: 0 0 min(84vw, 420px);
    scroll-snap-align: start;
    max-width: none;
  }

  .experience .edu-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: var(--gap);
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--space-md);
    -webkit-overflow-scrolling: touch;
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    padding-bottom: 8px;
    scrollbar-width: thin;
  }

  .experience .edu-grid .edu-item {
    flex: 0 0 min(74vw, 300px);
    scroll-snap-align: start;
  }

  /* Single-column stack rule from below is superseded by flex on mobile for edu */
  .edu-grid {
    grid-template-columns: unset;
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  html.mobile-intro-done .sidebar,
  html.mobile-intro-done .sidebar-top .status-pill,
  html.mobile-intro-done .nav-burger,
  html.mobile-intro-done .theme-toggle,
  html.mobile-intro-done .fab,
  html.mobile-intro-done .main {
    transition: none !important;
  }

  .sidebar-nav,
  .nav-backdrop,
  .nav-burger-bar {
    transition: none !important;
  }

  html.mobile-intro-done .main > *:not(.main-hero),
  html.mobile-intro-done .main-marquee {
    animation: none !important;
  }

  .main-blurb {
    transition: none !important;
  }
}

@media (max-width: 768px) {
  .carousel {
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
  }

  .carousel-slide {
    flex: 0 0 612px;
  }

  .carousel-slide .bento-card-body {
    padding: var(--space-md);
    gap: 8px;
  }

  .carousel-slide .bento-card-title {
    font-size: 18px;
    line-height: 1.3;
  }

  .carousel-slide .bento-card-sub {
    font-size: 14px;
  }

  .carousel-slide .bento-card-desc {
    font-size: 14px;
  }

  .carousel-slide .bento-card-stats strong {
    font-size: 24px;
  }

  .carousel-slide .bento-card-stats {
    gap: 8px;
  }
}

/* Single-column bento only on small phones; tablet keeps 2 columns */
@media (max-width: 600px) {
  .bento {
    grid-template-columns: 1fr;
  }

  .carousel-slide .side-project-card .bento-card-title {
    font-size: 29px;
    line-height: 1.35;
  }

  .carousel-slide .side-project-card .bento-card-body {
    padding: var(--space-md);
    gap: 8px;
  }

  .carousel-slide {
    flex: 0 0 min(497px, calc(100vw - 2 * var(--space-md)));
  }

  .carousel-slide .bento-card-body {
    padding: var(--space-md);
    gap: 8px;
  }

  .carousel-slide .bento-card-title {
    font-size: 29px;
    line-height: 1.35;
  }

  .carousel-slide .bento-card-sub {
    font-size: 14px;
  }

  .carousel-slide .bento-card-desc {
    font-size: 14px;
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }

  .carousel-slide .bento-card-stats strong {
    font-size: 24px;
  }

  .carousel-slide .bento-card-stats span {
    font-size: 0.55rem;
  }

  .carousel-slide .bento-card-stats {
    gap: 8px;
  }
}

/* ==========================================
   PHONE CALL OVERLAY
   ========================================== */

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  /* Never block page interaction unless visible */
  pointer-events: none;
  transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.call-overlay[hidden] {
  display: none !important;
}

.call-overlay.call-visible {
  background: rgba(0, 0, 0, 0.85);
  pointer-events: auto;
}

.call-dialog {
  /* Don't cover the whole screen — let backdrop clicks hit .call-overlay */
  position: static;
  width: 0;
  height: 0;
  pointer-events: auto;
}

/* Screens are centered individually so the incoming pill is truly centered */
.call-screen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  z-index: 10000;
}

.call-screen[hidden] {
  display: none !important;
}

.call-screen--incoming {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(-160px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s,
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}

.call-overlay.call-visible .call-screen--incoming {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

/* Incoming call pill */
.call-pill {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(58, 58, 60, 0.92);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: 60px;
  padding: 10px 14px 10px 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  min-width: 340px;
  /* Make sure it visually reads as centered */
  margin-left: auto;
  margin-right: auto;
}

.call-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 35%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.call-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.call-label {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
  line-height: 1.2;
}

.call-name {
  font-family: var(--font-body);
  font-size: 17px;
  color: #fff;
  font-weight: 600;
  line-height: 1.3;
}

.call-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.call-note {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--bg-tag);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  max-width: min(520px, calc(100vw - 48px));
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 3s;
}

.call-overlay.call-visible .call-note {
  opacity: 1;
  transform: translateY(0);
}

.call-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  font-size: 0;
  line-height: 0;
  position: relative;
  z-index: 3;
}

.call-btn:hover {
  transform: scale(1.1);
  filter: brightness(1.15);
}

.call-btn:active {
  transform: scale(0.95);
}

.call-btn--decline {
  background: #FF3B30;
  color: #fff;
}

.call-btn--accept {
  background: #34C759;
  color: #fff;
  box-shadow: 0 10px 26px rgba(52, 199, 89, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
  /* Wiggle the icon so hover scale works */
}

.call-btn--accept svg {
  /* Match the “phone up” diagonal style */
  transform: rotate(15deg);
  animation: call-wiggle-icon 1.2s ease-in-out infinite;
  transform-origin: 50% 50%;
}

@keyframes call-wiggle-icon {
  0%, 100% { transform: rotate(15deg) rotate(0deg); }
  5% { transform: rotate(15deg) rotate(12deg); }
  10% { transform: rotate(15deg) rotate(-10deg); }
  15% { transform: rotate(15deg) rotate(14deg); }
  20% { transform: rotate(15deg) rotate(-8deg); }
  25% { transform: rotate(15deg) rotate(10deg); }
  30% { transform: rotate(15deg) rotate(-6deg); }
  35% { transform: rotate(15deg) rotate(4deg); }
  40%, 100% { transform: rotate(15deg) rotate(0deg); }
}

/* Message screen */
.call-screen--message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  opacity: 0;
  transform: translate(-50%, -50%) translateY(28px) scale(0.98);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Smooth screen-to-screen transition */
.call-overlay.call-message-open .call-screen--incoming {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(10px) scale(0.98);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.call-overlay.call-message-open .call-screen--message {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0) scale(1);
}

/* Smooth close: dialog out first, then backdrop */
.call-overlay.call-closing .call-screen {
  opacity: 0 !important;
  transform: translate(-50%, -50%) translateY(20px) scale(0.98) !important;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.call-message-card {
  background: rgba(58, 58, 60, 0.92);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: 20px;
  padding: 28px 32px;
  max-width: 420px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 1;
}

.call-message-text {
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}

.call-message-email {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  transition: border-color 0.2s ease;
}

.call-message-email:hover {
  opacity: 1;
  border-color: #fff;
}

.call-btn--close-msg {
  background: #FF3B30;
  color: #fff;
  width: 48px;
  height: 48px;
}

/* Incoming screen exit */
.call-screen--incoming.call-exiting {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (max-width: 480px) {
  .call-pill {
    min-width: 0;
    width: calc(100vw - 48px);
  }

  .call-message-card {
    max-width: calc(100vw - 48px);
    padding: 22px 20px;
  }
}
