/* ==========================================================================
   TPM Ivato — Online Library Countdown
   Color scale extracted from logo_tpm_Ivato_1_clean.png (brand blue #285099)
   ========================================================================== */

:root {
  --blue-950: #0b1730;
  --blue-900: #0f1f3d;
  --blue-800: #16305c;
  --blue-700: #1c3d73;
  --blue-600: #234a8c;
  --blue-500: #285099; /* brand primary — sampled directly from the logo */
  --blue-400: #4a70ad;
  --blue-300: #7b97c6;
  --blue-200: #b0c2df;
  --blue-100: #dbe4f2;
  --blue-50:  #f2f5fb;

  --cream: #f8f9fc;
  --white: #ffffff;

  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --shadow-lg: 0 30px 60px -20px rgba(6, 13, 28, 0.65);
  --shadow-md: 0 12px 30px -10px rgba(6, 13, 28, 0.5);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--cream);
  background-color: var(--blue-700);
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

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

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--white);
  color: var(--blue-800);
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* ==========================================================================
   Background: bookcase illustration + shadow vignette
   ========================================================================== */

.page-background {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("../assets/img/bookcase-bg.svg?v=3");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.page-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(30, 52, 98, 0.2) 0%, rgba(20, 38, 76, 0.4) 60%, rgba(12, 25, 55, 0.58) 100%),
    linear-gradient(180deg, rgba(16, 32, 66, 0.32) 0%, rgba(16, 32, 66, 0.18) 40%, rgba(9, 19, 42, 0.55) 100%);
}

/* ==========================================================================
   Layout shell
   ========================================================================== */

.site-header {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(0.5rem, 1.6vh, 1.1rem) clamp(1rem, 4vw, 3rem);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-logo {
  width: clamp(38px, 6vh, 52px);
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--blue-200);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Language switch */
.lang-switch {
  display: flex;
  gap: 0.4rem;
  background: rgba(11, 23, 48, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.35rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.lang-btn svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lang-btn:hover {
  transform: translateY(-1px);
}

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

.lang-btn.active {
  border-color: var(--white);
}

/* ==========================================================================
   Hero / main content
   ========================================================================== */

main {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(0.5rem, 2vh, 1.5rem) clamp(1rem, 5vw, 3rem);
}

.hero {
  max-width: 780px;
  max-height: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.4rem, 1.6vh, 1.25rem);
}

.hero-emblem {
  width: clamp(150px, 34vh, 440px);
  height: auto;
  filter: drop-shadow(0 16px 36px rgba(0, 0, 0, 0.55));
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: clamp(0.62rem, 1.5vh, 0.78rem);
  color: var(--blue-200);
  font-weight: 600;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vh + 1.6vw, 2.7rem);
  line-height: 1.15;
  color: var(--white);
  text-wrap: balance;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.lead {
  margin: 0;
  max-width: 56ch;
  color: var(--blue-100);
  font-size: clamp(0.75rem, 1.1vh + 0.4vw, 1.08rem);
  line-height: 1.45;
}

/* Countdown */
.countdown {
  display: flex;
  gap: clamp(0.4rem, 1.6vw, 1.1rem);
  margin: clamp(0.3rem, 1vh, 1rem) 0 0.1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: clamp(56px, 14vw, 82px);
  padding: clamp(0.45rem, 1.4vh, 0.9rem) 0.6rem clamp(0.35rem, 1vh, 0.7rem);
  background: rgba(15, 31, 61, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

.countdown-item .value {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.1rem, 3.2vh + 0.6vw, 2.5rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.countdown-item .label {
  margin-top: 0.4rem;
  font-size: clamp(0.55rem, 1vh, 0.68rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue-200);
}

.countdown-sep {
  align-self: center;
  color: var(--blue-300);
  font-size: clamp(1rem, 2.4vh, 1.6rem);
  font-weight: 300;
  padding-bottom: 1rem;
}

.launched-banner {
  display: none;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.6vh + 0.6vw, 1.8rem);
  color: var(--white);
  background: rgba(40, 80, 153, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
}

.launched .countdown {
  display: none;
}
.launched .launched-banner {
  display: block;
}

.target-date {
  margin: 0.25rem 0 0;
  font-size: clamp(0.72rem, 1.3vh, 0.92rem);
  color: var(--blue-200);
}

.target-date strong {
  color: var(--white);
  font-weight: 600;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: clamp(0.5rem, 1.5vh, 1.1rem) 1rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: clamp(0.66rem, 1.2vh, 0.78rem);
  color: var(--blue-300);
  max-width: 60ch;
}

/* ==========================================================================
   Pigeon
   ========================================================================== */

.pigeon {
  position: fixed;
  top: 0;
  left: 0;
  width: 62px;
  height: 80px;
  pointer-events: none;
  z-index: 50;
  will-change: transform;
}

.pigeon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
  animation: pigeon-flap 0.4s ease-in-out infinite alternate;
  transform-origin: 50% 45%;
}

@keyframes pigeon-flap {
  from { transform: scaleY(1) scaleX(1); }
  to   { transform: scaleY(0.9) scaleX(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .pigeon-img {
    animation-duration: 2s;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 560px) {
  .countdown-sep {
    display: none;
  }
  .pigeon {
    display: none; /* keep small touch screens uncluttered */
  }
}

/* Short viewports (landscape phones, small windows): drop secondary
   content so the header, title and countdown still fit with no scroll. */
@media (max-height: 480px) {
  .hero-emblem,
  .lead {
    display: none;
  }
  .hero {
    gap: 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
