:root {
  --brand: #DA2A47;
  --brand-deep: #8e1b2f;  /* darker red used for the 3D extruded base */
  --text: #1f1f1f;
  --muted: #6b6b6b;

  /* Shared vertical rhythm: icon -> title -> link bar all use this gap. */
  --section-gap: 2.5rem;
}

/* Theme backgrounds. Dark is the default. */
:root[data-theme="dark"] {
  --bg: #222222;
}

:root[data-theme="light"] {
  --bg: #FFFFFF;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.5;
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 1.5rem 1.25rem 3rem;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Logo + title cluster, confined to the top ~20% of the viewport. */
.brand {
  height: 20vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1vh;
}

/* Logo, scaled to share the top 20% with the title. */
.logo {
  height: 13vh;
  width: auto;
  max-width: 60vw;
}

/* ---- Title + per-letter wave ---- */
.title {
  /* Scaled to fit the top 20% band; capped by width on narrow screens. */
  font-size: min(6vh, 9vw);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--brand);
}

.title .word {
  display: inline-block;
  white-space: nowrap;       /* keep each word's letters together */
}

.title .word + .word {
  margin-left: 0.28em;        /* the space between words */
}

.title .word > span {
  display: inline-block;      /* required so transform can lift the letter */
  /* Resting look: letters already sit on a small extruded base (magnitude
     0.05em up-right, 20deg off vertical). The bump grows it from here. */
  transform: translate(0.017em, -0.047em);
  text-shadow:
    -0.0017em 0.0047em 0 var(--brand-deep),
    -0.0034em 0.0094em 0 var(--brand-deep),
    -0.0051em 0.0141em 0 var(--brand-deep),
    -0.0068em 0.0188em 0 var(--brand-deep),
    -0.0086em 0.0235em 0 var(--brand-deep),
    -0.0103em 0.0282em 0 var(--brand-deep),
    -0.0120em 0.0329em 0 var(--brand-deep),
    -0.0137em 0.0376em 0 var(--brand-deep),
    -0.0154em 0.0423em 0 var(--brand-deep),
    -0.0171em 0.0470em 0 var(--brand-deep);
}

/* The wave: each letter pushes up-and-right (45 deg) while a darker-red
   extruded "base" grows out behind it (offset down-left, back toward the
   letter's home position) for a 3D pop. On retract the base shrinks to
   nothing and the letter slides back over it.
   Total cycle is 3s; the pop occupies the first ~20%, leaving a pause
   before the wave runs again. Each letter is offset by --i so the pop
   travels left-to-right across the word. */
.wave .word > span {
  animation: letter-pop 3s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.06s);
}

@keyframes letter-pop {
  0%,
  20%,
  100% {
    /* resting base: magnitude 0.05em, 20deg off vertical */
    transform: translate(0.017em, -0.047em);
    text-shadow:
      -0.0017em 0.0047em 0 var(--brand-deep),
      -0.0034em 0.0094em 0 var(--brand-deep),
      -0.0051em 0.0141em 0 var(--brand-deep),
      -0.0068em 0.0188em 0 var(--brand-deep),
      -0.0086em 0.0235em 0 var(--brand-deep),
      -0.0103em 0.0282em 0 var(--brand-deep),
      -0.0120em 0.0329em 0 var(--brand-deep),
      -0.0137em 0.0376em 0 var(--brand-deep),
      -0.0154em 0.0423em 0 var(--brand-deep),
      -0.0171em 0.0470em 0 var(--brand-deep);
  }
  10% {
    /* bump: base + the same 0.14em delta = magnitude 0.19em */
    transform: translate(0.065em, -0.179em);
    text-shadow:
      -0.0065em 0.0179em 0 var(--brand-deep),
      -0.0130em 0.0357em 0 var(--brand-deep),
      -0.0195em 0.0536em 0 var(--brand-deep),
      -0.0260em 0.0714em 0 var(--brand-deep),
      -0.0325em 0.0893em 0 var(--brand-deep),
      -0.0390em 0.1071em 0 var(--brand-deep),
      -0.0455em 0.1250em 0 var(--brand-deep),
      -0.0520em 0.1428em 0 var(--brand-deep),
      -0.0585em 0.1607em 0 var(--brand-deep),
      -0.0650em 0.1785em 0 var(--brand-deep);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wave .word > span {
    animation: none;
  }
}

/* ---- Red divider line with square link tabs ---- */
.link-bar {
  position: relative;
  margin-top: var(--section-gap);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 4vw, 2rem);
  max-width: 720px;
  width: 100%;
}

/* The red break line running through the tabs. */
.link-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: var(--brand);
  transform: translateY(-50%);
  z-index: 0;
}

.tab {
  position: relative;
  z-index: 1;                 /* sit on top of the red line */
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.4rem;
  background: var(--bg);       /* mask the line behind each square */
  border: 2px solid var(--brand);
  color: var(--brand);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tab:hover,
.tab:focus {
  background: var(--brand);
  color: #fff;
}

/* ---- Theme toggle (top-right) ---- */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--brand);
  cursor: pointer;
  line-height: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: scale(1.1);
  opacity: 0.85;
}

.theme-toggle svg {
  display: block;
}

/* Show the icon that represents the action / opposite state. */
:root[data-theme="dark"] .icon-sun {
  display: none;
}

:root[data-theme="light"] .icon-moon {
  display: none;
}

.footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}
