:root {
  --bg: #161616;
  --bg-2: #15100b;
  --cream: #f4ede2;
  --muted: #a89b8a;
  --amber: #ff9a4d;
  --amber-deep: #ff5b2e;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  background: var(--bg);
  color: var(--cream);
  overscroll-behavior-y: none;
}

body {
  font-family: "Archivo", sans-serif;
}

/* ---------- grain overlay ---------- */
#grain {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ---------- hero background ---------- */
#hero-visual {
  background:
    radial-gradient(120% 70% at 50% 8%, #1c140d 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 58%, #2a1e15 76%, #2a1e15 87%, #0d0805 100%);
}

#hero-glow {
  background: radial-gradient(ellipse 60% 100% at 50% 100%, rgba(255, 122, 61, 0.35), rgba(255, 91, 46, 0) 72%);
  filter: blur(28px);
  will-change: opacity, transform;
}

.curvy-glow {
  filter: blur(6px);
}

.curvy-line {
  stroke-dasharray: 60 46;
  animation: dash-flow 5s linear infinite;
}

@keyframes dash-flow {
  to {
    stroke-dashoffset: 636;
  }
}

/* ---------- wordmark ---------- */
.wordmark-text {
  font-size: clamp(6rem, 21vw, 20rem);
  line-height: 0.82;
  letter-spacing: -0.01em;
  color: rgba(8, 5, 3, 0.88);
  white-space: nowrap;
}

/* ---------- section 3: photo bg ---------- */
.s3-bg-layer {
  transform-origin: center center;
  will-change: transform, opacity;
  opacity: 1;
  transition: opacity 1.4s ease;
}

.s3-bg-layer.is-hidden {
  opacity: 0;
}

#s3-scrim {
  background:
    linear-gradient(180deg, rgba(22, 22, 22, 0) 35%, rgba(22, 22, 22, 0.7) 78%, rgba(22, 22, 22, 0.94) 100%),
    linear-gradient(90deg, rgba(22, 22, 22, 0.6) 0%, rgba(22, 22, 22, 0) 45%);
}

/* ---------- section 4: horizontal card track ---------- */
#s4-track {
  padding-left: 38vw;
  padding-right: 32vw;
}

.s4-card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(300px, 58vw, 620px);
  height: clamp(380px, 64vh, 560px);
  padding: 32px;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(244, 237, 226, 0.1), rgba(21, 16, 11, 0.6));
  border: 1px solid rgba(244, 237, 226, 0.14);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  transform: rotate(var(--tilt, 0deg));
}

.s4-card:not(:first-child) {
  margin-left: -48px;
}

.s4-card:nth-child(1) {
  z-index: 10;
}

.s4-card:nth-child(2) {
  z-index: 20;
}

.s4-card:nth-child(3) {
  z-index: 30;
}

.s4-card:nth-child(4) {
  z-index: 40;
}

.s4-icon-badge {
  position: absolute;
  top: 22px;
  left: 22px;
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  background: rgba(22, 22, 22, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
}

.s4-icon-badge i {
  width: 18px;
  height: 18px;
}

.s4-icon-ghost {
  position: absolute;
  top: -6%;
  right: -12%;
  width: 70%;
  height: 70%;
  color: rgba(244, 237, 226, 0.1);
  stroke-width: 1;
}

.s4-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

.s4-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(22, 16, 11, 0.1) 0%, rgba(18, 12, 8, 0.55) 55%, rgba(14, 9, 6, 0.9) 100%);
}

/* ---------- section 6: auto-scrolling marquee ---------- */
.s6-card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(170px, 13vw, 230px);
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid rgba(244, 237, 226, 0.35);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease, border-color 0.45s ease;
}

.s6-card:hover {
  transform: scale(1.05) rotate(-3deg);
  z-index: 20;
  border-color: rgba(244, 237, 226, 0.7);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
}

.s6-card:nth-child(even):hover {
  transform: scale(1.05) rotate(3deg);
}

.s6-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.s6-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(22, 22, 22, 0) 45%, rgba(22, 22, 22, 0.85) 100%);
}

.s6-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background: rgba(22, 22, 22, 0.6);
  border: 1px solid rgba(244, 237, 226, 0.18);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
}

.s6-badge i {
  width: 13px;
  height: 13px;
}

