:root {
  --bg-top: #0B1628;
  --bg-bottom: #14233D;
  --tile-fill: rgba(28, 46, 74, 0.7);
  --tile-border: #2E4468;
  --text-color: #E8EDF5;
  --text-muted: #9AA8BD;
  --accent: #C9A45C;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  color: var(--text-color);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

/* ------------------------------------------------------------------ */
/* Header / footer                                                     */
/* ------------------------------------------------------------------ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(180deg, rgba(11, 22, 40, 0.85), rgba(11, 22, 40, 0));
}

.wordmark {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-color);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.lang-switch__option {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
}

.lang-switch__option:hover {
  color: var(--text-color);
}

.lang-switch__option.is-active {
  color: var(--accent);
  font-weight: 600;
}

.lang-switch__option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-switch__option + .lang-switch__option {
  border-left: 1px solid var(--tile-border);
  padding-left: 0.4rem;
}

.contact-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
}

.contact-link:hover,
.contact-link:focus-visible {
  border-bottom-color: var(--accent);
}

.contact-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 0.6rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: linear-gradient(0deg, rgba(11, 22, 40, 0.85), rgba(11, 22, 40, 0));
}

/* ------------------------------------------------------------------ */
/* Tile field & lanes                                                   */
/* ------------------------------------------------------------------ */
.tile-field {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.tile {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.tile--content {
  width: 200px;
  min-height: 120px;
  font: inherit;
  color: var(--text-color);
  text-align: left;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--tile-border);
  background: var(--tile-fill);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  z-index: 3;
}

.tile--content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
}

.tile--content:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.tile__icon {
  font-size: 1.3rem;
  color: var(--accent);
}

.tile__title {
  font-weight: 600;
}

.tile__teaser {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tile-callout {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, 4px);
  margin-bottom: 0.5rem;
  max-width: 220px;
  background: linear-gradient(180deg, rgba(20, 35, 61, 0.98), rgba(11, 22, 40, 0.98));
  border: 1px solid var(--accent);
  color: var(--text-color);
  font-size: 0.78rem;
  line-height: 1.3;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.tile-callout.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tile-badge {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--tile-border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.tile--decorative {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  border: 1px solid var(--tile-border);
  background: rgba(28, 46, 74, 0.4);
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}

/* Position is written every frame by app.js as `transform: translate(x, y)`
   (free-direction bounce physics) — there are no CSS keyframes to define
   here, since the bounce angle/timing isn't a fixed, loopable path. */

/* ------------------------------------------------------------------ */
/* Panel / expanded content view (FLIP morph target)                    */
/* ------------------------------------------------------------------ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 22, 40, 0.55);
  z-index: 40;
}

.tile-field.is-dimmed .tile {
  filter: blur(2px) brightness(0.6);
}

.panel {
  position: fixed;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 35, 61, 0.98), rgba(11, 22, 40, 0.98));
  border: 1px solid var(--tile-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  z-index: 50;
  overflow: hidden;
}

.panel[hidden] {
  display: none;
}

.panel__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--tile-border);
}

.panel__title {
  margin: 0;
  color: var(--text-color);
}

.panel__close {
  background: transparent;
  border: 1px solid var(--tile-border);
  color: var(--accent);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

.panel__close:hover,
.panel__close:focus-visible {
  background: rgba(201, 164, 92, 0.12);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.panel__content {
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

.panel__content h2,
.panel__content h3 {
  color: var(--accent);
}

.panel__content a {
  color: var(--accent);
}

.form-field {
  width: 100%;
  max-width: 320px;
}

.form-field--message {
  max-width: 480px;
}

.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  border: 1px dashed var(--tile-border);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0.75rem 0;
}

.yt-consent {
  aspect-ratio: 16 / 9;
  width: 100%;
  margin: 0.75rem 0;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #111827, #1e3a8a);
}
.yt-consent__btn {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  text-align: center;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 1;
}
.yt-consent__btn:hover .yt-consent__play,
.yt-consent__btn:focus-visible .yt-consent__play { background: #f00; }
.yt-consent__play {
  display: grid;
  place-items: center;
  width: 64px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 0, 0, 0.85);
  font-size: 1.3rem;
}
.yt-consent__title { font-weight: 600; }
.yt-consent__hint { font-size: 0.8rem; opacity: 0.8; max-width: 36ch; }
.yt-fallback { margin: 0.25rem 0 0.75rem; font-size: 0.8rem; }
.yt-consent iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 720px) {
  .panel {
    top: 4vh;
    left: 2vw;
    width: 96vw;
    height: 92vh;
  }
  .tile--content {
    width: 160px;
    min-height: 100px;
    padding: 0.8rem;
  }
  .tile--decorative {
    width: 48px;
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile-callout {
    transition: none;
  }
}


.content-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0.75rem auto;
  padding: 0.75rem;
  box-sizing: border-box;
  border-radius: 12px;
}
