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

:root {
  --plum: #8052ff;
  --amber: #ffb829;
  --lichen: #15846e;
  --bone: #ffffff;
  --smoke: #9a9a9a;
  --ash: #bdbdbd;
}

html { scroll-behavior: smooth; }

body {
  background: #fff;
  color: #0a0a0a;
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  cursor: none;
}

/* ── Page wrapper with dashed side borders ── */
#page-wrapper {
  max-width: 56rem; /* ~5xl */
  margin: 0 auto;
  border-left: 1px dashed rgba(0, 0, 0, 0.15);
  border-right: 1px dashed rgba(0, 0, 0, 0.15);
  min-height: 100vh;
  position: relative;
  background: #fff;
}

/* ── Custom cursor ── */
#cursor-dot {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--plum);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s;
}
#cursor-ring {
  position: fixed;
  width: 36px; height: 36px;
  border: 1.5px solid var(--plum);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  opacity: 0.7;
}
body:has(a:hover) #cursor-ring,
body:has(button:hover) #cursor-ring {
  width: 56px; height: 56px;
  opacity: 0.4;
}

/* ── Hero — animation-only classes (layout/color handled by Tailwind in HTML) ── */
.hero-headline .name-line {
  display: block;
  overflow: hidden;
}
.hero-headline .name-inner {
  display: block;
  transform: translateY(110%);
}

/* ── Rotating titles ── */
#hero-title-text {
  position: relative;
  display: inline-block;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#hero-title-text.cycling-out {
  opacity: 0;
  transform: translateY(-6px);
}
#hero-title-text.cycling-in {
  opacity: 0;
  transform: translateY(6px);
}

/* ── CTA hover transitions (state changes only) ── */
.cta-primary  { transition: background 0.2s ease; }
.cta-primary:hover  { background: #1a1a1a; }
.cta-secondary { transition: border-color 0.2s ease; }
.cta-secondary:hover { border-color: #0a0a0a; }

/* ── 3D tilt card ── */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.08s ease-out, box-shadow 0.3s ease;
  will-change: transform;
  cursor: default;
}
.tilt-card:hover {
  box-shadow: 0 30px 80px rgba(128,82,255,0.18);
}
.tilt-inner {
  transform: translateZ(24px);
}

/* ── Stat items ── */
.stat-num {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
}
.stat-label {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--smoke);
  margin-top: 4px;
}

/* ── Section title ── */
.section-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--plum);
  margin-bottom: 14px;
}
.section-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(38px, 5.5vw, 78px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: #fff;
}

/* ── Three.js mini scene (kept in case referenced elsewhere) ── */
#mini-scene {
  width: 100%;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
}
#mini-scene canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ── Timeline — dot & line only; layout/type handled by Tailwind ── */
.tl-item { opacity: 0; transform: translateX(-30px); }
.tl-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
  margin-top: 6px;
}
.tl-dot.active { background: var(--plum); border-color: var(--plum); }
.tl-line {
  width: 1px;
  background: rgba(255,255,255,0.1);
  flex: 1;
  margin: 8px 0;
  min-height: 40px;
  align-self: stretch;
}

/* ── Marquee / contact section ── */
#contact-section {
  position: relative;
  overflow: hidden;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 18s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-item {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(52px, 8vw, 110px);
  letter-spacing: -0.04em;
  line-height: 0.88;
  color: transparent;
  -webkit-text-stroke: 1px rgba(0,0,0,0.12);
  white-space: nowrap;
  padding-right: 60px;
  transition: -webkit-text-stroke 0.3s ease, color 0.3s ease;
  user-select: none;
}
#marquee-zone:hover .marquee-item {
  -webkit-text-stroke: 1px rgba(128,82,255,0.55);
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Floating photo on marquee hover — circle ── */
#hover-photo {
  position: fixed;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  z-index: 9990;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.23,1,0.32,1);
  border: 2px solid rgba(128,82,255,0.35);
  box-shadow: 0 8px 40px rgba(128,82,255,0.15);
}
#hover-photo.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
#hover-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

/* ── Contact links ── */
.contact-link {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9a9a9a;
  text-decoration: none;
  transition: color 0.2s ease;
}
.contact-link:hover { color: #0a0a0a; }

/* ══════════════════════════════════════
   SKILLS — only what Tailwind can't do
══════════════════════════════════════ */

/* Marquee scroll keyframe */
@keyframes skills-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.skills-marquee-track {
  animation: skills-scroll 28s linear infinite;
}

/* Word-lighting: default dim, .lit = dark. Transition can't be done with Tailwind alone */
#skills-quote span {
  color: #ccc;
  transition: color 0.15s ease;
}
#skills-quote span.lit {
  color: #0a0a0a;
}

/* ══════════════════════════════════════
   GLOBE SECTION
══════════════════════════════════════ */
#globe-section {
  background: #000;
}

#globe-canvas-wrap {
  position: relative;
  width: 100%;
  height: 520px;
  overflow: hidden;
  background: #000;
  cursor: grab;
}
#globe-canvas-wrap:active { cursor: grabbing; }

#globe-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Floating stat nodes */
.globe-node {
  position: absolute;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.globe-node.visible { opacity: 1; }

.globe-node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--plum);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(128,82,255,0.25);
}

.globe-node-card {
  background: rgba(10,10,10,0.85);
  border: 1px solid rgba(128,82,255,0.4);
  border-radius: 10px;
  padding: 8px 14px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.globe-node-value {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  letter-spacing: -0.02em;
}
.globe-node-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--smoke);
}

/* Drag hint */
#globe-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
  transition: opacity 0.5s ease;
}
#globe-hint.hidden { opacity: 0; }

/* 3-col value props */
#globe-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255,255,255,0.07);
}

