:root {
  --accent: #9aa6b2;
  --accent-2: #c7d2da;
  --highlight: #d96a1a;
}
html,
body {
  height: 100%;
}
/* desktop: page itself never scrolls — only the slider container does */
@media (min-width: 768px) {
  html,
  body {
    overflow: hidden;
  }
}
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   PAGE LOADER (splash on every refresh / first visit)
=========================== */
#pageLoader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, #1f2937, #0a0e17 70%);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#pageLoader.loader-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#pageLoader .loader-ring {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  border: 3px solid rgba(217, 106, 26, 0.18);
  border-top-color: #d96a1a;
  animation: loaderSpin 0.85s linear infinite;
}
#pageLoader .loader-logo {
  position: absolute;
  width: 26px;
  height: 26px;
  color: #f2a154;
  animation: loaderPulse 1.4s ease-in-out infinite;
}
#pageLoader .loader-text {
  position: absolute;
  top: calc(50% + 48px);
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
@keyframes loaderSpin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes loaderPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.7;
  }
}

.contact-icon {
  width: 36px;
  height: 36px;
  filter: invert(1);
}

.skill-icon {
  width: 36px;
  height: 36px;
}

/* GLOBAL TRANSITION FOR THEME */
.theme-transition * {
  transition: background-color 0.55s ease, color 0.55s ease,
    border-color 0.45s ease, fill 0.45s ease;
}

/* page load fade */
body {
  opacity: 0;
  animation: pageFade 0.9s ease forwards 0.05s;
}
@keyframes pageFade {
  to {
    opacity: 1;
  }
}

/* reveal slide-up */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  will-change: transform, opacity;
}
.reveal.show {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* content scale effect on toggle */
.fade-scale {
  transition: transform 0.36s ease, opacity 0.36s ease;
  transform-origin: center;
}
.fade-scale-enter {
  transform: scale(0.985);
  opacity: 0.92;
}

/* icon animation */
.icon-rotate {
  transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.4s ease;
}
.icon-hidden {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
  position: absolute;
}
.icon-visible {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  position: relative;
}

/* glow background layers */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.glow-sun {
  background: radial-gradient(
    circle at 20% 30%,
    rgba(255, 223, 120, 0.55),
    rgba(255, 200, 120, 0.12) 25%,
    transparent 45%
  );
  transition: opacity 0.6s ease-out;
}
.glow-moon {
  background: radial-gradient(
    circle at 80% 70%,
    rgba(120, 180, 255, 0.38),
    rgba(80, 120, 220, 0.08) 35%,
    transparent 60%
  );
  transition: opacity 1.2s ease-in-out;
}
.glow-show {
  opacity: 1;
}

/* project card hover tilt */
.card-tilt {
  transform-style: preserve-3d;
  transition: transform 320ms cubic-bezier(0.2, 0.9, 0.2, 1), box-shadow 320ms;
  will-change: transform, box-shadow;
}
.card-tilt:hover {
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
  transform: translateY(-6px) rotateX(6deg) rotateY(-6deg) scale(1.01);
}

/* small polish */
a {
  color: inherit;
  text-decoration: none;
}
.mono {
  font-family: "Roboto Mono", monospace;
}
.logo-anim {
  transform-origin: center;
  transition: transform 1s cubic-bezier(0.2, 0.9, 0.2, 1);
}

/* ===========================
   VISUAL REFRESH ADD-ONS
=========================== */

/* selection + scrollbar polish */
::selection {
  background: rgba(217, 106, 26, 0.35);
  color: inherit;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(154, 166, 178, 0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 106, 26, 0.5);
  background-clip: padding-box;
}

/* gradient text for headline name */
.gradient-text {
  background: linear-gradient(90deg, #d96a1a, #f2a154 45%, #d96a1a);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 6s ease-in-out infinite;
}
@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

/* frosted glass card */
.glass-card {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  isolation: isolate;
}
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    140deg,
    rgba(217, 106, 26, 0.35),
    rgba(255, 255, 255, 0.06) 35%,
    rgba(255, 255, 255, 0.02) 60%,
    rgba(217, 106, 26, 0.18)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

/* sticky glass header */
.header-glass {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* primary gradient button */
.btn-primary {
  background: linear-gradient(135deg, #f2a154, #d96a1a 70%);
  color: #1a1206;
  box-shadow: 0 8px 24px -6px rgba(217, 106, 26, 0.55);
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 220ms ease, filter 220ms ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -6px rgba(217, 106, 26, 0.65);
  filter: brightness(1.05);
}
.btn-primary:active {
  transform: translateY(0);
}

/* stat chip refresh */
.stat-chip {
  background: linear-gradient(
    135deg,
    rgba(217, 106, 26, 0.12),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid rgba(217, 106, 26, 0.18);
  transition: transform 220ms ease, border-color 220ms ease;
}
.stat-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 106, 26, 0.4);
}

/* contact / skill chip hover lift */
.chip-hover {
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1),
    background-color 220ms ease, border-color 220ms ease;
}
.chip-hover:hover {
  transform: translateY(-3px) scale(1.04);
}

/* tech badge used inside project cards */
.badge-tech {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.02em;
  background: rgba(217, 106, 26, 0.12);
  border: 1px solid rgba(217, 106, 26, 0.25);
  color: var(--highlight);
}

/* project card accent top border + glow on hover */
.project-card {
  position: relative;
  overflow: hidden;
}
.project-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #d96a1a, #f2a154);
  opacity: 0.85;
}
.project-card::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -80px;
  top: -80px;
  background: radial-gradient(
    circle,
    rgba(217, 106, 26, 0.16),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 320ms ease;
  pointer-events: none;
}
.project-card:hover::before {
  opacity: 1;
}

/* experience timeline */
.timeline-item {
  position: relative;
  padding-left: 22px;
  border-left: 2px solid rgba(217, 106, 26, 0.25);
}
.timeline-item:last-child {
  border-left-color: transparent;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d96a1a;
  box-shadow: 0 0 0 4px rgba(217, 106, 26, 0.18);
}

/* section eyebrow label */
.eyebrow {
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--highlight);
}

