/* ============================================================
   happy2rave — shared styles
   dual palette: corporate-happy meets liquid-glitch rave
   ============================================================ */

:root {
  /* happy side */
  --cream: #F5EFE0;
  --cream-deep: #EFE7D2;
  --sun: #FFD23F;
  --sun-deep: #F5B400;
  --tomato: #FF6B35;
  --ink: #1A1612;
  --ink-soft: #2C261F;

  /* rave side */
  --void: #0A0612;
  --void-deep: #050308;
  --magenta: #FF006E;
  --cyan: #00F0FF;
  --uv: #9D00FF;
  --bone: #F5EFE0;

  /* type */
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* metrics */
  --max-w: 1440px;
  --pad-x: clamp(20px, 4vw, 64px);
  --line: 1px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html.rave body {
  background: var(--void);
  color: var(--bone);
}

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

/* ============================================================
   layout shells
   ============================================================ */

.shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.rule {
  border: 0;
  border-top: var(--line) solid currentColor;
  opacity: 0.18;
  margin: 0;
}

/* ============================================================
   navigation
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: var(--line) solid rgba(26,22,18,0.14);
  backdrop-filter: blur(10px);
}
html.rave .nav {
  background: rgba(10,6,18,0.85);
  border-bottom-color: rgba(245,239,224,0.12);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px var(--pad-x);
  display: grid;
  /* equal side columns keep the centre links truly centred, so they
     don't drift when a page uses a wider CTA label (e.g. "send mail →") */
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}
.nav-inner > nav { justify-self: center; }
.nav-inner > .nav-cta { justify-self: end; }

.nav-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  justify-self: start;
}
.nav-mark .nav-icon {
  display: block;
  height: 36px;
  width: 36px;
  object-fit: contain;
  border-radius: 50%;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.nav-mark:hover .nav-icon {
  transform: rotate(12deg) scale(1.08);
  filter: drop-shadow(0 0 6px rgba(255,0,110,0.4));
}
.nav-mark .nav-logo {
  display: block;
  height: 100%;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: clamp(18px, 3vw, 36px);
  list-style: none;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.nav-links a {
  position: relative;
  padding: 4px 2px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  opacity: 1;
}
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--magenta);
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: lowercase;
  padding: 8px 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  transition: all 0.2s;
}
.nav-cta:hover { background: var(--ink); color: var(--cream); }
html.rave .nav-cta:hover { background: var(--magenta); color: var(--void); border-color: var(--magenta); }

/* on small screens the full wordmark + centred links + CTA can't share one
   row, so collapse the mark to just its icon (keeps everything on screen) */
@media (max-width: 600px) {
  .nav-mark .nav-logo { display: none !important; }
}

/* ============================================================
   the LOGO (centerpiece wordmark)
   ============================================================ */

.h2r-wordmark {
  display: inline-block;
  position: relative;
  line-height: 0.85;
  font-weight: 800;
  letter-spacing: -0.04em;
  user-select: none;
}

.h2r-wordmark .wm-row {
  display: flex;
  align-items: baseline;
  gap: 0;
}

/* "happy" — corporate friendly rounded */
.h2r-happy {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "wdth" 100, "opsz" 96;
  color: var(--ink);
  position: relative;
  display: inline-block;
  padding-right: 0.02em;
}
/* a corporate "smiley sun" sits where the dot of an i would go,
   anchored above the word as a logo flourish */
