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

:root {
  --bg: #0A0908;
  --surface: #12110F;
  --surface-2: #1A1815;
  --surface-3: #221F1B;
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --text: #F2F1EC;
  --text-secondary: #9A9488;
  --text-tertiary: #5E5A52;
  --cinnabar: #C45C52;
  --cinnabar-light: #D4756C;
  --cinnabar-glow: rgba(196, 92, 82, 0.15);
  --cinnabar-glow-strong: rgba(196, 92, 82, 0.3);
  --gold: #D4A964;
  --gold-dim: rgba(212, 169, 100, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1100px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ---- Film Grain Overlay ---- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  pointer-events: none;
  opacity: 0.035;
  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-repeat: repeat;
  background-size: 256px 256px;
}

/* ---- Starfield ---- */
#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

/* ---- Gradient Orbs (warmed up) ---- */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(196, 92, 82, 0.12) 0%, transparent 70%);
  top: -200px;
  right: -150px;
  animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(212, 169, 100, 0.08) 0%, transparent 70%);
  bottom: 20%;
  left: -200px;
  animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(196, 92, 82, 0.06) 0%, transparent 70%);
  bottom: -100px;
  right: 10%;
  animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-40px, 60px); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(50px, -40px); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, -50px); }
}

/* ---- Nav ---- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}

header.scrolled {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 9, 8, 0.85);
  border-bottom-color: var(--border);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 2rem;
}

.logo {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-mark {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

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

.nav-contact {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  padding: 0.45rem 1rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-contact:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* ---- Hamburger (hidden on desktop) ---- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 102;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ---- Scroll offset for fixed header ---- */
[id] {
  scroll-margin-top: 5rem;
}

/* ---- Sections ---- */
main {
  position: relative;
  z-index: 1;
}

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem;
  padding-top: max(2rem, env(safe-area-inset-top));
}

.hero-content {
  text-align: center;
  max-width: 700px;
}

.hero-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--cinnabar-glow) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: blur(80px);
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

h1 em {
  font-style: italic;
  color: var(--cinnabar-light);
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 400px;
  margin-inline: auto;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--border-light);
  border-radius: 100px;
  transition: all 0.3s;
}

.hero-cta:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.cta-arrow {
  font-size: 1rem;
  animation: bounce 2s ease-in-out infinite;
}

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

/* ---- Product ---- */
.product {
  padding: 6rem 2rem 8rem;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.product-header {
  text-align: center;
  margin-bottom: 4rem;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cinnabar);
  font-weight: 600;
  margin-bottom: 1rem;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--cinnabar);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.product h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.product-tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.product-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

/* ---- Phone Mockup ---- */
.phone-frame {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 36px;
  padding: 8px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 0 100px var(--cinnabar-glow);
}

.phone-screenshot {
  width: 100%;
  display: block;
  border-radius: 28px;
}

.phone-reflection {
  position: absolute;
  inset: 0;
  border-radius: 36px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
  pointer-events: none;
}

/* ---- Fanned Phone Stack (Desktop) ---- */
.phone-stack {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
}

.phone-stack .phone-frame {
  flex-shrink: 0;
}

.phone-stack .phone-center {
  width: 260px;
  z-index: 2;
  margin-inline: -15px;
}

.phone-stack .phone-left {
  width: 220px;
  transform: rotate(-4deg) translateY(20px);
  z-index: 1;
  opacity: 0.85;
}

.phone-stack .phone-right {
  width: 220px;
  transform: rotate(4deg) translateY(20px);
  z-index: 1;
  opacity: 0.85;
}

/* ---- Mobile Carousel (hidden on desktop) ---- */
.phone-carousel-mobile {
  display: none;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Padding accommodates box-shadow blur so overflow doesn't clip it
     to a hard line; negative margin keeps layout spacing intact */
  padding: 3.5rem 0;
  margin: -2.5rem 0;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  justify-content: center;
}

.carousel-slide .phone-frame {
  width: 260px;
  max-width: 80vw;
  /* Scaled-down shadow for mobile — fits within carousel track padding */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 15px 50px rgba(0, 0, 0, 0.6),
    0 0 50px var(--cinnabar-glow);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}

/* Expand touch target to ~44px without affecting visual size */
.carousel-dot::before {
  content: '';
  position: absolute;
  inset: -18px;
}

.carousel-dot.active {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
}

/* ---- Product Details ---- */
.product-details {
  padding-top: 0.5rem;
}

.product-description {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  font-size: 1rem;
  max-width: 500px;
  margin-inline: auto;
}

.features-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 2.5rem;
}

.feature-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.feature-item:first-child {
  border-top: 1px solid var(--border);
}

.feature-number {
  font-family: 'Instrument Serif', serif;
  font-size: 1.1rem;
  color: var(--gold);
  opacity: 0.6;
  flex-shrink: 0;
  padding-top: 0.1em;
}