.globe-col {
  padding: 40px 36px;
  border-right: 1px solid rgba(255,255,255,0.07);
}
.globe-col:last-child { border-right: none; }

.globe-col-icon {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--plum);
  margin-bottom: 20px;
}

.globe-col-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 10px;
}

.globe-col-body {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ash);
}

/* ── Section indicator pill ── */
#section-pill {
  position: fixed;
  top: 0;
  /* JS will set right to align with page-wrapper edge on desktop */
  background: var(--plum);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 16px;
  z-index: 500;
  white-space: nowrap;
  overflow: hidden;
  border-radius: 0;
}

#section-pill-label {
  display: inline-block;
  overflow: hidden;
  max-width: 200px;
  vertical-align: middle;
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  #section-pill {
    right: 0 !important; /* override JS — flush to viewport right on mobile */
    border-radius: 0 0 0 8px; /* bottom-left radius only */
    font-size: 10px;
  }
}

/* ── About section ── */
#about { background: #fff; }

.about-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.about-heading {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: -0.04em;
  color: #0a0a0a;
  line-height: 1;
  margin-bottom: 32px;
}

.about-body {
  font-size: 15px;
  line-height: 1.8;
  color: #555;
  max-width: 580px;
  margin-bottom: 20px;
}
.about-body:last-child { margin-bottom: 0; }

/* Polaroid photo cluster */
.about-photos {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 380px;
  margin-top: 16px;
}

.polaroid {
  position: absolute;
  background: #fff;
  padding: 6px 6px 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.08);
  border-radius: 12px;
  width: 220px;
  cursor: pointer;
}
.polaroid img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: top;
  display: block;
  border-radius: 8px;
}
.polaroid-caption {
  display: block;
  text-align: center;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  color: #888;
  margin-top: 10px;
  letter-spacing: 0.02em;
}

/* ── Resting positions — left is UNDER right ── */
.polaroid-left {
  transform: rotate(-5deg);
  left: 50%;
  margin-left: -160px;
  bottom: 0;
  z-index: 1;  /* beneath right */
}
.polaroid-right {
  transform: rotate(4deg);
  left: 50%;
  margin-left: -60px;
  bottom: 20px;
  z-index: 2;  /* on top by default */
}

/* ──────────────────────────────────────────────
   LEFT POLAROID KEYFRAME
   0–40%  : slide left (still under right, z:1)
   50%    : z-index flips to 3 (mid-travel, invisible moment)
   60–100%: slide back home on top (z:3)
   
   The animation fills forwards while hovered,
   and plays in reverse on mouse-leave.
────────────────────────────────────────────── */
@keyframes polaroid-left-hover {
  0% {
    transform: rotate(-5deg) translateX(0);
    z-index: 1;
    box-shadow: 0 8px 40px rgba(0,0,0,0.13);
  }
  40% {
    transform: rotate(-8deg) translateX(-52px);
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  }
  /* z-index jumps here — mid-slide where cards don't overlap */
  50% {
    transform: rotate(-8deg) translateX(-52px);
    z-index: 3;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  }
  100% {
    transform: rotate(-5deg) translateX(0);
    z-index: 3;
    box-shadow: 0 14px 50px rgba(0,0,0,0.16);
  }
}

/* Left: slides out to the left on hover — driven by .active class (JS-controlled) */
.polaroid-left.active {
  animation: polaroid-left-hover 0.55s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* On mouse-leave, play the same keyframes in reverse so it
   smoothly retreats and z-index drops back to 1 at the end */
.polaroid-left.leaving {
  animation: polaroid-left-hover 0.55s cubic-bezier(0.23, 1, 0.32, 1) reverse forwards;
}

/* ── Right: subtle scale-up on hover ── */
.polaroid-right {
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.35s ease;
}
.polaroid-right:hover {
  transform: rotate(4deg) scale(1.05);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

@media (max-width: 768px) {
  .about-photos { height: 300px; }
  .polaroid { width: 170px; }
  .polaroid img { height: 190px; }
  .polaroid-left  { margin-left: -130px; }
  .polaroid-right { margin-left: -40px; }
}

/* ── Section spacing ── */
.section { padding: 100px 48px; }

/* ── Scroll reveal utility ── */
.reveal { opacity: 0; transform: translateY(32px); }

/* ── Three.js canvas inside mini scene ── */
#mini-scene-canvas { border-radius: 16px; }

/* ── Hairline divider ── */
.divider { width: 100%; height: 1px; background: rgba(255,255,255,0.07); }

/* ── Link arrow ── */
.project-link {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plum);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  transition: gap 0.2s ease;
}
.project-link:hover { gap: 10px; }

/* ── Preloader ── */
#preloader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}
#preloader-name {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 5vw, 56px);
  letter-spacing: -0.04em;
  color: #fff;
  overflow: hidden;
}
#preloader-bar {
  width: 120px;
  height: 1px;
  background: rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}
#preloader-bar::after {
  content: '';
  position: absolute;
  left: -100%;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--plum);
  animation: bar-load 1.1s cubic-bezier(0.76,0,0.24,1) forwards;
}
@keyframes bar-load { to { left: 100%; } }

@keyframes scroll-bar { 0%{top:-100%} 50%{top:0%} 100%{top:100%} }

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .tilt-card { transition: none; }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .section { padding: 72px 24px; }
  body { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none; }
  #page-wrapper {
    border-left: none;
    border-right: none;
  }
  #globe-canvas-wrap { height: 340px; }
  #globe-section { padding-top: 48px; padding-bottom: 48px; }
  #globe-cols { grid-template-columns: 1fr; }
  .globe-col { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.07); }
  .globe-col:last-child { border-bottom: none; }
}