/* ===========================
   MOBILE BOTTOM NAV (native-app style)
=========================== */
.bottom-nav {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(217, 106, 26, 0.15);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.12), 0 2px 10px rgba(2, 6, 23, 0.06);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-radius: 24px;
}
html.dark .bottom-nav {
  background: rgba(17, 24, 39, 0.82);
  border-color: rgba(217, 106, 26, 0.22);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 2px 7px;
  background: transparent;
  border: none;
  color: #9aa6b2;
  font-family: "Roboto Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
  transition: color 220ms ease, transform 180ms ease;
}
.nav-item:active {
  transform: scale(0.92);
}

.nav-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 24px;
  border-radius: 999px;
  transition: background-color 260ms cubic-bezier(0.2, 0.9, 0.2, 1),
    color 260ms ease, transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.active {
  color: #d96a1a;
}
.nav-item.active .nav-icon-wrap {
  background: rgba(217, 106, 26, 0.14);
  transform: translateY(-1px) scale(1.06);
}
html.dark .nav-item.active .nav-icon-wrap {
  background: rgba(217, 106, 26, 0.2);
}
.nav-item.active .nav-label {
  font-weight: 600;
}

/* floating pill bar, inset from screen edges instead of edge-to-edge */
#bottomNav {
  left: 20px;
  right: 20px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  max-width: 320px;
  margin: 0 auto;
}

/* scroll-to-top button */
#scrollTopBtn {
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  transition: opacity 260ms ease, transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media (min-width: 768px) {
  #scrollTopBtn {
    bottom: 24px;
  }
}
.scroll-top-hide {
  opacity: 0;
  transform: scale(0.6) translateY(12px);
  pointer-events: none;
}

/* ===========================
   DESKTOP FULLPAGE SLIDER
=========================== */
.slider-container {
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.slider-container::-webkit-scrollbar {
  display: none;
}

.slide-section {
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 8px;
  overflow-y: auto;
  /* intentionally no overscroll-behavior:contain — a slide's own inner
     scroll should hand off to the slider once it hits its scroll edge,
     so wheel/trackpad/drag keeps moving to the next section */
  cursor: grab;
}
.slide-section:active {
  cursor: grabbing;
}

.slide-inner {
  width: 100%;
}

.slider-dots {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.slide-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(154, 166, 178, 0.35);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background-color 260ms ease, transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1),
    height 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.slide-dot:hover {
  background: rgba(217, 106, 26, 0.5);
  transform: scale(1.2);
}
.slide-dot.active {
  background: #d96a1a;
  height: 26px;
  box-shadow: 0 0 0 4px rgba(217, 106, 26, 0.15);
  transform: none;
}
.slide-dot-tip {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}
.slide-dot:hover .slide-dot-tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ===========================
   DESKTOP PROJECT MARQUEE
   (two columns auto-scrolling in opposite directions)
=========================== */
.project-marquee-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  height: 600px;
  -webkit-mask-image: linear-gradient(to bottom, black 86%, transparent);
  mask-image: linear-gradient(to bottom, black 86%, transparent);
}
.project-marquee-col {
  position: relative;
  overflow: hidden;
  height: 100%;
}
.project-marquee-track {
  display: flex;
  flex-direction: column;
  gap: 16px;
  will-change: transform;
  /* step + pause timing is driven by JS (see renderProjectMarquee), so the
     transition duration here is just the "step" portion of each move */
  transition: transform 600ms cubic-bezier(0.65, 0, 0.35, 1);
}

