/* ── Google Fonts import ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=JetBrains+Mono:wght@400;500;700&family=Syne:wght@400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Base */
  --bg: #0a0a0f;
  --surface: #141420;
  --border: #1e1e2e;
  --text: #e0e0e6;
  --text-muted: #8888a0;

  /* Dominant rainbow */
  --pink: #f472b6;
  --cyan: #22d3ee;
  --purple: #a78bfa;

  /* Supporting rainbow */
  --blue: #60a5fa;
  --green: #4ade80;
  --yellow: #facc15;
  --orange: #fb923c;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --section-padding: 6rem 2rem;
  --nav-height: 4rem;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--purple) var(--bg);
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Grain overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ── Webkit scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--pink), var(--purple), var(--cyan), var(--blue), var(--green), var(--yellow), var(--orange));
  border-radius: 3px;
}

/* ── Typography base ── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; }
a { color: inherit; text-decoration: none; }

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 2rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background 0.3s, backdrop-filter 0.3s;
}

.nav--scrolled {
  background: rgba(20, 20, 32, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.mono-rainbow {
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav__links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav__links a {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--pink);
  transition: width 0.3s;
}

.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }

/* Hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

/* Mobile */
@media (max-width: 768px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(20, 20, 32, 0.95);
    backdrop-filter: blur(12px);
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    pointer-events: none;
  }
  .nav__links--open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  .nav__toggle--open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .nav__toggle--open span:nth-child(2) { opacity: 0; }
  .nav__toggle--open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--section-padding);
  padding-top: calc(var(--nav-height) + 4rem);
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 50%, rgba(167, 139, 250, 0.08) 0%, transparent 60%);
}

.hero__content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--pink), var(--purple), var(--cyan), var(--blue), var(--green), var(--yellow), var(--orange), var(--pink));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbow-shift 8s ease-in-out infinite;
}

@keyframes rainbow-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero__tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  margin-top: 1.5rem;
  max-width: 500px;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--cyan);
  transition: color 0.2s;
}

.hero__cta:hover { color: var(--text); }

.hero__arrow {
  display: inline-block;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* Decorative orb */
.hero__orb {
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(250px, 35vw, 450px);
  height: clamp(250px, 35vw, 450px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.15), rgba(167, 139, 250, 0.1), rgba(34, 211, 238, 0.05), transparent 70%);
  filter: blur(60px);
  animation: orb-pulse 6s ease-in-out infinite;
}

@keyframes orb-pulse {
  0%, 100% { transform: translateY(-50%) scale(1); opacity: 0.6; }
  50% { transform: translateY(-50%) scale(1.1); opacity: 1; }
}

@media (max-width: 768px) {
  .hero__orb {
    right: -20%;
    width: 300px;
    height: 300px;
  }
}

/* ── Section shared ── */
.section-heading {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 3rem;
  color: var(--text);
}

/* ── Projects ── */
.projects {
  padding: var(--section-padding);
  background: radial-gradient(ellipse at 70% 20%, rgba(34, 211, 238, 0.04) 0%, transparent 50%);
}

.projects__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* Staggered offsets */
.projects__grid .card:nth-child(2) { margin-top: 2rem; }
.projects__grid .card:nth-child(3n) { margin-top: 1rem; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.card:hover { transform: translateY(-4px); }
.card--pink:hover { border-color: var(--pink); box-shadow: 0 0 30px rgba(244, 114, 182, 0.15); }
.card--cyan:hover { border-color: var(--cyan); box-shadow: 0 0 30px rgba(34, 211, 238, 0.15); }
.card--purple:hover { border-color: var(--purple); box-shadow: 0 0 30px rgba(167, 139, 250, 0.15); }

.card__image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg);
}

.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__body { padding: 1.5rem; }

.card__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.card__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid;
}

.tag--pink { color: var(--pink); border-color: rgba(244, 114, 182, 0.3); }
.tag--cyan { color: var(--cyan); border-color: rgba(34, 211, 238, 0.3); }
.tag--purple { color: var(--purple); border-color: rgba(167, 139, 250, 0.3); }

.card__links {
  display: flex;
  gap: 1.5rem;
}

.card__link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.card__link:hover { color: var(--text); }

