:root {
  --forest-dark: #1a3020;
  --sage: #a3b899;
  --moss: #3e6b4e;
  --mist: #f0f4ec;
  --surface-forest: #243d2a;
  --surface-elevated: #2e4d38;
  --text-on-dark: #e8efe4;
  --text-muted: #a3b899;
  --warm: #9a6b42;
  --orange-start: #ffb347;
  --orange-mid: #ff8c42;
  --orange-end: #e65100;
  --gold: #d4af37;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-on-dark);
  background:
    radial-gradient(ellipse 90% 60% at 70% 20%, rgba(62, 107, 78, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 50% at 15% 80%, rgba(154, 107, 66, 0.22), transparent 50%),
    linear-gradient(165deg, #0f1c14 0%, var(--forest-dark) 35%, var(--surface-forest) 70%, #152418 100%);
  background-attachment: fixed;
  cursor: none;
  overflow-x: hidden;
}

body.is-touch {
  cursor: auto;
}

body.is-touch .cursor {
  display: none !important;
}

a,
button {
  cursor: none;
}

body.is-touch a,
body.is-touch button {
  cursor: pointer;
}

/* —— Camera focus cursor (corner brackets + exposure) —— */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  pointer-events: none;
  z-index: 10000;
  transform: translate3d(-100px, -100px, 0);
  opacity: 1;
  visibility: visible;
}

body:not(.is-touch) .cursor {
  display: block !important;
}

.cursor__bracket {
  position: absolute;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border-color: rgba(255, 255, 255, 0.95);
  border-style: solid;
  border-width: 0;
  filter: drop-shadow(0 0 4px rgba(255, 179, 71, 0.45));
  transition: border-color 0.15s ease, filter 0.15s ease;
}

.cursor__bracket--tl {
  top: 0;
  left: 0;
  border-top-width: 2px;
  border-left-width: 2px;
}

.cursor__bracket--tr {
  top: 0;
  right: 0;
  border-top-width: 2px;
  border-right-width: 2px;
}

.cursor__bracket--bl {
  bottom: 0;
  left: 0;
  border-bottom-width: 2px;
  border-left-width: 2px;
}

.cursor__bracket--br {
  bottom: 0;
  right: 0;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

.cursor.is-focusing .cursor__bracket {
  animation: edge-flash 0.55s ease-out;
}

@keyframes edge-flash {
  0%,
  100% {
    border-color: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 0 4px rgba(255, 179, 71, 0.45)) brightness(1);
  }
  15%,
  45% {
    border-color: rgba(255, 179, 71, 1);
    filter: drop-shadow(0 0 10px rgba(255, 179, 71, 0.95)) brightness(2.2);
  }
  30%,
  60% {
    border-color: rgba(255, 255, 255, 0.35);
    filter: drop-shadow(0 0 2px rgba(255, 179, 71, 0.2)) brightness(0.85);
  }
  75% {
    border-color: rgba(255, 220, 160, 1);
    filter: drop-shadow(0 0 8px rgba(255, 179, 71, 0.8)) brightness(1.7);
  }
}

.cursor.is-focusing {
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
}

/* Exposure / brightness meter beside reticle */
.cursor__ev {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(255, 179, 71, 0.35));
}

.cursor__ev-icon {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
  /* Keep icon readable on dark forest background */
  filter: brightness(0) invert(1) sepia(1) saturate(4) hue-rotate(350deg);
}

.cursor.is-focusing .cursor__ev {
  animation: ev-pulse 0.55s ease-out;
}

@keyframes ev-pulse {
  0%,
  100% {
    opacity: 0.9;
  }
  40% {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(255, 179, 71, 0.85)) brightness(1.35);
  }
}

/* —— Loader —— */
.loader {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  z-index: 50;
  width: min(280px, 70vw);
  text-align: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
}

.loader__bar {
  height: 2px;
  background: rgba(163, 184, 153, 0.25);
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.loader__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--moss), var(--orange-mid));
  transition: width 0.15s ease;
}

.loader__text {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* —— 3D canvas —— */
.phone-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* —— Nav —— */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
  background: linear-gradient(to bottom, rgba(15, 28, 20, 0.85), transparent);
  mix-blend-mode: normal;
}