.marquee-card {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(2, 6, 23, 0.06);
  transition: box-shadow 240ms ease, transform 240ms ease;
}
html.dark .marquee-card {
  background: rgba(255, 255, 255, 0.05);
}
.marquee-card:hover {
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.14);
  transform: translateY(-2px);
}
html.dark .marquee-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}
.marquee-card-thumb {
  position: relative;
  height: 220px;
  overflow: hidden;
}
.marquee-card-arrow {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(2, 6, 23, 0.25);
  transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.marquee-card:hover .marquee-card-arrow {
  transform: scale(1.12) rotate(6deg);
}

/* ===========================
   MOBILE PROJECT DASHBOARD
   (floating card stack + snake timeline)
=========================== */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* floating card stack */
.stack-card {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 78%;
  max-width: 300px;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 20px 45px -12px rgba(2, 6, 23, 0.35);
  transition: transform 620ms cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 380ms ease, filter 380ms ease;
  touch-action: pan-y;
}
html.dark .stack-card {
  box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.6);
}
.stack-card.pos-0 {
  /* front: card #1 */
  transform: translate(0, 0) rotate(0deg) scale(1);
  z-index: 50;
  filter: none;
  opacity: 1;
}
.stack-card.pos-1 {
  /* right: card #2 */
  transform: translate(34%, 10%) rotate(8deg) scale(0.92);
  z-index: 40;
  filter: brightness(0.85) saturate(0.9);
  opacity: 0.92;
}
.stack-card.pos-4 {
  /* left: card #5 */
  transform: translate(-34%, 10%) rotate(-8deg) scale(0.92);
  z-index: 30;
  filter: brightness(0.7) saturate(0.85);
  opacity: 0.85;
}
.stack-card.pos-2 {
  /* mid-back: card #3, just in front of the furthest card */
  transform: translate(0, 13%) rotate(0deg) scale(0.86);
  z-index: 20;
  filter: brightness(0.6) saturate(0.75);
  opacity: 0.62;
}
.stack-card.pos-3 {
  /* furthest back: card #4, most obscured */
  transform: translate(0, 20%) rotate(0deg) scale(0.76);
  z-index: 10;
  filter: brightness(0.45) saturate(0.6);
  opacity: 0.4;
}
.stack-card.pos-hidden {
  transform: scale(0.8);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}

/* snake timeline dots + labels */
.timeline-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f2a154, #d96a1a);
  box-shadow: 0 0 0 5px rgba(217, 106, 26, 0.15), 0 4px 10px rgba(217, 106, 26, 0.4);
  border: 2px solid #fff;
  z-index: 2;
  animation: dotPop 480ms cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
html.dark .timeline-dot {
  border-color: #111827;
}
@keyframes dotPop {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.timeline-label {
  position: absolute;
  width: 170px;
  text-align: center;
  z-index: 1;
  padding: 8px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(217, 106, 26, 0.12);
  box-shadow: 0 4px 14px rgba(2, 6, 23, 0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: labelFade 520ms ease backwards;
}
html.dark .timeline-label {
  background: rgba(17, 24, 39, 0.82);
  border-color: rgba(217, 106, 26, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.timeline-label-top {
  top: 0;
}
.timeline-label-bottom {
  bottom: 0;
}
@keyframes labelFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-phase {
  font-family: "Roboto Mono", monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--highlight);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.timeline-date {
  font-size: 9.5px;
  color: #9aa6b2;
  margin-top: 1px;
}
.timeline-desc {
  font-size: 10.5px;
  margin-top: 4px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* mobile Contact tab card entrance */
.contact-card-in {
  animation: contactCardIn 480ms cubic-bezier(0.2, 0.9, 0.2, 1) backwards;
}
@keyframes contactCardIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* mobile tab panel fade when switching */
#mobilePanelHome,
#mobilePanelProfile,
#mobilePanelProjects,
#mobilePanelContact {
  animation: panelFadeIn 360ms ease;
}
@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
