/* ===================================================
   Avi — The Alchemist | Portfolio
   Dark studio palette · Midnight · Gold · Cinematic
   =================================================== */

:root {
  /* Core palette — dark studio with gold accents */
  --cream: #0f1117;
  --paper: #13161e;
  --warm-white: #1a1e28;
  --latte: #1f2333;
  --caramel: #c9a84c;
  --muted-brown: #7a6e4a;
  --maroon: #c9a84c;
  --maroon-light: rgba(201, 168, 76, 0.08);
  --maroon-glow: rgba(201, 168, 76, 0.15);
  --dusk: #e0c16e;
  --deep: #f0ece4;
  --text: #cdc8be;
  --text-muted: #7a7568;

  /* Typography */
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Spacing */
  --section-pad: clamp(64px, 10vw, 120px);
  --container: 1060px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ── Custom cursor ── */
* { cursor: none !important; }

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  background: #000;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease, width 0.2s ease, height 0.2s ease, background 0.2s ease;
  will-change: top, left;
}

.cursor.hover {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.15);
  border: 1.5px solid #000;
}

/* ── Base ── */
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

html { overflow-x: hidden; }

/* ── Film grain overlay ── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  mix-blend-mode: multiply;
  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)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ── Container ── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: rgba(15, 17, 23, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(107, 34, 51, 0.06);
  transition: padding 0.3s var(--ease);
}

.nav.scrolled { padding: 12px 32px; }

.nav-logo {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--maroon);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s var(--ease);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--maroon);
  transition: width 0.3s var(--ease);
}

.nav-links a:hover { color: var(--maroon); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.3s var(--ease);
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(201, 168, 76, 0.06), transparent),
    radial-gradient(ellipse 60% 60% at 30% 70%, rgba(201, 168, 76, 0.04), transparent),
    linear-gradient(180deg, var(--cream), var(--paper));
}

.hero-inner { max-width: 720px; }

.hero-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--maroon);
  margin: 0 0 24px;
  opacity: 0.8;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--deep);
  margin: 0 0 28px;
  letter-spacing: -0.01em;
}

.hero-title .em {
  color: var(--maroon);
  font-style: italic;
  font-weight: 500;
}

.hero-sub {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 36px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
}

.hero-scroll span {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--maroon), transparent);
  animation: scrollPulse 2s var(--ease) infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 0.8; transform: scaleY(1.2); }
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 50px;
  background: var(--maroon);
  color: #fff;
  border: 1px solid var(--maroon);
  transition: all 0.35s var(--ease);
  cursor: pointer;
}

.btn:hover {
  background: var(--dusk);
  border-color: var(--dusk);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(107, 34, 51, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--maroon);
}

.btn-ghost:hover {
  background: var(--maroon-light);
  color: var(--maroon);
  border-color: var(--maroon);
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-lg {
  padding: 18px 44px;
  font-size: 15px;
}

/* ── Statement ── */
.statement {
  padding: var(--section-pad) 0;
  background: var(--paper);
  border-top: 1px solid rgba(107, 34, 51, 0.04);
  border-bottom: 1px solid rgba(107, 34, 51, 0.04);
}

.big-quote {
  font-family: var(--serif);
  font-size: clamp(22px, 3.5vw, 34px);
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
  color: var(--deep);
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
  border: none;
  position: relative;
}

.big-quote::before {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--maroon);
  margin: 0 auto 32px;
  opacity: 0.5;
}

.big-quote em {
  color: var(--maroon);
  font-style: italic;
}

/* ── Sections ── */
.section {
  padding: var(--section-pad) 0;
}

.section-warm {
  background: var(--paper);
  border-top: 1px solid rgba(107, 34, 51, 0.04);
  border-bottom: 1px solid rgba(107, 34, 51, 0.04);
}

.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--maroon);
  margin-bottom: 16px;
  opacity: 0.7;
}

.section h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  line-height: 1.25;
  color: var(--deep);
  margin: 0 0 40px;
  letter-spacing: -0.01em;
}

.section p {
  max-width: 640px;
  color: var(--text);
  margin-top: 0;
}

.section p em {
  color: var(--maroon);
  font-style: italic;
}

/* ── Divider ── */
.divider {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  background: var(--cream);
}

.divider span {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--caramel), transparent);
  opacity: 0.4;
}

/* ── About: Two column ── */
.two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: start;
}

.col-text p {
  margin-bottom: 20px;
}

.col-text h2 {
  font-size: clamp(28px, 4vw, 42px);
}

.col-traits {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trait-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: var(--warm-white);
  border: 1px solid rgba(107, 34, 51, 0.06);
  border-radius: 12px;
  transition: all 0.3s var(--ease);
}

.trait-card:hover {
  border-color: rgba(107, 34, 51, 0.12);
  box-shadow: 0 4px 16px rgba(107, 34, 51, 0.06);
  transform: translateY(-2px);
}

.trait-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--maroon);
  opacity: 0.7;
}

.trait-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 400;
}

/* ── Philosophy grid ── */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 16px;
}

.phil-card {
  padding: 32px;
  background: var(--warm-white);
  border: 1px solid rgba(107, 34, 51, 0.05);
  border-radius: 16px;
  transition: all 0.35s var(--ease);
  position: relative;
}

