:root {
  --color-bg: #0f1419;
  --color-surface: #1a2332;
  --color-surface-alt: #1e2838;
  --color-accent: #2dd4bf;
  --color-accent-warm: #fb923c;
  --color-accent-purple: #a78bfa;
  --color-text-primary: #f7f8f8;
  --color-text-secondary: #8a8f98;
  --color-text-muted: #62666d;
  --color-border-subtle: rgba(255, 255, 255, 0.08);
  --color-border-teal: rgba(45, 212, 191, 0.15);
  --color-border-teal-hover: rgba(45, 212, 191, 0.35);
  --font-head: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius-std: 8px;
  --radius-panel: 12px;
  --radius-btn: 6px;
  --radius-pill: 9999px;
  --max-width: 1200px;
  --section-pad: 100px;
  --section-pad-mobile: 60px;
}

/* ===== AMBIENT GRADIENT BLOBS ===== */
.blob-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}
.blob-teal {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.07) 0%, transparent 70%);
  top: -120px; right: -120px;
}
.blob-purple {
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.08) 0%, transparent 70%);
  bottom: 8%; left: -130px;
}
.blob-warm {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(251, 146, 60, 0.05) 0%, transparent 70%);
  top: 50%; right: 12%;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
nav.scrolled {
  background: rgba(15, 20, 25, 0.75);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--color-border-subtle);
}
.nav-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-prompt {
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 23px;
}
.nav-name {
  font-family: var(--font-mono), var(--font-body);
  color: var(--color-text-primary, var(--text));
  font-weight: 400;
}
.cursor-blink {
  animation: cursorBlink 1.2s steps(2) infinite;
}
@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}
.nav-links { display: flex; gap: 36px; align-items: center; }
.nav-links a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--color-accent); }
.nav-links a.active { color: var(--color-accent); }
.nav-cta {
  background: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  transition: opacity 0.2s ease;
}
.nav-cta:hover { opacity: 0.9; }
.nav-right { display: flex; align-items: center; gap: 32px; }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--color-text-primary);
  transition: all 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-direction: column;
  padding: 20px 40px;
  gap: 20px;
  z-index: 99;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 6px 0;
}
.mobile-menu a:hover { color: var(--color-accent); }
.mobile-menu .nav-cta {
  align-self: flex-start;
  background: var(--color-accent);
  color: var(--color-bg);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: var(--radius-btn);
  margin-top: 4px;
}

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 204px 24px 96px;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.page-header .section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.page-header .hero-bg-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.6;
}
.mono-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-accent);
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 14px;
}
.page-header h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 48px);
  color: var(--color-text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}
