/* =========================================================
   Clepsydra — one-pager
   Static CSS, mobile-first, no framework.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Caesar+Dressing&family=Noto+Sans:wght@400;500;700&family=Roboto:wght@700&display=swap');

:root {
  --c-orange: #FF9C00;
  --c-cyan: #83FFF4;
  --c-white: #FFFFFF;
  --c-black: #000000;
  --c-navy: #26263C;

  --font-title-latin: "Caesar Dressing", "Roboto", system-ui, sans-serif;
  --font-title-greek: "Roboto", system-ui, sans-serif;
  --font-body: "Noto Sans", system-ui, sans-serif;

  /* page rhythm */
  --gutter: 24px;
  --section-gap: 56px;
  --content-max: 520px;
}

html[lang="el"] {
  --font-title-latin: "Roboto", system-ui, sans-serif;
}

/* Global: ensure [hidden] always wins over our component layout rules */
[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: #07061f;
  color: var(--c-white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  /* Black side-borders (visible only on desktop where the centred frame
     is narrower than the viewport). On mobile we duplicate the starfield
     here with attachment:fixed so it stays put while the page scrolls. */
  background: #000;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Mobile: the body scrolls (not the frame), so anchor the starfield to
   the viewport via background-attachment:fixed. The .site-frame itself
   becomes transparent so we don't double-paint the image. */
@media (max-width: 719px) {
  body {
    background-color: #080F31;
    background-image: url("assets/site_background.png");
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 720px auto;
    background-attachment: fixed;
  }
}

/* =========================================================
   Site frame — full-bleed mobile, portrait 3:4 on desktop
   ========================================================= */

.site-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;

  /* Starry backdrop: only on the centred site container.
     Asset placed at its natural size, anchored top-centre, no resize.
     The fill color (#080F31) matches the deep blue of the starfield so
     content that extends past the asset (e.g. on tall mobile pages)
     blends seamlessly. */
  background-color: #080F31;
  background-image: url("assets/site_background.png");
  background-repeat: no-repeat;
  background-position: top center;
  background-size: auto;
  background-attachment: scroll;
}

@media (max-width: 719px) {

  /* Mobile: starfield is on body (fixed). Frame stays transparent so the
     image isn't double-painted. */
  .site-frame {
    background: transparent;
  }
}

@media (min-width: 720px) {

  /* horizontal breathing room for the full-width frame; reused by the
     partners panel so its full-bleed keeps matching the frame padding. */
  :root {
    --desk-gutter: clamp(40px, 6vw, 120px);
    --content-max: 960px;
  }

  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .site-frame {
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(131, 255, 244, 0.35) transparent;
    padding: 48px var(--desk-gutter) 80px;
    /* full-width starfield: landscape asset scaled to the frame width,
       anchored top, deep-blue fill below */
    background-image: url("assets/site_background_landscape_1920x1710.png");
    background-size: 100% auto;
  }

  /* Guard rail: below 1200px the full-width starfield would get too narrow,
     so freeze its width at 1200px (centred, sides cropped) instead. */
  @media (max-width: 1199px) {
    .site-frame {
      background-size: 1200px auto;
    }
  }

  .site-frame::-webkit-scrollbar {
    width: 8px;
  }

  .site-frame::-webkit-scrollbar-track {
    background: transparent;
  }

  .site-frame::-webkit-scrollbar-thumb {
    background: rgba(131, 255, 244, 0.35);
    border-radius: 4px;
  }
}

/* =========================================================
   Language switcher (floats top-right of the frame)
   ========================================================= */

.lang-switch {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 50;
  font-family: var(--font-title-latin);
}

.lang-switch__current {
  appearance: none;
  border: 1.5px solid rgba(131, 255, 244, 0.6);
  background: rgba(38, 38, 60, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--c-cyan);
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.08em;
  padding: 10px 14px 10px 16px;
  min-width: 64px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color .2s ease, background .2s ease;
}

.lang-switch__current:hover,
.lang-switch__current[aria-expanded="true"] {
  border-color: var(--c-cyan);
  background: rgba(38, 38, 60, 0.85);
}

.lang-switch__current::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform .2s ease;
}

.lang-switch__current[aria-expanded="true"]::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.lang-switch__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: rgba(38, 38, 60, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(131, 255, 244, 0.45);
  border-radius: 14px;
  display: none;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.lang-switch[aria-expanded="true"] .lang-switch__menu {
  display: block;
}

.lang-switch__menu button {
  appearance: none;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--c-white);
  font-family: var(--font-body);
  font-size: 14px;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.lang-switch__menu button:hover {
  background: rgba(131, 255, 244, 0.12);
}

.lang-switch__menu button[aria-current="true"] {
  color: var(--c-cyan);
}

.lang-switch__menu button span:last-child {
  font-family: var(--font-title-latin);
  letter-spacing: 0.06em;
  opacity: 0.7;
  font-size: 13px;
}

/* =========================================================
   Sections & typography
   ========================================================= */

.section {
  text-align: center;
  margin: 0 auto;
  max-width: var(--content-max);
  padding: var(--section-gap) 0 0;
}

.section:first-of-type {
  padding-top: 32px;
}

.section__title {
  font-family: var(--font-title-latin);
  font-weight: 400;
  color: var(--c-cyan);
  font-size: clamp(34px, 7vw, 44px);
  letter-spacing: 0.04em;
  line-height: 1.05;
  margin: 0 0 22px;
  text-shadow: 0 0 24px rgba(131, 255, 244, 0.35);
}

.section__body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--c-white);
  font-size: 16px;
  line-height: 1.65;
  margin: 0 auto;
  max-width: 480px;
  text-wrap: pretty;
}