.phil-card:hover {
  border-color: rgba(107, 34, 51, 0.1);
  box-shadow: 0 8px 32px rgba(107, 34, 51, 0.06);
  transform: translateY(-3px);
}

.phil-num {
  font-family: var(--serif);
  font-size: 32px;
  color: var(--maroon);
  opacity: 0.2;
  margin-bottom: 12px;
  font-weight: 600;
}

.phil-card h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--deep);
  margin: 0 0 10px;
}

.phil-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
  max-width: none;
}

/* ── Emotions ── */
.emotions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.emotion-tag {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--maroon-light), rgba(196, 168, 130, 0.1));
  border: 1px solid rgba(107, 34, 51, 0.08);
  border-radius: 50px;
  font-size: 14px;
  font-weight: 400;
  color: var(--maroon);
  letter-spacing: 0.02em;
  transition: all 0.3s var(--ease);
}

.emotion-tag:hover {
  background: var(--maroon);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(107, 34, 51, 0.2);
}

.emotion-desc {
  color: var(--text-muted) !important;
  font-size: 15px;
  max-width: 600px;
}

/* ── Services grid ── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.service-card {
  padding: 32px;
  background: var(--warm-white);
  border: 1px solid rgba(107, 34, 51, 0.05);
  border-radius: 16px;
  transition: all 0.35s var(--ease);
}

.service-card:hover {
  border-color: rgba(107, 34, 51, 0.1);
  box-shadow: 0 8px 32px rgba(107, 34, 51, 0.06);
  transform: translateY(-3px);
}

.service-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--maroon-light);
  border-radius: 12px;
  color: var(--maroon);
  margin-bottom: 16px;
}

.service-card h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--deep);
  margin: 0 0 10px;
}

.service-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
  max-width: none;
}

/* ── Collaborators ── */
.collab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.collab-card {
  padding: 32px;
  background: var(--paper);
  border: 1px solid rgba(107, 34, 51, 0.06);
  border-radius: 16px;
  transition: all 0.35s var(--ease);
  position: relative;
  overflow: hidden;
}

.collab-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--maroon), var(--caramel));
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.collab-card:hover {
  border-color: rgba(107, 34, 51, 0.1);
  box-shadow: 0 8px 32px rgba(107, 34, 51, 0.06);
  transform: translateY(-3px);
}

.collab-card:hover::before { opacity: 1; }

.collab-card h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--deep);
  margin: 0 0 12px;
}

.collab-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
  max-width: none;
}

/* ── Legacy ── */
.legacy-quote {
  font-family: var(--serif);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--deep);
  text-align: center;
  max-width: 740px;
  margin: 0 auto 48px;
  padding: 0;
  border: none;
  position: relative;
}

.legacy-quote::before {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--maroon);
  margin: 0 auto 28px;
  opacity: 0.4;
}

.legacy-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}

.legacy-pillar h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--maroon);
  margin: 0 0 10px;
}

.legacy-pillar p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: none;
  margin: 0 auto;
}

/* ── Contact ── */
.section-contact {
  background: linear-gradient(180deg, var(--cream), var(--latte));
}

.contact-inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.contact-inner h2 {
  text-align: center;
}

.contact-inner p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: none;
  margin: 0 auto 32px;
}

/* ── Footer ── */
.footer {
  padding: 28px 0;
  border-top: 1px solid rgba(107, 34, 51, 0.06);
  background: var(--cream);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-name {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  gap: 24px;
}

.footer-nav a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.footer-nav a:hover { color: var(--maroon); }

/* ── Reveal animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(32px);
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.28s; }
.fade-in:nth-child(3) { animation-delay: 0.46s; }
.fade-in:nth-child(4) { animation-delay: 0.62s; }
.fade-in:nth-child(5) { animation-delay: 0.76s; }

@keyframes fadeInUp {
  to { opacity: 1; transform: translate(0, 0); }
}

/* Scroll-triggered fly-ins */
.reveal {
  opacity: 0;
  transform: translateY(80px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.from-left  { transform: translateX(-110px); }
.reveal.from-right { transform: translateX(110px); }

/* Cards get a spring bounce */
.reveal.spring {
  transition: opacity 1s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* ── Button ripple ── */
.btn { position: relative; overflow: hidden; }

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: rippleOut 0.65s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleOut {
  to { transform: scale(5); opacity: 0; }
}

.btn:active { transform: scale(0.96) translateY(0) !important; }

/* ── Selection style ── */
::selection {
  background: rgba(201, 168, 76, 0.2);
  color: var(--deep);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb {
  background: var(--caramel);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted-brown); }

/* ──────────────────────────────
   Responsive
   ────────────────────────────── */

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .philosophy-grid,
  .services-grid {
    grid-template-columns: 1fr;
  }

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

  .legacy-pillars {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 680px) {
  .nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 17, 23, 0.98);
    backdrop-filter: blur(16px);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid rgba(107, 34, 51, 0.06);
  }
  .nav-toggle { display: flex; }

  .hero { padding: 100px 20px 60px; min-height: 90vh; }
  .hero-title { font-size: clamp(32px, 8vw, 48px); }

  .container { padding-left: 20px; padding-right: 20px; }

  .phil-card,
  .service-card,
  .collab-card { padding: 24px; }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