.nav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--mist);
  text-decoration: none;
}

.nav__links {
  display: none;
  gap: 1.5rem;
}

.nav__links a {
  color: var(--sage);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.nav__links a:hover {
  color: var(--mist);
}

.nav__cta {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--forest-dark);
  background: var(--sage);
  padding: 0.55rem 0.9rem;
  border-radius: 2px;
  transition: filter 0.2s ease;
}

.nav__cta:hover {
  filter: brightness(1.08);
}

@media (min-width: 768px) {
  .nav__links {
    display: flex;
  }
}

/* —— Audio toggle —— */
.audio-toggle {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(163, 184, 153, 0.35);
  background: rgba(26, 48, 32, 0.75);
  backdrop-filter: blur(10px);
  color: var(--sage);
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.65rem 0.9rem;
  border-radius: 2px;
}

.audio-toggle[aria-pressed="true"] .audio-toggle__waves i {
  animation: none;
  height: 4px !important;
  opacity: 0.35;
}

.audio-toggle__waves {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.audio-toggle__waves i {
  display: block;
  width: 2px;
  background: var(--orange-mid);
  border-radius: 1px;
  animation: wave 0.9s ease-in-out infinite;
}

.audio-toggle__waves i:nth-child(1) {
  height: 6px;
  animation-delay: 0s;
}
.audio-toggle__waves i:nth-child(2) {
  height: 12px;
  animation-delay: 0.15s;
}
.audio-toggle__waves i:nth-child(3) {
  height: 8px;
  animation-delay: 0.3s;
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.55);
  }
  50% {
    transform: scaleY(1);
  }
}

/* —— Panels —— */
main {
  position: relative;
  z-index: 2;
}

.panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem clamp(1.25rem, 5vw, 4rem);
  max-width: 640px;
  opacity: 0.28;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.panel.is-inview {
  opacity: 1;
  transform: translateY(0);
}

.panel--hero {
  max-width: 720px;
  padding-top: 8rem;
}

.panel--side-left {
  margin-right: auto;
}

.panel--side-right {
  margin-left: auto;
  text-align: right;
  align-items: flex-end;
}

.panel--magic,
.panel--cta {
  max-width: 680px;
}

.panel--langs {
  margin-left: auto;
  text-align: right;
  align-items: flex-end;
}

.panel__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}

.panel__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.panel__lead {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 34rem;
  margin: 0 0 1.75rem;
}

.panel--side-right .panel__lead,
.panel--langs .panel__lead {
  margin-left: auto;
}

.panel__fine {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.panel__fine a {
  color: var(--sage);
  text-decoration: none;
  border-bottom: 1px solid rgba(163, 184, 153, 0.35);
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.feature-list li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--mist);
  font-size: 0.95rem;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, var(--orange-start), var(--orange-end));
  border-radius: 1px;
}

.btn-magic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  padding: 1rem 1.6rem;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--orange-start), var(--orange-mid), var(--orange-end));
  box-shadow: 0 12px 40px rgba(230, 81, 0, 0.28);
  transition: transform 0.25s ease, filter 0.25s ease;
}

.panel--side-right .btn-magic,
.panel--langs .btn-magic {
  align-self: flex-end;
}

.btn-magic:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.06);
}

.footer {
  position: relative;
  z-index: 2;
  padding: 2rem clamp(1.25rem, 5vw, 4rem) 5rem;
  color: rgba(163, 184, 153, 0.55);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.footer__attr {
  margin: 0.5rem 0 0;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.footer__attr a {
  color: var(--sage);
  text-decoration: none;
  border-bottom: 1px solid rgba(163, 184, 153, 0.3);
}

@media (max-width: 900px) {
  .panel--side-right,
  .panel--langs {
    text-align: left;
    align-items: flex-start;
    margin-left: 0;
  }

  .panel--side-right .panel__lead,
  .panel--langs .panel__lead {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cursor.is-focusing .cursor__bracket,
  .cursor.is-focusing .cursor__ev,
  .audio-toggle__waves i {
    animation: none;
  }
}