.page-header .subtitle {
  font-size: 18px;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* ===== RETRO ANSWERING MACHINE — ANIMATED SVG BACKGROUND ===== */

/* Cassette tape reels: slow continuous rotation at different speeds */
@keyframes reelSpinA {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes reelSpinB {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.reel-left {
  transform-box: fill-box;
  transform-origin: center;
  animation: reelSpinA 8s linear infinite;
}
.reel-right {
  transform-box: fill-box;
  transform-origin: center;
  animation: reelSpinB 12s linear infinite;
}

/* NEW MESSAGE LED: bright red blink — ON 0.8s, OFF 0.5s */
@keyframes ledBlink {
  0%, 61.5%  { opacity: 0.9; }
  61.6%, 100% { opacity: 0; }
}
.led-new-message {
  animation: ledBlink 1.3s step-end infinite;
}

/* Message counter flicker: digits briefly glitch every ~5.5s */
@keyframes counterFlicker {
  0%, 88%   { opacity: 1; }
  89%, 92%  { opacity: 0; }
  93%, 100% { opacity: 1; }
}
@keyframes counterFlickerAlt {
  0%, 88%   { opacity: 0; }
  89%, 92%  { opacity: 0.65; }
  93%, 100% { opacity: 0; }
}
.counter-03 { animation: counterFlicker 5.5s ease-in-out infinite; }
.counter-04 { animation: counterFlickerAlt 5.5s ease-in-out infinite; }

/* Speaker sound waves: expanding arcs that fade out, with pauses */
@keyframes speakerWave {
  0%   { transform: scale(0.5); opacity: 0; }
  8%   { opacity: 0.4; }
  40%  { transform: scale(3.5); opacity: 0; }
  100% { transform: scale(3.5); opacity: 0; }
}
.speaker-wave {
  transform-box: fill-box;
  transform-origin: center;
  animation: speakerWave 5s ease-out infinite;
}
.wave-1 { animation-delay: 0s; }
.wave-2 { animation-delay: 0.55s; }
.wave-3 { animation-delay: 1.1s; }

/* Steam from coffee mug: gentle rise and fade */
@keyframes steamRise {
  0%   { transform: translateY(0) scaleX(1); opacity: 0; }
  12%  { opacity: 0.3; }
  45%  { transform: translateY(-16px) scaleX(1.3); opacity: 0.12; }
  100% { transform: translateY(-28px) scaleX(1.6); opacity: 0; }
}
.steam-wisp {
  animation: steamRise 7s ease-out infinite;
}
.steam-1 { animation-delay: 0s; }
.steam-2 { animation-delay: 2.3s; }
.steam-3 { animation-delay: 4.6s; }

/* Sticky note: subtle corner flutter */
@keyframes noteFlutter {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(1.5deg); }
  75%      { transform: rotate(-1deg); }
}
.sticky-note {
  transform-box: fill-box;
  transform-origin: top left;
  animation: noteFlutter 4s ease-in-out infinite;
}

/* Rotary dial: slow spin forward, hold, spring back */
@keyframes rotaryDial {
  0%   { transform: rotate(0deg); }
  40%  { transform: rotate(30deg); }
  45%  { transform: rotate(30deg); }
  66%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}
.rotary-dial {
  transform-box: fill-box;
  transform-origin: center;
  animation: rotaryDial 9s ease-in-out infinite;
}

/* Dial center: purple pulse */
@keyframes dialGlow {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 0.35; }
}
.dial-center-glow {
  animation: dialGlow 3s ease-in-out infinite;
}

/* Warm ambient glow: soft breathing behind the whole scene */
@keyframes ambientGlow {
  0%, 100% { opacity: 0.18; transform: scale(1); }
  50%      { opacity: 0.28; transform: scale(1.06); }
}
.ambient-glow {
  transform-box: fill-box;
  transform-origin: center;
  animation: ambientGlow 8s ease-in-out infinite;
}

/* Desk lamp: subtle incandescent flicker */
@keyframes lampFlicker {
  0%, 100% { opacity: 0.1; }
  5%       { opacity: 0.12; }
  8%       { opacity: 0.07; }
  10%      { opacity: 0.11; }
  50%      { opacity: 0.1; }
  55%      { opacity: 0.06; }
  58%      { opacity: 0.12; }
  60%      { opacity: 0.1; }
}
.lamp-cone {
  animation: lampFlicker 3s ease-in-out infinite;
}

/* ===== CONTACT SECTION ===== */
.contact-section {
  padding: 60px 24px 120px;
  position: relative;
  z-index: 1;
}
.contact-section .section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

/* Contact info column */
.contact-info h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(28px, 3.5vw, 36px);
  color: var(--color-text-primary);
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}
.contact-info p {
  font-size: 16px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}
.contact-detail {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(26, 35, 50, 0.45);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-panel);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.contact-detail .icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-teal-hover);
  border-radius: var(--radius-std);
  flex-shrink: 0;
}
.contact-detail .icon svg { width: 20px; height: 20px; }
.contact-detail .label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 2px;
}
.contact-detail .value {
  font-size: 15px;
  color: var(--color-text-primary);
  font-weight: 500;
}
.contact-detail .value a { color: var(--color-accent); }