/* ── Scroll reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .projects__grid { grid-template-columns: 1fr; }
  .projects__grid .card:nth-child(n) { margin-top: 0; }
}

/* ── Contact ── */
.contact {
  padding: var(--section-padding);
  text-align: center;
  background: radial-gradient(ellipse at 50% 80%, rgba(167, 139, 250, 0.06) 0%, transparent 50%);
}

.contact__inner {
  max-width: 600px;
  margin: 0 auto;
}

.contact__email {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--cyan);
  margin-bottom: 2rem;
  position: relative;
  transition: color 0.2s;
}

.contact__email::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--cyan);
  transition: width 0.3s;
}

.contact__email:hover { color: var(--text); }
.contact__email:hover::after { width: 100%; }

.contact__socials {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.social:hover { transform: scale(1.15); }
.social--pink { color: var(--pink); }
.social--pink:hover { border-color: var(--pink); box-shadow: 0 0 20px rgba(244, 114, 182, 0.2); }
.social--purple { color: var(--purple); }
.social--purple:hover { border-color: var(--purple); box-shadow: 0 0 20px rgba(167, 139, 250, 0.2); }
.social--cyan { color: var(--cyan); }
.social--cyan:hover { border-color: var(--cyan); box-shadow: 0 0 20px rgba(34, 211, 238, 0.2); }

/* ── Footer ── */
.footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer__text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Project detail ── */
.project-detail {
  padding: var(--section-padding);
  padding-top: calc(var(--nav-height) + 4rem);
}

.project-detail__inner {
  max-width: 800px;
  margin: 0 auto;
}

.project-detail__back {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
  display: inline-block;
  margin-bottom: 2rem;
}

.project-detail__back:hover { color: var(--cyan); }

.project-detail__title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
}

.project-detail__subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
}

.project-detail__screenshot {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 3rem;
}

.project-detail__screenshot img {
  width: 100%;
  display: block;
}

.project-detail__content h2 {
  font-size: 1.3rem;
  margin: 2rem 0 1rem;
  color: var(--text);
}

.project-detail__content p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-detail__content .card__tags {
  margin-bottom: 1rem;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-list li {
  color: var(--text-muted);
  line-height: 1.6;
  padding-left: 1.5rem;
  position: relative;
}

.feature-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--pink);
}

.feature-list li:nth-child(2)::before { color: var(--cyan); }
.feature-list li:nth-child(3)::before { color: var(--purple); }
.feature-list li:nth-child(4)::before { color: var(--pink); }

.feature-sublist {
  list-style: none;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.feature-sublist li {
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

.feature-sublist li::before {
  content: '·';
  font-weight: 700;
  color: var(--purple);
}

.feature-sublist li:nth-child(2)::before { color: var(--cyan); }
.feature-sublist li:nth-child(3)::before { color: var(--pink); }
.feature-sublist li:nth-child(4)::before { color: var(--purple); }

.project-detail__links {
  display: flex;
  gap: 1.5rem;
}

/* ── KohanaMakes ── */
.kohana {
  padding: var(--section-padding);
  padding-top: calc(var(--nav-height) + 4rem);
  text-align: center;
  background: radial-gradient(ellipse at 40% 40%, rgba(244, 114, 182, 0.06) 0%, transparent 50%);
}

.kohana__inner {
  max-width: 900px;
  margin: 0 auto;
}

.kohana__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink), var(--purple), var(--cyan));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbow-shift 8s ease-in-out infinite;
  margin-bottom: 1rem;
}

.kohana__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.kohana__links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.kohana__btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.kohana__btn--etsy {
  color: var(--orange);
}

.kohana__btn--etsy:hover {
  border-color: var(--orange);
  box-shadow: 0 0 20px rgba(251, 146, 60, 0.15);
}

.kohana__btn--insta {
  color: var(--pink);
}

.kohana__btn--insta:hover {
  border-color: var(--pink);
  box-shadow: 0 0 20px rgba(244, 114, 182, 0.15);
}

/* ── Gallery ── */
.gallery {
  padding: var(--section-padding);
}

.gallery__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.gallery__embeds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  justify-items: center;
  margin-bottom: 2rem;
}

.gallery__embeds .instagram-media {
  margin: 0 !important;
}

.gallery__cta {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.gallery__cta a {
  color: var(--pink);
  transition: color 0.2s;
}

.gallery__cta a:hover {
  color: var(--text);
}

@media (max-width: 768px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
