/* ── Palette: theme/themes.js via js/theme-init.js (fallback :root if JS off) ── */
/* Fallback values (rosePine) used if JS is disabled */
:root {
  --base: #191724;
  --surface: #1f1d2e;
  --overlay: #26233a;
  --muted: #6e6a86;
  --subtle: #908caa;
  --text: #e0def4;
  --love: #eb6f92;
  --gold: #f6c177;
  --rose: #ebbcba;
  --pine: #31748f;
  --foam: #9ccfd8;
  --iris: #c4a7e7;
  --hl-low: #21202e;
  --hl-med: #403d52;
  --hl-high: #524f67;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--base);
  color: var(--text);
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

::selection {
  background: var(--iris);
  color: var(--base);
}

/* ── scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--base);
}
::-webkit-scrollbar-thumb {
  background: var(--hl-high);
  border-radius: 3px;
}

a {
  color: var(--foam);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--rose);
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 6vw;
  background: rgba(25, 23, 36, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hl-low);
  transition: box-shadow 0.3s;
}
nav.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--rose);
  letter-spacing: 0.5px;
}
.nav-logo span {
  color: var(--muted);
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--subtle);
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--rose);
  transition: width 0.3s;
}
.nav-links a:hover {
  color: var(--text);
}
.nav-links a:hover::after {
  width: 100%;
}

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 6vw;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 60% 60% at 70% 40%,
      rgba(196, 167, 231, 0.07) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 40% 40% at 20% 70%,
      rgba(235, 111, 146, 0.06) 0%,
      transparent 50%
    );
  pointer-events: none;
}

/* floating orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: drift 12s ease-in-out infinite alternate;
}
.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--iris);
  top: -10%;
  right: 5%;
  animation-duration: 14s;
}
.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--love);
  bottom: 5%;
  right: 25%;
  animation-duration: 10s;
  animation-delay: -3s;
}
.orb-3 {
  width: 250px;
  height: 250px;
  background: var(--pine);
  top: 30%;
  left: -5%;
  animation-duration: 16s;
  animation-delay: -6s;
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(30px, -20px) scale(1.05);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-greeting {
  font-size: 0.9rem;
  color: var(--foam);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.6s 0.2s forwards;
}

.hero-name {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--text);
  opacity: 0;
  animation: fadeUp 0.6s 0.4s forwards;
}
.hero-name .accent {
  color: var(--rose);
}

.hero-title {
  margin-top: 0.75rem;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--subtle);
  font-weight: 400;
  opacity: 0;
  animation: fadeUp 0.6s 0.6s forwards;
}
.hero-title .highlight {
  color: var(--gold);
}

.hero-desc {
  margin-top: 1.5rem;
  font-size: 1rem;
  color: var(--muted);
  max-width: 520px;
  opacity: 0;
  animation: fadeUp 0.6s 0.8s forwards;
}

.hero-cta {
  margin-top: 2.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s 1s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  border: none;
}
.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--love);
  color: var(--base);
  box-shadow: 0 4px 20px rgba(235, 111, 146, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(235, 111, 146, 0.45);
  color: var(--base);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hl-high);
}
.btn-ghost:hover {
  border-color: var(--iris);
  color: var(--iris);
}

/* ── SECTION BASE ── */
section {
  padding: 6rem 6vw;
}
.section-label {
  font-size: 0.78rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--iris);
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3rem;
}
.section-title span {
  color: var(--rose);
}

/* ── ABOUT ── */
#about {
  background: var(--surface);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--subtle);
  margin-bottom: 1rem;
}
.about-text p strong {
  color: var(--text);
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.stat-card {
  background: var(--overlay);
  border: 1px solid var(--hl-low);
  border-radius: 12px;
  padding: 1.5rem;
  transition:
    border-color 0.3s,
    transform 0.3s;
}
.stat-card:hover {
  border-color: var(--iris);
  transform: translateY(-3px);
}
.stat-card .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--rose);
}
.stat-card .label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── SKILLS ── */
#skills {
  background: var(--base);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--hl-low);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.3s;
}
.skill-group:hover {
  border-color: var(--pine);
}

.skill-group-title {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--foam);
  margin-bottom: 1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tag {
  background: var(--overlay);
  color: var(--subtle);
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  border: 1px solid var(--hl-med);
  transition: all 0.2s;
  cursor: default;
}
.tag:hover {
  border-color: var(--iris);
  color: var(--iris);
  background: rgba(196, 167, 231, 0.08);
}

/* ── PROJECTS ── */
#projects {
  background: var(--surface);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.projects-grid.ecosystem-flagship {
  grid-template-columns: 1fr;
  max-width: 720px;
  margin-inline: auto;
}

