:root {
  --bg: #f8f7ff;
  --fg: #1b1b2f;
  --muted: #4a4a63;
  --accent: #363a96;               /* logo indigo */
  --glow: rgba(6, 194, 172, 0.16); /* logo teal */
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12121f;
    --fg: #f1f0ff;
    --muted: #b8b8d0;
    --accent: #06c2ac;             /* logo teal */
    --glow: rgba(54, 58, 150, 0.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, var(--glow), transparent 60%), var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Interactive square grid behind everything; clicks pass through to the page. */
#lab {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

main, footer { position: relative; z-index: 1; }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1.25rem;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- logo: four layers that assemble on load ---------- */
.logo { margin: 0 0 1.75rem; line-height: 0; cursor: pointer; }
.logo-stack {
  position: relative;
  display: block;
  width: min(460px, 82vw);
  aspect-ratio: 960 / 203;
}
.part {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: var(--anim) .8s var(--ease) both;
  animation-delay: var(--delay, 0s);
}
.part-c    { --anim: in-left;  --delay: .1s; }
.part-l    { --anim: in-up;    --delay: .35s; }
.part-sq   { --anim: drop;     --delay: .6s; animation-duration: .9s; }
.part-word { --anim: wipe;     --delay: .75s; animation-duration: .9s; }

.dark-only { display: none; }
@media (prefers-color-scheme: dark) {
  .dark-only { display: block; }
  .light-only { display: none; }
}

@keyframes in-left { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes in-up   { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes drop {
  0%   { opacity: 0; transform: translateY(-70px); }
  55%  { opacity: 1; transform: translateY(4px); }
  75%  { transform: translateY(-6px); }
  100% { opacity: 1; transform: none; }
}
@keyframes wipe {
  from { clip-path: inset(0 100% 0 0); opacity: .2; }
  to   { clip-path: inset(0 0 0 0); opacity: 1; }
}
/* The yellow square hops when you hover or tap the logo. */
.part-sq.hop { animation: hop .6s var(--ease); }
@keyframes hop {
  0%   { transform: none; }
  35%  { transform: translateY(-14%); }
  65%  { transform: translateY(2%); }
  100% { transform: none; }
}

/* ---------- text ---------- */
.reveal { animation: in-up .7s var(--ease) both; animation-delay: var(--d, 0s); }

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.tagline {
  margin: 0 0 2rem;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--muted);
}

.word-slot { display: inline-block; overflow: hidden; vertical-align: bottom; }
.word {
  display: inline-block;
  color: var(--fg);
  font-weight: 700;
  transition: transform .26s var(--ease), opacity .26s;
}
.word.out { transform: translateY(-100%); opacity: 0; }
.word.in  { transform: translateY(100%); opacity: 0; transition: none; }

.contact { margin: 0; color: var(--muted); }

/* Tap target: at least 44px tall via padding, cancelled by negative margin so the layout does not move. */
.contact a {
  display: inline-block;
  padding: 13px 0;
  margin: -13px 0;
}

.hint {
  margin: 2.5rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: .75;
}

a {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: 2px; }

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

footer {
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
}

/* Respect people who turn off motion: everything appears at once, no grid animation. */
@media (prefers-reduced-motion: reduce) {
  .part, .reveal { animation: none; }
  .hint { display: none; }
}
