/* ---------- Reset & tokens ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #050505;
  --bg-alt: #0c0c0d;
  --panel: #111113;
  --text: #f5f5f7;
  --text-dim: #a1a1a6;
  --text-faint: #6e6e73;
  --line: rgba(255,255,255,0.08);
  --accent: #ffb454;
  --accent-2: #ffd18a;
  --accent-soft: rgba(255,180,84,0.14);
  --glass-bg: rgba(255,255,255,0.045);
  --glass-border: rgba(255,255,255,0.09);
  --glass-blur: 18px;
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, video { max-width: 100%; display: block; }

::selection { background: var(--accent); color: #050505; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Nav (floating glass pill) ---------- */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(1200px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(5,5,5,0.55);
  border: 1px solid var(--line);
  border-radius: 100px;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.scrolled {
  background: rgba(5,5,5,0.78);
}
.nav-logo {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links.is-open {
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}
.nav-cv {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 100px;
  background: var(--text);
  color: #050505;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
  white-space: nowrap;
}
.nav-cv:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 22px; height: 22px;
  background: none; border: none; cursor: pointer;
}
.nav-toggle span {
  height: 1.5px; width: 100%;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 140px 5vw 80px;
  text-align: center;
  overflow: hidden;
  background: var(--bg);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.hero::before {
  width: 520px; height: 520px;
  top: -120px; left: -120px;
  background: radial-gradient(circle, rgba(255,180,84,0.22), transparent 70%);
}
.hero::after {
  width: 420px; height: 420px;
  bottom: -140px; right: -100px;
  background: radial-gradient(circle, rgba(255,209,138,0.16), transparent 70%);
}

.hero-copy {
  position: relative;
  z-index: 3;
  max-width: 780px;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.hero.is-interacting .hero-copy {
  opacity: 0;
  transform: translateY(-14px) scale(0.98);
  pointer-events: none;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 68% 60% at 50% 40%,
    rgba(5,5,5,0.72) 0%, rgba(5,5,5,0.42) 55%, rgba(5,5,5,0.1) 78%, transparent 100%);
  transition: opacity 0.5s var(--ease);
}
.hero.is-interacting .hero-scrim { opacity: 0.15; }

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 18px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.8s var(--ease) 0.1s forwards;
}

.hero h1 {
  font-size: clamp(48px, 9vw, 104px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-bottom: 24px;
  background: linear-gradient(120deg, var(--text) 30%, var(--accent-2) 70%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translateY(24px);
  animation: rise 0.9s var(--ease) 0.25s forwards;
}

.hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 40px;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.9s var(--ease) 0.55s forwards;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.9s var(--ease) 0.7s forwards;
}

@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 30px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.btn-primary {
  background: var(--text);
  color: #050505;
}
.btn-primary:hover { transform: translateY(-2px); background: var(--accent-2); }
.btn-ghost {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.btn-lg { padding: 16px 38px; font-size: 16px; margin-top: 44px; }

/* ---------- 3D Cylinder Carousel (hero background) ---------- */
.carousel-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.carousel-stage {
  --panel-w: min(83vw, 1250px);
  --panel-h: min(83vh, 810px);
  /* Radius tuned close to the panel width so the six panels tile the
     ring with almost no gap, and perspective tuned close to the radius
     itself — the camera sits nearly at the ring's own wall, which is
     what makes this read as "standing at the center of a cylinder"
     instead of "looking at a carousel from outside". */
  --radius-3d: calc(var(--panel-w) * 0.96);
  width: 100%;
  height: 100%;
  perspective: calc(var(--radius-3d) * 1.12);
  perspective-origin: 50% 46%;
  position: absolute;
  inset: 0;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}
.carousel-stage:active { cursor: grabbing; }

/* Light lens dressing only — just enough falloff at the far corners to
   feel like a lens rather than a flat screen. Kept deliberately subtle
   so the side panels stay readable and the wraparound is visible. */
.carousel-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse 92% 90% at 50% 46%, transparent 66%, rgba(0,0,0,0.32) 100%);
}
.carousel-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    radial-gradient(ellipse 36% 26% at 38% 22%, rgba(255,255,255,0.1), transparent 70%),
    radial-gradient(ellipse 92% 90% at 50% 46%, transparent 0 66%, rgba(255,90,60,0.05) 84%, rgba(70,150,255,0.07) 96%, transparent 100%);
  mix-blend-mode: screen;
}

/* Pushes the whole ring back by its own radius, so the active panel
   (now facing inward, see .cylinder-panel) sits right at the screen
   plane (close, large) while the rest of the ring curves away to
   either side — combined with the tight perspective above, this puts
   the viewpoint essentially inside the ring rather than outside it. */
.cylinder-anchor {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--radius-3d) * -1));
}

.cylinder {
  position: absolute;
  top: 50%; left: 50%;
  width: var(--panel-w);
  height: var(--panel-h);
  margin: calc(var(--panel-h) / -2) 0 0 calc(var(--panel-w) / -2);
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.9s var(--ease);
}