.ecosystem-subnote {
  margin-top: 1.75rem;
  max-width: 520px;
  margin-inline: auto;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.project-card {
  background: var(--overlay);
  border: 1px solid var(--hl-low);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition:
    border-color 0.3s,
    transform 0.3s,
    box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--love), var(--iris));
  opacity: 0;
  transition: opacity 0.3s;
}
.project-card:hover {
  border-color: var(--hl-high);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.project-card:hover::before {
  opacity: 1;
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.project-icon {
  width: 44px;
  height: 44px;
  background: var(--hl-low);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.project-links {
  display: flex;
  gap: 0.5rem;
}
.project-links a {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--hl-low);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
  transition:
    background 0.2s,
    color 0.2s;
}
.project-links a:hover {
  background: var(--hl-med);
  color: var(--text);
}

.project-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.project-desc {
  font-size: 0.9rem;
  color: var(--muted);
  flex: 1;
}
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.project-tech .tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--gold);
  background: rgba(246, 193, 119, 0.1);
  border: 1px solid rgba(246, 193, 119, 0.2);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  align-self: flex-start;
}

/* ── EXPERIENCE ── */
#experience {
  background: var(--base);
}

.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0.5px;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, var(--love), var(--iris), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateX(-20px);
  transition:
    opacity 0.5s,
    transform 0.5s;
}
.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-2rem + 0.5px);
  top: 0.5rem;
  width: 10px;
  height: 10px;
  background: var(--love);
  border: 2px solid var(--base);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(235, 111, 146, 0.15);
  transform: translateX(-50%);
  box-sizing: border-box;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--foam);
  letter-spacing: 1px;
  margin-bottom: 0.3rem;
}
.timeline-role {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.timeline-company {
  font-size: 0.9rem;
  color: var(--iris);
  margin-bottom: 0.75rem;
}
.timeline-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

.timeline-list {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  list-style: disc;
}

.timeline-list li {
  margin-bottom: 0.5rem;
}

.timeline-list li:last-child {
  margin-bottom: 0;
}

.timeline-list strong {
  color: var(--subtle);
  font-weight: 600;
}
.timeline-placeholder {
  background: var(--surface);
  border: 1px dashed var(--hl-high);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── CONTACT ── */
#contact {
  background: var(--surface);
}

.contact-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.contact-inner .section-label,
.contact-inner .section-title {
  text-align: center;
}
.contact-inner .section-title {
  margin-bottom: 1rem;
}

.contact-sub {
  color: var(--muted);
  margin-bottom: 3rem;
  font-size: 0.95rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  background: var(--overlay);
  border: 1px solid var(--hl-med);
  border-radius: 10px;
  color: var(--subtle);
  font-size: 0.9rem;
  transition: all 0.2s;
}
.contact-link:hover {
  border-color: var(--rose);
  color: var(--rose);
  background: rgba(235, 188, 186, 0.05);
  transform: translateY(-2px);
}
.contact-link svg {
  flex-shrink: 0;
}

.contact-email-box {
  background: var(--overlay);
  border: 1px solid var(--hl-low);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.contact-email-box span {
  color: var(--subtle);
  font-size: 0.9rem;
}
.copy-btn {
  padding: 0.4rem 1rem;
  background: var(--hl-low);
  color: var(--text);
  border: 1px solid var(--hl-high);
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.copy-btn:hover {
  background: var(--love);
  color: var(--base);
  border-color: var(--love);
}
.copy-btn.copied {
  background: var(--pine);
  border-color: var(--pine);
  color: var(--base);
}

/* ── FOOTER ── */
footer {
  background: var(--base);
  border-top: 1px solid var(--hl-low);
  padding: 2rem 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
}
footer .heart {
  color: var(--love);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s,
    transform 0.6s;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav {
    padding: 1rem 5vw;
  }
  .nav-links {
    gap: 1.2rem;
  }
  .nav-links li:nth-child(n + 4) {
    display: none;
  }

  section {
    padding: 4rem 5vw;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .about-stats {
    grid-template-columns: 1fr 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid.ecosystem-flagship {
    max-width: none;
  }

  .contact-email-box {
    flex-direction: column;
    text-align: center;
  }
  footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* ── 404 ── */
.page-404 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.error-nav {
  justify-content: flex-start;
}

.error-nav .nav-logo {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.error-nav .nav-logo:hover {
  color: var(--rose);
}

.error-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 6vw 4rem;
  position: relative;
  overflow: hidden;
}

.error-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 480px;
}

.error-code {
  font-size: clamp(4rem, 14vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--hl-high);
  margin-bottom: 0.5rem;
}

.error-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.error-title .accent {
  color: var(--rose);
}

.error-desc {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.65;
}

.error-home {
  text-decoration: none;
}

.error-footer {
  background: var(--base);
  border-top: 1px solid var(--hl-low);
  padding: 1.25rem 6vw;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}