.feature-item strong {
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

.feature-item span {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--cinnabar-light);
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--cinnabar-glow-strong);
  border-radius: 100px;
  background: var(--cinnabar-glow);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--cinnabar);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

/* ---- Services ---- */
.services {
  padding: 8rem 2rem 8rem;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.services-header {
  text-align: center;
  margin-bottom: 3rem;
}

.services h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.services-intro {
  color: var(--text-secondary);
  max-width: 520px;
  margin-inline: auto;
  line-height: 1.7;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.service-icon {
  display: block;
  width: 20px;
  height: 20px;
  stroke: var(--gold);
  stroke-width: 1.5;
  margin-bottom: 1rem;
  min-height: 20px;
}

.service-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.service-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.past-work {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cinnabar);
  border-radius: var(--radius-sm);
  padding: 1.75rem 2rem;
  margin-bottom: 3rem;
}

.past-work-label {
  margin-bottom: 0.75rem;
}

.past-work-text {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.past-work-note {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.past-work-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--cinnabar-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.past-work-link:hover {
  color: var(--gold);
}

.services-cta {
  text-align: center;
}

.services-cta-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.services-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--cinnabar-light);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--cinnabar-glow-strong);
  border-radius: 100px;
  background: var(--cinnabar-glow);
  transition: all 0.2s;
}

.services-cta-link:hover {
  background: rgba(196, 92, 82, 0.25);
  border-color: var(--cinnabar);
}

/* ---- About ---- */
.about {
  padding: 6rem 2rem 8rem;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.about-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.about h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.about-name {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.about-bio {
  text-align: left;
}

.about-bio p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.proof-list {
  list-style: none;
  padding-left: 0;
  margin-top: 2rem;
  text-align: left;
}

.proof-item {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.proof-item:first-child {
  border-top: 1px solid var(--border);
}

.proof-item strong {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---- Philosophy ---- */
.philosophy {
  padding: 4rem 2rem 6rem;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

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

.philosophy-quote {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
}

.philosophy-quote p {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.4;
  color: var(--text);
  opacity: 0.85;
}

.philosophy-quote cite {
  display: block;
  margin-top: 1.25rem;
  font-family: 'DM Sans', sans-serif;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
}

.philosophy-content p {
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.8;
}

.philosophy-contact {
  margin-top: 2rem;
}

.contact-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.contact-email {
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  transition: color 0.2s;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 2px;
}

.contact-email:hover {
  color: var(--cinnabar-light);
  border-color: var(--cinnabar-glow-strong);
}

/* ---- Footer ---- */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-content p {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* ---- Scroll Reveal ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Preserve child transforms inside phone-stack after reveal */
.phone-stack.visible .phone-left {
  transform: rotate(-4deg) translateY(20px);
}

.phone-stack.visible .phone-right {
  transform: rotate(4deg) translateY(20px);
}

/* ---- Copied tooltip ---- */
a[href^="mailto:"] {
  position: relative;
}

.copied-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  animation: tooltip-fade 1.5s ease forwards;
}

@keyframes tooltip-fade {
  0%, 60% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .subtitle {
    max-width: 100%;
  }

  /* Hide desktop fanned stack, show mobile carousel */
  .phone-stack {
    display: none;
  }

  .phone-carousel-mobile {
    display: block;
    width: 100%;
  }

  .product-details {
    text-align: center;
  }

  .product-description {
    max-width: 100%;
  }

  .features-list {
    text-align: left;
  }

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

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

@media (max-width: 600px) {
  /* Reduce GPU load on mobile */
  .orb {
    filter: blur(80px);
    animation-duration: 30s;
  }

  body::before {
    opacity: 0.02;
  }

  nav {
    padding: 1rem clamp(1.25rem, 4vw, 2rem);
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: rgba(10, 9, 8, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 0.25rem;
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 101;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-link {
    display: block;
    font-size: 1rem;
    padding: 0.75rem 0;
    width: 100%;
  }

  .nav-contact {
    margin-top: 1rem;
    text-align: center;
  }

  .hero {
    padding: 2rem clamp(1.25rem, 4vw, 2rem);
  }

  h1 {
    font-size: clamp(2.25rem, 8vw, 3rem);
  }

  .product {
    padding: 4rem clamp(1.25rem, 4vw, 2rem) 6rem;
  }

  .philosophy {
    padding: 3rem clamp(1.25rem, 4vw, 2rem) 4rem;
  }

  .philosophy-quote p {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
  }

  .services {
    padding: 4rem clamp(1.25rem, 4vw, 2rem) 6rem;
  }

  .about {
    padding: 4rem clamp(1.25rem, 4vw, 2rem) 6rem;
  }

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