/* hero (logo + characters) */
.hero {
  text-align: center;
  padding: 48px 0 8px;
  max-width: 640px;
  margin: 0 auto;
}

.hero__logo {
  display: block;
  width: clamp(240px, 70%, 420px);
  margin: 0 auto 8px;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(131, 255, 244, 0.35));
}

.hero__cast {
  display: block;
  width: clamp(220px, 75%, 380px);
  height: auto;
  margin: 0 auto;
}

/* CTA button (orange diamond-cut tablet) */
.cta-row {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.btn-play {
  --btn-h: 64px;
  --btn-cut: 14px;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  position: relative;
  cursor: pointer;
  height: var(--btn-h);
  min-width: 200px;
  padding: 0 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title-latin);
  font-size: clamp(22px, 4.5vw, 28px);
  letter-spacing: 0.14em;
  color: var(--c-white);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  text-transform: uppercase;
  transition: transform .15s ease, filter .15s ease;
}

.btn-play__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: visible;
}

.btn-play__shape {
  fill: var(--c-orange);
}

.btn-play__inline {
  fill: none;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 1.25;
}

.btn-play:hover {
  filter: brightness(1.06);
}

.btn-play:active {
  filter: brightness(0.95);
}

.btn-play:focus-visible {
  outline: 2px solid var(--c-cyan);
  outline-offset: 4px;
  border-radius: 4px;
}

/* secondary play options (when device detection is ambiguous) */
.cta-row--choose {
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.cta-row--choose .play-hint {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
  font-family: var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}

.cta-row--choose .btn-play {
  --btn-h: 54px;
  font-size: clamp(16px, 3.5vw, 20px);
  padding: 0 40px;
  min-width: 240px;
}

/* separator — uses the brand asset (assets/separateur.png) */
.separator {
  display: block;
  border: 0;
  background: url("assets/separateur.png") center center / contain no-repeat;
  width: min(341px, 80%);
  aspect-ratio: 341 / 39;
  height: auto;
  margin: 56px auto 8px;
}

/* client logo block (transparent over starfield) */
.client-block {
  text-align: center;
  margin: 32px auto 0;
  max-width: 600px;
}

.client-block__caption {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-white);
  margin: 0 0 18px;
  letter-spacing: 0.02em;
  text-wrap: pretty;
}

.client-block img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.3));
}

/* partners — full-bleed white panel inside the frame */
.partners-panel {
  background: var(--c-white);
  margin: 28px calc(-1 * var(--gutter)) 0;
  padding: 36px 20vw;
}

@media (min-width: 720px) {
  .partners-panel {
    margin: 48px calc(-1 * var(--desk-gutter)) 0;
    padding: 56px var(--desk-gutter);
  }
}

.partners-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 48px 80px;
}

.partners-panel__list li {
  width: 100%;
  display: flex;
  justify-content: center;
}

.partners-panel__list img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}

/* Mobile: keep the same 3-up grid as desktop. The logos end up small, but
   that's intentional — they must not appear larger than the lead funder logo. */
@media (max-width: 719px) {
  .partners-panel__list {
    gap: 20px 30px;
  }
}

/* "Un jeu créé par" + Dowino */
.credit {
  text-align: center;
  margin: var(--section-gap) auto 0;
  max-width: var(--content-max);
}

.credit__label {
  font-family: var(--font-body);
  font-size: 16px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 18px;
}

.credit__link {
  display: inline-block;
  margin: 0 auto;
}

.credit__logo {
  display: block;
  width: clamp(140px, 36%, 200px);
  height: auto;
  margin: 0 auto;
}

/* spacer at very bottom of frame so last item breathes */
.frame-foot {
  height: 32px;
}

/* Desktop: the frame is now full-width, so widen the inner content to fill
   it. Placed last so these overrides win over the base component widths
   (equal specificity → later source order wins). */
@media (min-width: 720px) {
  .section {
    padding-top: 72px;
  }

  .section__body {
    max-width: var(--content-max);
  }

  .hero {
    max-width: var(--content-max);
    padding: 56px 0 8px;
  }

  .client-block {
    max-width: 1200px;
  }

  .partners-panel__list {
    max-width: 500px;
    margin: 0 auto;
  }
}