/* ═══════════════════════════════════════════════════════════
   WaldorfMinds — landing page
   A painted world · three doors: Presentation · Organizations · App
   ═══════════════════════════════════════════════════════════ */

/* ─── TOKENS (app palette) ───────────────────────────────── */
:root {
  --gold: #FFD43E;

  --ink:      #201A0C;
  --ink-soft: rgba(32, 26, 12, 0.58);

  --font: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --max-w: 1180px;

  color-scheme: light;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: #FFFFFF;
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
html { background: #FFFFFF; }
a { color: inherit; text-decoration: none; }
svg.svg-hidden { position: absolute; width: 0; height: 0; overflow: hidden; }

/* gold at the top, fading to white as you scroll down the page */
body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold) 36%, #FFFFFF 92%);
  z-index: 0;
  pointer-events: none;
}

/* ─── TOP BAR ────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(20px, 4vw, 48px);
}
.brand { display: block; line-height: 0; min-width: 0; flex: 0 1 auto; }
.brand img {
  display: block;
  height: 46px;
  width: auto;
  max-width: 40vw;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 1px 2px rgba(90, 62, 0, 0.18));
}
.topbar__cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  backdrop-filter: blur(12px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 4px 18px rgba(90, 62, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 2px rgba(255, 255, 255, 0.15);
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.topbar__cta:hover,
.topbar__cta:focus-visible {
  background: rgba(255, 255, 255, 0.34);
  border-color: rgba(255, 255, 255, 0.75);
  transform: translateY(-1px);
  box-shadow:
    0 9px 26px rgba(90, 62, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 2px rgba(255, 255, 255, 0.25);
}
.topbar__cta-arrow { transition: transform 0.2s ease; }
.topbar__cta:hover .topbar__cta-arrow,
.topbar__cta:focus-visible .topbar__cta-arrow { transform: translateX(3px); }

/* ─── STAGE ──────────────────────────────────────────────── */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(44px, 8vh, 92px);
  padding: 132px clamp(20px, 4vw, 40px) 90px;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ─── INTRO ──────────────────────────────────────────────── */
.intro { text-align: center; }
.intro__title {
  font-size: clamp(28px, 5.6vw, 60px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  text-shadow: 0 2px 16px rgba(94, 62, 0, 0.34), 0 1px 3px rgba(94, 62, 0, 0.22);
}
.intro__line { display: block; }
.intro__title em { font-style: italic; color: inherit; }

/* ─── PORTALS ────────────────────────────────────────────── */
.portals {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(22px, 3.5vw, 52px);
  width: 100%;
}
.portal-slot {
  position: relative;
  width: min(318px, 80vw);
  aspect-ratio: 1 / 1.06;
}

.portal {
  --ty: 0px;
  position: absolute;
  inset: 0;
  display: block;
  transform: translateY(var(--ty));
  filter: drop-shadow(0 16px 26px rgba(120, 70, 15, 0.26));
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
  outline: none;
}
.portal--one   { --c: #C41F30; }
.portal--two   { --c: #5E8A50; }
.portal--three { --c: #378FB0; }

.portal:hover,
.portal:focus-visible {
  transform: translateY(calc(var(--ty) - 14px)) scale(1.035);
  filter: drop-shadow(0 30px 42px rgba(120, 70, 15, 0.34));
  z-index: 6;
}

/* coloured soft shadow — blooms on hover */
.portal__halo {
  position: absolute;
  inset: -16%;
  background: radial-gradient(circle at 50% 54%, var(--c), transparent 68%);
  filter: blur(22px);
  opacity: 0.26;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
  mix-blend-mode: multiply;
  z-index: 0;
}
.portal:hover .portal__halo,
.portal:focus-visible .portal__halo { opacity: 0.5; transform: scale(1.06); }

.portal__float {
  position: absolute;
  inset: 0;
  z-index: 1;
  animation: floaty 7s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -2.3s);
}

/* the painted face — one flat colour, like the map */
.portal__shape {
  position: absolute;
  inset: 0;
  clip-path: url(#blob-1);
  background: var(--c);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}
/* gentle darkening so the centred white text always reads */
.portal__shape::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 78% 78% at 50% 46%,
    rgba(0, 0, 0, 0.06) 0%,
    rgba(0, 0, 0, 0.18) 62%,
    rgba(0, 0, 0, 0.34) 100%);
}
/* static top-left highlight — gives the shape a little form */
.portal__shape::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.22), transparent 56%);
  mix-blend-mode: soft-light;
}
.portal--one   .portal__shape { clip-path: url(#blob-1); }
.portal--two   .portal__shape { clip-path: url(#blob-5); }
.portal--three .portal__shape { clip-path: url(#blob-4); }

.portal:hover .portal__shape,
.portal:focus-visible .portal__shape { transform: scale(1.03); filter: brightness(1.07) saturate(1.04); }

/* card content — centred, always inside the shape */
.portal__body {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 17% 17%;
  color: #fff;
  text-align: center;
}
.portal__kicker {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.92;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.32);
}
.portal__title {
  font-size: clamp(18px, 2.3vw, 23px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.42);
}
.portal__desc {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  max-width: 22ch;
  margin: 4px auto 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 32px 24px 46px;
}
.footer p {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0 auto;
}

/* ─── ENTRANCE / REVEAL ──────────────────────────────────── */
.rise { opacity: 0; }
body.is-loaded .rise {
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--d, 0s);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(28px) scale(0.96); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ─── KEYFRAMES ──────────────────────────────────────────── */
@keyframes floaty {
  0%, 100% { transform: translateY(-7px); }
  50%      { transform: translateY(9px); }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (min-width: 921px) {
  .portals { flex-wrap: nowrap; }
  .portal-slot { flex: 1 1 0; width: auto; max-width: 318px; min-width: 0; }
  .portal--one   { --ty: 20px; }
  .portal--two   { --ty: -18px; }
  .portal--three { --ty: 10px; }
}

@media (max-width: 920px) {
  .stage { gap: 54px; padding-top: 116px; }
  .portal-slot { width: min(340px, 82vw); }
}

@media (max-width: 600px) {
  .topbar { padding: 16px 18px; }
  .topbar__cta { padding: 9px 16px; font-size: 12.5px; }
  .brand img { height: 40px; }
  .stage { padding-top: 100px; }
  .intro__title { font-size: 24px; }
  .portal-slot { width: min(320px, 88vw); }
  .portal__body { padding: 13% 13% 17%; }
}

/* ─── REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .rise, .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* ─── NO-JS FALLBACK ─────────────────────────────────────── */
@media (scripting: none) {
  .rise, .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
}