.s6-card-title {
  position: relative;
  z-index: 10;
  font-family: "Archivo Black", sans-serif;
  color: #fff;
  font-size: clamp(0.8rem, 1.1vw, 1rem);
  line-height: 1.15;
}

/* ---------- section: my work ---------- */
.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 260px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(244, 237, 226, 0.1), rgba(21, 16, 11, 0.6));
  border: 1px solid rgba(244, 237, 226, 0.14);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.work-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 154, 77, 0.5);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.work-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.work-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(22, 16, 11, 0.15) 0%, rgba(18, 12, 8, 0.55) 55%, rgba(14, 9, 6, 0.92) 100%);
}

.work-card:hover .work-card-img {
  transform: scale(1.06);
}

.work-card-badge {
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  background: rgba(22, 22, 22, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  margin-bottom: auto;
}

.work-card-badge i {
  width: 18px;
  height: 18px;
}

.work-card-external {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: rgba(22, 22, 22, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.work-card-external i {
  width: 14px;
  height: 14px;
}

.work-card:hover .work-card-external {
  opacity: 1;
  transform: translate(0, 0);
}

.work-card-body {
  position: relative;
  z-index: 2;
}

.work-card-title {
  font-family: "Archivo Black", sans-serif;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1.2;
  margin-bottom: 6px;
}

.work-card-desc {
  font-family: "Archivo", sans-serif;
  color: rgba(244, 237, 226, 0.85);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ---------- section: play a string (3D guitar) ---------- */
#play-glow {
  background: radial-gradient(ellipse 60% 60% at 50% 50%, rgba(255, 154, 77, 0.28), rgba(255, 91, 46, 0) 72%);
  filter: blur(40px);
}

#guitar3d-wrap {
  border-radius: 2rem;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(244, 237, 226, 0.08), rgba(21, 16, 11, 0.55));
  border: 1px solid rgba(244, 237, 226, 0.14);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  touch-action: none;
}

#guitar3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#guitar3d-wrap.is-ready #guitar3d-canvas {
  opacity: 1;
}

#guitar3d-hint {
  transition: opacity 0.4s ease;
}

/* ---------- section 7 & 8: photo-bg stacking cards ---------- */
#s7-bg,
#s8-bg {
  transform-origin: center center;
  will-change: transform;
}

#s7-scrim {
  background:
    linear-gradient(180deg, rgba(22, 22, 22, 0.15) 0%, rgba(22, 22, 22, 0.35) 55%, rgba(22, 22, 22, 0.92) 100%),
    linear-gradient(90deg, rgba(22, 22, 22, 0.55) 0%, rgba(22, 22, 22, 0) 50%);
}

#s8-scrim {
  background:
    linear-gradient(180deg, rgba(22, 22, 22, 0.1) 0%, rgba(22, 22, 22, 0.3) 55%, rgba(22, 22, 22, 0.92) 100%),
    linear-gradient(90deg, rgba(22, 22, 22, 0.55) 0%, rgba(22, 22, 22, 0) 50%);
}

.s7-badge,
.s8-badge {
  position: absolute;
  top: 2rem;
  left: 2rem;
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: rgba(22, 22, 22, 0.65);
  border: 1px solid rgba(244, 237, 226, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
}

.s7-badge i,
.s8-badge i {
  width: 20px;
  height: 20px;
}

/* ---------- footer ---------- */
.footer-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: var(--bg);
  color: var(--amber);
  flex-shrink: 0;
}

.footer-emblem i {
  width: 26px;
  height: 26px;
}

@media (min-width: 640px) {
  .footer-emblem {
    width: 84px;
    height: 84px;
  }

  .footer-emblem i {
    width: 38px;
    height: 38px;
  }
}

.footer-wordmark {
  font-family: "Archivo Black", sans-serif;
  color: var(--bg);
  line-height: 0.85;
  letter-spacing: -0.02em;
  font-size: clamp(3.2rem, 13vw, 8.5rem);
}

.footer-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 9999px;
  border: 1.5px solid rgba(22, 22, 22, 0.35);
  color: var(--bg);
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.footer-social i {
  width: 18px;
  height: 18px;
}

.footer-social:hover {
  background: var(--bg);
  color: var(--amber);
  border-color: var(--bg);
}

/* ---------- section 9: concentric rings ---------- */
.s9-ring {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 9999px;
  border: 1px solid rgba(244, 237, 226, 0.09);
  opacity: 0;
}