/* What to expect */
.what-to-expect {
  margin-top: 40px;
  padding: 32px;
  background: rgba(26, 35, 50, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-panel);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
.what-to-expect h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text-primary);
  margin-bottom: 16px;
}
.what-to-expect ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.what-to-expect li {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.55;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.what-to-expect li .step-num {
  font-family: var(--font-mono);
  color: var(--color-accent);
  flex-shrink: 0;
  width: 20px;
}
.what-to-expect li:nth-child(2) .step-num { color: var(--color-accent-purple); }
.what-to-expect li:nth-child(4) .step-num { color: var(--color-accent-purple); }

/* Form column */
.contact-form-wrap {
  background: rgba(26, 35, 50, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-panel);
  padding: 48px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
.contact-form-wrap h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}
.contact-form-wrap .form-sub {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 28px;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.3px;
}
.contact-form input,
.contact-form textarea,
.contact-form select {
  background: rgba(15, 20, 25, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-btn);
  padding: 12px 16px;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--color-text-muted); }
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%238a8f98' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.contact-form button {
  background: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 8px;
}
.contact-form button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.35), 0 4px 16px rgba(45, 212, 191, 0.15);
}
.form-success {
  display: none;
  text-align: center;
  padding: 20px;
  color: var(--color-accent);
  font-size: 15px;
  font-weight: 500;
}
.form-success.show { display: block; }

.form-error {
  display: none;
  text-align: center;
  padding: 20px;
  color: #fb923c;
  font-size: 15px;
  font-weight: 500;
}
.form-error.show { display: block; }

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== FOOTER ===== */
footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border-subtle);
  padding: 40px 24px 28px;
  position: relative;
  z-index: 1;
}
.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  align-items: center;
}
.footer-left {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 32px;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-left .nav-prompt { font-size: 30px; }
.footer-center { display: flex; gap: 28px; justify-content: center; }
.footer-center a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}
.footer-center a:hover { color: var(--color-accent); }
.footer-right { text-align: right; font-size: 14px; color: var(--color-text-secondary); }
.footer-copy {
  text-align: center;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border-subtle);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .hamburger { display: flex; order: 1; }
  .nav-right .nav-cta { order: 2; }
  .nav-right { justify-content: flex-end; gap: 16px; }
  section, .contact-section { padding: var(--section-pad-mobile) 20px; }
  .page-header { padding: 174px 20px 67px; }
  .contact-section .section-inner { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 18px; }
  .footer-left, .footer-right { justify-content: center; text-align: center; }
  .footer-left { display: inline-flex; }
  .contact-form-wrap { padding: 28px; }
}

@media (max-width: 480px) {
  .contact-form button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .cursor-blink { animation: none; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
  /* Retro Answering Machine SVG: freeze all animations, show final state */
  .reel-left,
  .reel-right,
  .led-new-message,
  .counter-03,
  .counter-04,
  .speaker-wave,
  .steam-wisp,
  .sticky-note,
  .rotary-dial,
  .dial-center-glow,
  .ambient-glow,
  .lamp-cone {
    animation: none !important;
  }
  /* LED stays ON (static), speaker waves and steam hidden */
  .led-new-message {
    opacity: 0.9 !important;
  }
  .speaker-wave,
  .steam-wisp,
  .counter-04 {
    opacity: 0 !important;
  }
  /* Disable backdrop-filter for performance */
  .contact-form-wrap,
  .what-to-expect,
  .contact-detail,
  nav.scrolled,
  .mobile-menu {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* ===== BACKDROP-FILTER FALLBACK ===== */
@supports not (backdrop-filter: blur(1px)) {
  .contact-form-wrap,
  .what-to-expect,
  .contact-detail {
    background: var(--color-surface);
  }
  nav.scrolled {
    background: var(--color-bg);
  }
  .mobile-menu {
    background: var(--color-bg);
  }
}
