/* Gambur Seafood — brand palette taken straight from the logo */
:root {
  --cream: #f5efe6;
  --navy:  #0a1931;
  --slate: #394455;

  /* The page background must equal the background baked into the logo
     artwork, or the logo's card edge becomes visible against the page. */
  --page: var(--cream);
  --ink:  var(--navy);

  /* Everything that differs between themes keys off these two, so the page,
     the logo and the toggle icon can never disagree about which theme is on. */
  --show-light: block;
  --show-dark:  none;
}

/* Following the system, unless a stored choice says otherwise. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: var(--navy);
    --ink:  var(--cream);
    --show-light: none;
    --show-dark:  block;
  }
}

/* An explicit choice wins in both directions. */
:root[data-theme="dark"] {
  --page: var(--navy);
  --ink:  var(--cream);
  --show-light: none;
  --show-dark:  block;
}

:root[data-theme="light"] {
  --page: var(--cream);
  --ink:  var(--navy);
  --show-light: block;
  --show-dark:  none;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--page);
}

body {
  overflow: hidden;
  color: var(--ink);
  color-scheme: light dark;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The sea sits behind everything and never intercepts input. */
#sea {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.splash {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 6vw, 4rem);
  /* Nudge up a touch so the logo is optically centred above the waterline. */
  padding-bottom: clamp(6rem, 22vh, 14rem);
}

.logo {
  grid-area: 1 / 1;
  width: min(560px, 78vw);
  height: auto;
  /* Each logo file carries its own card in the matching page colour — cream
     on cream, navy on navy — so no shadow, and the card edge disappears. */
  animation: surface 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.logo--light { display: var(--show-light); }
.logo--dark  { display: var(--show-dark); }

/* Discreet enough to stay out of the way on an otherwise empty splash. */
.theme-toggle {
  position: fixed;
  top: clamp(1rem, 3vw, 1.75rem);
  right: clamp(1rem, 3vw, 1.75rem);
  z-index: 2;

  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;

  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  opacity: 0.45;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  animation: surface-dim 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) 0.5s both;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  opacity: 1;
  border-color: color-mix(in srgb, var(--ink) 22%, transparent);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.theme-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ink) 45%, transparent);
  outline-offset: 2px;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* Offer the destination, not the current state: moon while light, sun while dark. */
.icon--moon { display: var(--show-light); }
.icon--sun  { display: var(--show-dark); }

@keyframes surface {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* Same entrance, but lands at the toggle's resting opacity rather than 1,
   so :hover can still take it the rest of the way. */
@keyframes surface-dim {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to   { opacity: 0.45; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .logo { animation: none; }
  .theme-toggle { animation: none; }
}