.h2r-happy .happy-sun {
  position: absolute;
  top: -0.18em;
  right: -0.12em;
  width: 0.35em;
  height: 0.35em;
  border-radius: 50%;
  background: var(--sun);
  box-shadow:
    0 0 0 0.05em var(--cream),
    0 0 0 0.07em var(--ink);
}
.h2r-happy .happy-sun::before,
.h2r-happy .happy-sun::after {
  content: "";
  position: absolute;
  width: 0.045em;
  height: 0.045em;
  background: var(--ink);
  border-radius: 50%;
  top: 35%;
}
.h2r-happy .happy-sun::before { left: 26%; }
.h2r-happy .happy-sun::after { right: 26%; }
.h2r-happy .happy-mouth {
  position: absolute;
  width: 0.13em;
  height: 0.07em;
  border: 0.018em solid var(--ink);
  border-top: 0;
  border-radius: 0 0 1em 1em;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
}
/* smile arc under "happy" — corporate-cheerful flourish */
.h2r-happy .happy-arc {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -0.16em;
  height: 0.2em;
  border: 0.04em solid var(--tomato);
  border-top: 0;
  border-radius: 0 0 1em 1em;
  pointer-events: none;
}

/* "2" — bridge character */
.h2r-bridge {
  font-family: var(--font-display);
  font-weight: 800;
  position: relative;
  padding: 0 0.05em;
  display: inline-block;
  background: linear-gradient(180deg, var(--tomato) 0%, var(--tomato) 48%, var(--magenta) 52%, var(--uv) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* "rave" — glitch + liquid */
.h2r-rave {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--void);
  position: relative;
  display: inline-block;
}
html.rave .h2r-rave { color: var(--bone); }

/* chromatic split layers */
.h2r-rave .rave-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.85;
}
.h2r-rave .rave-c { color: var(--cyan); transform: translate(-2px, 0); }
.h2r-rave .rave-m { color: var(--magenta); transform: translate(2px, 1px); }

/* liquid wobble via filter */
.h2r-rave-text {
  filter: url(#liquidWobble);
}

/* a small "v0.3 — concept" stamp */
.wm-stamp {
  position: absolute;
  top: -6px;
  right: -8px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: lowercase;
  letter-spacing: 0.06em;
  color: var(--tomato);
  border: 1px dashed currentColor;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--cream);
  transform: rotate(4deg);
}
html.rave .wm-stamp { background: var(--void); color: var(--cyan); }

/* ============================================================
   buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--cream);
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover {
  background: var(--tomato);
  border-color: var(--tomato);
  color: var(--cream);
}
.btn.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn.btn-ghost:hover { background: var(--ink); color: var(--cream); }

.btn.btn-rave {
  background: var(--magenta);
  border-color: var(--magenta);
  color: var(--void);
  box-shadow: 0 0 0 0 var(--magenta);
}
.btn.btn-rave:hover {
  box-shadow: 0 0 24px 0 rgba(255,0,110,0.6);
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--void);
}

html.rave .btn.btn-ghost { color: var(--bone); border-color: var(--bone); }
html.rave .btn.btn-ghost:hover { background: var(--bone); color: var(--void); }

/* ============================================================
   footer (shared)
   ============================================================ */

.foot {
  margin-top: 120px;
  background: var(--void);
  color: var(--bone);
  position: relative;
  overflow: hidden;
}
.foot::before {
  /* the morphing seam */
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 80px;
  background:
    radial-gradient(80% 100% at 20% 0%, var(--cream) 49%, transparent 50%),
    radial-gradient(70% 100% at 55% 0%, var(--cream) 48%, transparent 49%),
    radial-gradient(80% 100% at 85% 0%, var(--cream) 51%, transparent 52%);
  filter: url(#liquidWobble);
}
html.rave .foot { margin-top: 80px; }
html.rave .foot::before {
  background:
    radial-gradient(80% 100% at 20% 0%, var(--void-deep) 49%, transparent 50%),
    radial-gradient(70% 100% at 55% 0%, var(--void-deep) 48%, transparent 49%),
    radial-gradient(80% 100% at 85% 0%, var(--void-deep) 51%, transparent 52%);
}

.foot-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 120px var(--pad-x) 40px;
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 800px) {
  .foot-inner { grid-template-columns: 1fr 1fr; gap: 32px; padding-top: 100px; }
}

.foot-brand {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
}
.foot-brand-tag {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: 0.6;
  max-width: 28ch;
}

