/* ---------- Fonts ---------- */
@font-face {
  font-family: "Noto Serif Condensed";
  src: url("../assets/fonts/NotoSerif_Condensed-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif Condensed";
  src: url("../assets/fonts/NotoSerif_Condensed-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --maroon: #8a1c45;
  --red: #e80029;
  --red-dark: #c2001f;
  --cream: #fff3e4;
  --cream-soft: #f9f3e5;

  --font: "Noto Serif Condensed", Georgia, "Times New Roman", serif;

  --card-w: min(31vw, 480px);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--maroon);
  color: var(--cream);
  font-family: var(--font);
}
img { display: block; max-width: 100%; }
button { font-family: inherit; }

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

/* ---------- Hero ----------
   Every real phone is narrower (taller) than the artwork's own 9:16
   ratio, so "cover" always scales the image to match the viewport's
   full height exactly (only the sides get cropped) - there's never a
   vertical gap or vertical crop. That means a position expressed as a
   plain % of the hero's height always lands on the same spot in the
   image, on every device. The card below relies on that: its offset
   and its own size are both driven by vh, so it grows/shrinks in step
   with wherever "cover" places the baked-in logo, and never overlaps
   it - unlike fixed em/px sizing, which stays the same size while the
   logo's position still scales with viewport height.
*/
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-image: url("../assets/img/background-web.jpg");
  background-size: cover;
  background-position: top center;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: rgba(60, 8, 30, 0);
  pointer-events: none;
  transition: background-color .35s ease;
}

.hero__content {
  position: absolute;
  inset: 0;
  transition: filter .35s ease;
}

body.modal-open .hero__scrim { background-color: rgba(40, 6, 22, .55); }
body.modal-open .hero__content { filter: blur(10px); }

/* ---------- Card ---------- */
.card {
  position: absolute;
  top: 6%;
  right: 5.5%;
  width: var(--card-w);
  min-width: 300px;
  background: var(--red);
  padding: 2.4em 2.6em 2.2em;
  clip-path: polygon(0 0, 100% 0, 100% 78.5%, 86% 100%, 0 100%);
  z-index: 2;
}

.card__title {
  margin: 0 0 .7em;
  font-weight: 400;
  font-size: clamp(1.15rem, 1.6vw, 1.65rem);
  line-height: 1.2;
}

.form { display: flex; flex-direction: column; gap: .55em; }

.field {
  display: flex;
  align-items: baseline;
  gap: .6em;
  padding-bottom: .35em;
  border-bottom: 1.5px solid var(--cream);
}
.field__label {
  flex: 0 0 auto;
  font-size: clamp(.85rem, 1vw, 1.05rem);
  white-space: nowrap;
}
.field__input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--cream);
  font-family: var(--font);
  font-size: clamp(.85rem, 1vw, 1.05rem);
  padding: 0 0 .1em;
}
.field__input::placeholder { color: rgba(255, 243, 228, .55); }
.field__input:invalid { box-shadow: none; }

.field--honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}


.form__error {
  margin: 0;
  padding: .5em .7em;
  background: rgba(0, 0, 0, .18);
  border-left: 3px solid var(--cream);
  font-size: .85em;
  line-height: 1.3;
}
.form__error[hidden] { display: none; }

.join-btn {
  align-self: flex-start;
  margin-top: 1em;
  border: 0;
  cursor: pointer;
  background: var(--cream);
  color: var(--red);
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: .03em;
  font-size: clamp(.9rem, 1.05vw, 1.1rem);
  padding: .55em 1.9em .55em 1.5em;
  clip-path: polygon(0 0, 100% 0, 100% 74%, 85% 100%, 0 100%);
  transition: background-color .2s ease, transform .15s ease;
}
.join-btn:hover { background-color: #fff; }
.join-btn:active { transform: translateY(1px); }
.join-btn:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vw;
}
.modal[hidden] { display: none; }

.modal__panel {
  position: relative;
  width: min(46em, 92vw);
  padding: 2.4em 3em 2.6em;
  text-align: center;
  color: var(--cream-soft);
  background: rgba(216, 173, 198, .28);
  border: 1px solid rgba(255, 243, 228, .35);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  clip-path: polygon(0 0, 100% 0, 100% 78%, 87% 100%, 0 100%);
  animation: modal-in .25s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.modal__close {
  position: absolute;
  top: .6em;
  right: .8em;
  width: 2em;
  height: 2em;
  border: 0;
  background: transparent;
  color: var(--cream-soft);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.modal__close:hover { opacity: .75; }

.modal__title {
  margin: 0 0 .3em;
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}
.modal__text {
  margin: 0 auto 1.1em;
  max-width: 34em;
  font-size: clamp(.95rem, 1.6vw, 1.15rem);
  line-height: 1.5;
}
.logo--modal { width: 150px; margin: 0 auto; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .hero__bg { background-image: url("../assets/img/background-mobile.jpg"); }

  /* font-size drives every em-based measurement below (padding, gaps,
     text) off a single vh value, so the whole card scales with
     viewport height in lockstep with the background photo - see the
     .hero comment above for why that keeps it clear of the logo. */
  .card {
    top: 3vh;
    right: 6vw;
    left: 6vw;
    width: auto;
    font-size: clamp(11px, 2.2vh, 16px);
    padding: 1.3em 1.4em 1.3em;
  }

  .card__title { font-size: 1.3em; margin-bottom: .5em; }
  .form { gap: .4em; }
  .field { padding-bottom: .25em; }
  .field__label, .field__input { font-size: 1em; }
  .join-btn { font-size: 1em; margin-top: .6em; }

  .modal__panel { padding: 2em 1.6em 2em; }
}
