/* =========================================================
   Luca · 1 Iunie — landing page
   ========================================================= */

/* ---------- Self-hosted fonts ---------- */
/* Alegreya Sans (body / buttons / question). Medium covers 400–500,
   Bold covers 600–900 so existing weight:800 usages map to Bold. */
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/AlegreyaSans-Medium.woff2") format("woff2"),
       url("../fonts/AlegreyaSans-Medium.woff")  format("woff");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/AlegreyaSans-Bold.woff2") format("woff2"),
       url("../fonts/AlegreyaSans-Bold.woff")  format("woff");
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, picture, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }

/* ---------- Tokens ---------- */
:root {
  --ink: #1a1a1a;
  --cream: #fff3d2;
  --sand: #f5b942;
  --pill-bg: #ffffff;
  --pill-border: #111111;
  --question-bg: #111111;
  --question-ink: #ffffff;
  --accent: #f5a623;
  --shadow-btn: 0 4px 0 #111111;
  --shadow-pop: 0 24px 60px rgba(0,0,0,.25);
  --radius-pill: 999px;
}

html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.3;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Stage / background ---------- */
.stage {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  overflow: hidden;
  background-image: url("../img/bg-mobile.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  background-color: var(--cream);
}

.stage__inner {
  position: relative;
  z-index: 2;
  max-width: 100%;
  margin: 0 auto;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.stage__inner > form { margin-top: auto; }

/* ---------- Title ---------- */
/* Brand title font is "Smoothy Pro" (commercial). When the font file is added
   to assets/fonts/, the @font-face below activates; until then it falls back
   to Alegreya Sans Black Italic. */
@font-face {
  font-family: "Smoothy Pro";
  src: url("../fonts/Smoothy-Pro.woff2") format("woff2"),
       url("../fonts/Smoothy-Pro.woff")  format("woff"),
       url("../fonts/SmoothyPro.otf")    format("opentype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Smoothy Pro";
  src: url("../fonts/SmoothyProSlanted.otf") format("opentype");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
.title {
  text-align: center;
  font-family: "Smoothy Pro", "Alegreya Sans", system-ui, sans-serif;
  font-weight: 900;
  font-style: normal; /* uses Smoothy-Pro.woff2 / .woff */
  font-size: clamp(1.7rem, 7.8vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: .005em;
  margin: 6px 0 10px;
  text-transform: uppercase;
  color: var(--ink);
  transform: rotate(-3deg);
  transform-origin: center;
}
.title span { display: block; }

/* ---------- Mascots ---------- */
/* Mobile-first: scattered cluster, layered using a CSS grid for natural flow,
   then absolutely positioned on desktop. */
.mascots {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  height: 47vh;
  min-height: 360px;
  max-height: 720px;
  margin: 0 auto;
  pointer-events: none;
}
.mascot {
  position: absolute;
  width: auto;
  height: auto;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.12));
  user-select: none;
}

/* --- Mobile placements --- */
.mascot--merdenea { top: 0%;   left: 1%;   width: 40%; }
.mascot--branza   { top: 23%;  left: 28%;  width: 46%; }
.mascot--covrig   { top: 3%;   right: -9%; width: 43%; }
.mascot--dog      { top: 42%;  left: -2%;  width: 44%; }
.mascot--simplu   { top: 56%;  right: 2%;  width: 46%; }

/* ---------- Question pill ---------- */
/* Uses the brush-edged black frame PNG via 9-slice border-image so the rough
   corners never distort. Mobile frame is taller (2 lines); desktop is wider. */
.question {
  margin: 18px auto 16px;
  color: var(--question-ink);
  text-align: center;
  font-weight: 800;
  font-size: clamp(1.1rem, 4.4vw, 1.5rem);
  line-height: 1.12;
  max-width: 440px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  padding: 4px 12px;
  border: solid transparent;
  border-width: 26px 46px;
  border-image: url("../img/buton-negru-frame-mobile.png") 95 200 fill / 26px 46px / 0 stretch;
}

/* ---------- Vote buttons ---------- */
.vote__buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0 auto;
  width: 100%;
  max-width: 560px;
}

.vote-btn {
  position: relative;
  color: var(--ink);
  font-weight: 800;
  font-size: clamp(.95rem, 3.2vw, 1.15rem);
  letter-spacing: .005em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 4px 10px;
  /* Brush-edged white frame PNG via 9-slice border-image */
  border: solid transparent;
  border-width: 13px 34px;
  border-image: url("../img/buton-alb-frame.png") 28 95 fill / 13px 34px / 0 stretch;
  transition: transform .08s ease, filter .15s ease;
}
.vote-btn .vote-btn__label { position: relative; }
.vote-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(.97); }
.vote-btn:active:not(:disabled) { transform: translateY(1px); }
.vote-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 999px; }
.vote-btn:disabled { opacity: .7; cursor: not-allowed; }
.vote-btn.is-chosen { color: #fff; border-image-source: url("../img/buton-negru-frame-mobile.png"); border-image-slice: 95 200 fill; }

.vote__error {
  color: #b32020;
  text-align: center;
  margin: 12px 0 0;
  min-height: 1.4em;
  font-weight: 600;
}

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .vote__buttons { grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 760px; }
  .vote-btn { font-size: 1.05rem; }
}

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .stage { background-image: url("../img/bg-desktop.png"); background-position: center center; }
  /* Lock to a single screen: fixed viewport height, no scroll. The mascots
     row flexes to absorb whatever vertical space is left over. */
  .stage__inner {
    padding: 20px 0px 20px;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .title {
    font-size: clamp(3rem, 6.4vw, 6rem);
    line-height: .85;
    margin: 30px 0 0;
  }

  /* Full-bleed: break out of the centered max-width container so the mascots
     span the entire viewport width and touch the screen edges. */
  .mascots {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  /* Five large mascots spanning the full width, edge to edge */
  .mascot--merdenea { top: 4%; left: 20px;   right: auto; width: 18%; transform: none; }
  .mascot--dog      { top: 0%; left: 20%;  right: auto; width: 20%; transform: none; }
  .mascot--branza   { top: 3%; left: 40%;  right: auto; width: 21%; transform: none; }
  .mascot--simplu   { top: 21%; left: 60%;  right: auto; width: 22%; transform: none; }
  .mascot--covrig   { top: -6%;  left: auto; right: 20px;   width: 19%; transform: rotate(4deg); }

  .question {
    max-width: 1000px;
    font-size: clamp(2.7rem, 3.5vw, 3.2rem);
    min-height: 78px;
    margin: 0 auto 50px;
    border-width: 22px 56px;
    border-image: url("../img/buton-negru-frame-desktop.png") 80 150 fill / 22px 56px / 0 stretch;
  }

  .vote__buttons { gap: 28px; max-width: 1200px; padding-bottom: 30px;}
  .vote-btn {
    font-size: clamp(1.35rem, 2vw, 2rem);
    min-height: 64px;
    border-width: 15px 46px;
    border-image: url("../img/buton-alb-frame.png") 28 95 fill / 15px 46px / 0 stretch;
  }
  .vote-btn.is-chosen {
    border-image-source: url("../img/buton-negru-frame-desktop.png");
    border-image-slice: 80 150 fill;
  }
}

/* ---------- Wide desktop ---------- */
@media (min-width: 1400px) {
  .mascot--merdenea { width: 20%; }
  .mascot--branza   { width: 22%; }
}

/* ---------- Short desktop (laptops) — keep everything on one screen ---------- */
@media (min-width: 900px) and (max-height: 760px) {
  .title { font-size: clamp(2.4rem, 5vw, 4rem); }
  .question { min-height: 66px; font-size: clamp(1.4rem, 2.4vw, 2.1rem); border-width: 18px 50px; border-image-width: 18px 50px; }
  .vote-btn { min-height: 56px; }
  .stage__inner { padding: 14px 40px 20px; }
}

/* ---------- Popup ---------- */
.popup {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.popup[hidden] { display: none; }
.popup.is-open { opacity: 1; pointer-events: auto; }

.popup__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
}

.popup__card {
  position: relative;
  background: #fff;
  color: var(--ink);
  border-radius: 24px;
  /* Brush-edged frame PNG */
  border: solid transparent;
  border-width: 16px;
  border-image: url("../img/popup-frame.png") 55 fill / 16px / 0 stretch;
  padding: 22px 28px;
  max-width: 991px;
  width: calc(100% - 32px);
  text-align: center;
  filter: drop-shadow(0 24px 50px rgba(0,0,0,.3));
  animation: pop-in .25s ease;
}

.popup__body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

@keyframes pop-in {
  from { transform: translateY(10px) scale(.96); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.popup__close {
  position: absolute; top: 8px; right: 14px;
  font-size: 2rem; line-height: 1;
  color: var(--ink);
  padding: 4px 10px;
  z-index: 2;
}

.popup__mascot {
  flex: 0 0 auto;
  width: auto;
  height: clamp(160px, 42vw, 50vh);
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.15));
}

.popup__text {
  flex: 1 1 auto;
  text-align: left;
}

.popup__title {
  flex: 1 1 auto;
  text-align: left;
  font-family: "Alegreya Sans", system-ui, sans-serif;
  font-weight: 800;
  font-style: normal;
  font-size: clamp(1.5rem, 6vw, 5.4rem);
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
}

.popup__subtitle {
  margin: .55em 0 0;
  font-family: "Alegreya Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(.95rem, 2.4vw, 1.6rem);
  line-height: 1.25;
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .popup, .popup__card, .vote-btn { transition: none; animation: none; }
}

/* =========================================================
   CUSTOM RESPONSIVE OVERRIDES — placed last so they win the cascade.
   Fill in mascot positions / sizes and button + question font sizes
   per breakpoint. Everything below is intentionally empty.
   Override props you'll likely want:
     .mascots                      → height, margin, width
     .mascot--merdenea / --dog /
     --branza / --simplu / --covrig → top, left, right, width, transform
     .question                     → font-size, min-height, margin, border-width
     .vote__buttons                → gap, max-width
     .vote-btn                     → font-size, min-height, border-width
   ========================================================= */

/* ---------- Mobile (≤ 575px) ---------- */
@media (max-width: 575px) {
  .mascots          {
      height: 40vh;
      min-height: 260px;
      max-height: 340px;
  }
  .stage__inner > form {
      margin-top: 0;
  }
  .mascot--merdenea {  }
  .mascot--dog      {  }
  .mascot--branza   {  }
  .mascot--simplu   {  }
  .mascot--covrig   {  }

  .question         {
      line-height: 1;
      min-height: 70px;
      padding: 4px 0px;

      border-width: 26px 10px;
  }
  .vote__buttons    {  }
  .vote-btn         {
      min-height: 50px;
      padding: 2px 10px;
  }
}

/* ---------- Tablet (576px – 767px) ---------- */
@media (min-width: 576px) and (max-width: 767px) {
  .mascots          {  }
  .mascot--merdenea {  }
  .mascot--dog      {  }
  .mascot--branza   {  }
  .mascot--simplu   {  }
  .mascot--covrig   {  }

  .question         {  }
  .vote__buttons    {  }
  .vote-btn         {  }
}

/* ---------- Large tablet (768px – 991px) ---------- */
@media (min-width: 768px) and (max-width: 991px) {
  .mascots          {  }
  .mascot--merdenea {  }
  .mascot--dog      {  }
  .mascot--branza   {  }
  .mascot--simplu   {  }
  .mascot--covrig   {  }

  .question         {  }
  .vote__buttons    {  }
  .vote-btn         {  }
}

/* ---------- Laptop (992px – 1279px) ---------- */
@media (min-width: 992px) and (max-width: 1279px) {
  .mascots          {  }
  .mascot--merdenea {  }
  .mascot--dog      {  }
  .mascot--branza   {  }
  .mascot--simplu   {  }
  .mascot--covrig   {  }

  .question         {  }
  .vote__buttons    {  }
  .vote-btn         {  }
}

/* ---------- Desktop (1280px – 1535px) ---------- */
@media (min-width: 1280px) and (max-width: 1535px) {
  .mascots          {  }
  .mascot--merdenea {  }
  .mascot--dog      {  }
  .mascot--branza   {  }
  .mascot--simplu   {  }
  .mascot--covrig   {  }

  .question         {  }
  .vote__buttons    {  }
  .vote-btn         {  }
}

/* ---------- Wide (1536px – 1919px) ---------- */
@media (min-width: 1536px) and (max-width: 1919px) {
  .mascots          {  }
  .mascot--merdenea { max-width: 35vh; }
  .mascot--dog      { max-width: 35vh; }
  .mascot--branza   { max-width: 35vh; }
  .mascot--simplu   { max-width: 35vh; }
  .mascot--covrig   { max-width: 35vh; }

  .question         {  }
  .vote__buttons    {  }
  .vote-btn         {  }
}

/* ---------- Ultra-wide (1920px – 2559px) ---------- */
@media (min-width: 1920px) and (max-width: 2559px) {
  .mascots          {  }
  .mascot--merdenea { max-width: 35vh; }
  .mascot--dog      { max-width: 35vh; }
  .mascot--branza   { max-width: 35vh; }
  .mascot--simplu   { max-width: 35vh; }
  .mascot--covrig   { max-width: 35vh; }

  .question         {  }
  .vote__buttons    {  }
  .vote-btn         {  }
}

/* ---------- 4K / Super ultra-wide (≥ 2560px) ---------- */
@media (min-width: 2560px) {
  .mascots          {  }
  .mascot--merdenea { max-width: 35vh; }
  .mascot--dog      { max-width: 35vh; }
  .mascot--branza   { max-width: 35vh; }
  .mascot--simplu   { max-width: 35vh; }
  .mascot--covrig   { max-width: 35vh; }

  .question         {  }
  .vote__buttons    {  }
  .vote-btn         {  }
}