.foot-col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.5;
  margin-bottom: 14px;
}
.foot-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.foot-col a {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  opacity: 0.95;
}
.foot-col a:hover { color: var(--cyan); }

.foot-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px var(--pad-x);
  border-top: 1px solid rgba(245,239,224,0.1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.5;
  text-transform: lowercase;
}

/* ============================================================
   utility text styles
   ============================================================ */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.55;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

.h-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h-display em {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--tomato);
  font-weight: 600;
}
html.rave .h-display em { color: var(--magenta); }

.h-sub {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.body-lg {
  font-size: 17px;
  line-height: 1.55;
  max-width: 56ch;
  text-wrap: pretty;
}

.mono { font-family: var(--font-mono); }

/* ============================================================
   rave cursor halo
   ============================================================ */
html.rave .rave-cursor {
  position: fixed;
  pointer-events: none;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,0,110,0.18), transparent 60%);
  transform: translate(-50%, -50%);
  z-index: 1;
  mix-blend-mode: screen;
  transition: opacity 0.4s;
}

/* ============================================================
   selection
   ============================================================ */
::selection { background: var(--magenta); color: var(--cream); }
html.rave ::selection { background: var(--cyan); color: var(--void); }

/* ============================================================
   scroll-reveal (site-wide, progressive enhancement)
   elements stay visible with no JS; app.js "arms" (hides) only
   the off-screen ones, then reveals them on scroll — so a JS
   failure never leaves content hidden.
   ============================================================ */
[data-reveal] {
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
[data-reveal].reveal-armed {
  opacity: 0;
  transform: translateY(20px);
}

/* ============================================================
   mode orb — the rave accent + happy⇄rave toggle (homepage)
   ============================================================ */
.mode-orb {
  --orb-size: clamp(92px, 11vw, 140px);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--orb-size);
  height: var(--orb-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  isolation: isolate;
  background: radial-gradient(circle at 50% 38%, #1a0e2e 0%, var(--void-deep) 72%);
  color: var(--bone);
  box-shadow:
    0 0 0 1px rgba(255, 0, 110, 0.45),
    0 0 28px -6px rgba(255, 0, 110, 0.6),
    0 0 60px -12px rgba(0, 240, 255, 0.45);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.5s ease;
  animation: orbPulse 3.6s ease-in-out infinite;
}
.mode-orb::before {
  /* spinning neon halo ring */
  content: "";
  position: absolute;
  inset: -3px;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--magenta), var(--uv), var(--cyan), var(--magenta));
  filter: blur(8px);
  opacity: 0.7;
  animation: orbSpin 6s linear infinite;
}
.mode-orb .orb-icon {
  width: 56%;
  height: 56%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(245, 239, 224, 0.18);
}
.mode-orb .orb-label {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--magenta);
}
.mode-orb:hover { transform: scale(1.06); }
.mode-orb:active { transform: scale(0.98); }
.mode-orb:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; }

/* in rave mode the orb flips into the sunny "back to happy" control */
html.rave .mode-orb {
  background: radial-gradient(circle at 50% 38%, var(--sun) 0%, var(--sun-deep) 72%);
  box-shadow:
    0 0 0 1px rgba(255, 210, 63, 0.6),
    0 0 34px -4px rgba(255, 210, 63, 0.7);
}
html.rave .mode-orb::before { opacity: 0; }
html.rave .mode-orb .orb-label { color: var(--sun); }

@keyframes orbSpin { to { transform: rotate(360deg); } }
@keyframes orbPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 0, 110, 0.45),
      0 0 24px -8px rgba(255, 0, 110, 0.5),
      0 0 52px -14px rgba(0, 240, 255, 0.4);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(0, 240, 255, 0.55),
      0 0 40px -2px rgba(255, 0, 110, 0.75),
      0 0 80px -8px rgba(0, 240, 255, 0.6);
  }
}

/* ============================================================
   reduced motion — respect the user's OS preference
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal].reveal-armed {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .mode-orb,
  .mode-orb::before {
    animation: none !important;
  }
}