.s9-avatar {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  background: rgba(255, 154, 77, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  flex-shrink: 0;
}

.s9-avatar i {
  width: 22px;
  height: 22px;
}

.s9-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #6ee7a0;
  box-shadow: 0 0 6px rgba(110, 231, 160, 0.8);
  display: inline-block;
}

/* ---------- canvas ---------- */
.canvas-box {
  width: min(62vw, 760px, 42vh);
  aspect-ratio: 16 / 9;
}

.canvas-box-reflection {
  aspect-ratio: 16 / 5.4;
}

#guitar-canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.55));
}

#guitar-reflection {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.28;
  filter: blur(3px);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 75%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 75%);
}

/* ---------- side badge ---------- */
.side-badge {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* ---------- word clip reveal ---------- */
.word-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
}

.word-inner {
  display: inline-block;
  transform: translateY(115%);
  will-change: transform;
}

/* ---------- reveal defaults (pre-JS state to avoid FOUC) ---------- */
.reveal-fade {
  opacity: 0;
  transform: translateY(18px);
}

.reveal-badge {
  opacity: 0;
  transform: translateX(16px);
}

.reveal-cta {
  opacity: 0;
  transform: translateY(14px) scale(0.97);
}

.reveal-clip {
  clip-path: inset(0 100% 0 0);
}

/* ---------- reusable glass surface (nav pill, CTA pills) ---------- */
.glass-surface {
  position: relative;
  background: linear-gradient(180deg, rgba(244, 237, 226, 0.12), rgba(244, 237, 226, 0.03) 60%, rgba(21, 16, 11, 0.35));
  border: 1px solid rgba(244, 237, 226, 0.14);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 20px rgba(255, 255, 255, 0.03),
    0 10px 30px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.glass-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0) 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.glass-surface:hover {
  background: linear-gradient(180deg, rgba(244, 237, 226, 0.16), rgba(244, 237, 226, 0.05) 60%, rgba(21, 16, 11, 0.4));
}

/* solid fallback so the fixed nav pill stays legible over the bright footer,
   where backdrop-filter would otherwise pick up the orange behind it */
#nav-pill.on-light {
  background: rgba(22, 22, 22, 0.92);
  border-color: rgba(244, 237, 226, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ---------- rotating light ring around the lesson CTA ---------- */
.cta-glow {
  position: relative;
  padding: 2px;
  overflow: hidden;
  filter: drop-shadow(0 0 18px rgba(255, 154, 77, 0.35));
}

.cta-glow-spin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 280px;
  margin-top: -140px;
  margin-left: -140px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 255deg,
    rgba(255, 203, 150, 0.95) 300deg,
    rgba(255, 91, 46, 1) 325deg,
    transparent 355deg
  );
  animation: cta-spin 3s linear infinite;
}

@keyframes cta-spin {
  to {
    transform: rotate(360deg);
  }
}

.nav-link {
  position: relative;
  color: var(--muted);
  transition: color 0.3s ease;
}

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

/* ---------- loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}

#loader-bubbles {
  display: flex;
  align-items: center;
  gap: 12px;
}

.loader-bubble {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 154, 77, 0.55);
  animation: bubble-bounce 1.3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.loader-bubble:nth-child(1) {
  background: var(--amber);
  animation-delay: 0s;
}

.loader-bubble:nth-child(2) {
  background: #ffb46e;
  animation-delay: 0.18s;
}

.loader-bubble:nth-child(3) {
  background: var(--amber-deep);
  animation-delay: 0.36s;
}

@keyframes bubble-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0) scale(0.82);
    opacity: 0.55;
  }
  30% {
    transform: translateY(-18px) scale(1.06);
    opacity: 1;
  }
}

/* ---------- scroll cue ---------- */
.scroll-cue-line {
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, rgba(244, 237, 226, 0.6), transparent);
  animation: cue-drop 1.8s ease-in-out infinite;
}

@keyframes cue-drop {
  0% {
    transform: scaleY(0);
    transform-origin: top;
    opacity: 0;
  }
  40% {
    transform: scaleY(1);
    transform-origin: top;
    opacity: 1;
  }
  100% {
    transform: scaleY(1);
    transform-origin: bottom;
    opacity: 0;
  }
}

@media (max-width: 767px) {
  .canvas-box {
    width: 92vw;
  }

  .side-badge {
    display: none;
  }
}