.cylinder-panel {
  position: absolute;
  inset: 0;
  /* Same ring position as before (rotateY(i*60) translateZ(radius)), plus a
     180deg flip so each panel's face points inward at the ring's center
     instead of outward — the view is now from inside the cylinder looking
     out at its wall. backface-visibility must stay visible since we're
     intentionally showing the flipped side; .panel-media below mirrors the
     content back so text/video don't render backwards. */
  transform: rotateY(calc(var(--i) * 60deg)) translateZ(var(--radius-3d)) rotateY(180deg);
  backface-visibility: visible;
}

.panel-media {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  opacity: 0.86;
  filter: brightness(0.8) saturate(0.9);
  /* scaleX(-1) undoes the mirroring from the panel's rotateY(180) flip above */
  transform: scaleX(-1) scale(0.96);
  transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease, border-color 0.3s var(--ease);
}

.cylinder-panel.is-active .panel-media {
  opacity: 1;
  filter: brightness(1) saturate(1) blur(0);
  transform: scaleX(-1) scale(1);
  border-color: rgba(255,180,84,0.3);
}

.panel-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.65) 100%);
  z-index: 1;
}

.panel-label {
  position: relative;
  z-index: 2;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}

.panel-media--1 { background: linear-gradient(135deg, #3a2a1c, #7a4a24); }
.panel-media--2 { background: linear-gradient(135deg, #2a2230, #6a3f6b); }
.panel-media--3 { background: linear-gradient(135deg, #1f2a28, #2f6a5c); }
.panel-media--4 { background: linear-gradient(135deg, #2c2018, #8a5a2c); }
.panel-media--5 { background: linear-gradient(135deg, #241f2e, #513a7a); }
.panel-media--6 { background: linear-gradient(135deg, #201f1a, #6b5a2c); }

.carousel-controls {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.35s var(--ease);
}
.hero.is-interacting .carousel-controls { opacity: 0.4; }

/* Tap/click ripple, spawned at the pointer position when dragging or
   tapping the carousel — shape differs by input type so touch feels
   soft/broad and mouse feels precise. */
.tap-ripple {
  position: absolute;
  z-index: 4;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.3);
  background: radial-gradient(circle, rgba(255,180,84,0.35), transparent 70%);
  border: 1px solid rgba(255,180,84,0.75);
  animation: tapRipple 0.6s var(--ease) forwards;
}
.tap-ripple--touch {
  width: 90px;
  height: 90px;
  border-color: rgba(255,255,255,0.5);
}
.tap-ripple--mouse {
  width: 44px;
  height: 44px;
}
@keyframes tapRipple {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(1.7); opacity: 0; }
}

.carousel-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}
.carousel-arrow svg { width: 18px; height: 18px; }
.carousel-arrow:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.carousel-dots {
  display: flex;
  gap: 10px;
}
.carousel-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--line);
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, transform 0.3s ease;
}
.carousel-dots button.is-active {
  background: var(--accent);
  transform: scale(1.3);
}

/* ---------- Sections ---------- */
.section {
  padding: 140px 5vw;
  position: relative;
}
.section-alt { background: var(--bg-alt); }
.section-inner { max-width: 1160px; margin: 0 auto; }

.section-tag {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 56px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: start;
}
.about-lead {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.about-details {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 40px;
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
}
.about-details p {
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 32px;
}
.about-facts li {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.about-facts li:last-child { border-bottom: 1px solid var(--line); }
.about-facts span {
  color: var(--text-faint);
  min-width: 140px;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.skill-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 34px 30px;
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.skill-card:hover { transform: translateY(-4px); border-color: rgba(255,180,84,0.35); }
.skill-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}
.skill-card p {
  font-size: 14.5px;
  color: var(--text-dim);
}

.tools { margin-top: 64px; }
.tools-label {
  font-size: 0.8rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}
.tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tools-list span {
  font-size: 0.78rem;
  padding: 6px 13px;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  color: var(--text-dim);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), rgba(255,255,255,0.06));
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  padding-bottom: 28px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -28px; top: 6px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-year {
  font-size: 14px;
  color: var(--text-faint);
  font-weight: 500;
  padding-top: 4px;
}
.timeline-body {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 26px 30px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.timeline-body:hover { border-color: rgba(255,180,84,0.3); transform: translateX(4px); }
.timeline-body h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 4px;
}
.timeline-org {
  font-size: 14px;
  color: var(--accent-2);
  margin-bottom: 10px;
}
.timeline-body p:last-child {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.7;
  max-width: 640px;
}

/* Contact */
.section-contact {
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  padding-bottom: 160px;
}
.section-contact::before {
  content: "";
  position: absolute;
  top: -50%; left: 50%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  transform: translateX(-50%);
  pointer-events: none;
}
.section-contact .section-inner { position: relative; z-index: 1; }
.contact-title {
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 44px;
}
.contact-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}
.contact-link {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  padding: 18px 26px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.contact-link:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* Footer */
.footer {
  padding: 32px 5vw;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .timeline-item { grid-template-columns: 100px 1fr; }
  .carousel-stage { --panel-w: min(83vw, 620px); --panel-h: min(78vh, 490px); }
  .carousel-controls { bottom: 16px; }
}

@media (max-width: 560px) {
  .skills-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .nav-cv { display: none; }
  .carousel-stage { --panel-w: min(90vw, 410px); --panel-h: min(66vh, 350px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { transition: none; opacity: 1; transform: none; }
  .eyebrow, .hero h1, .hero-sub, .hero-actions {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .tap-ripple { display: none; }
}
