/* =========================================================
   F.E.A. Distilling Co. | Age gate
   The site stays hidden until the visitor confirms legal age.
   ========================================================= */

/* Hide the site until verified (also covers no-JS visitors) */
html:not(.age-ok) .landing {
  visibility: hidden;
  opacity: 0;
}

html.age-ok .landing {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.8s ease 0.15s;
}

html:not(.age-ok) body { overflow: hidden; }

/* ---------- Gate shell ---------- */

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  color: var(--cream);
  font-family: var(--sans);
  background:
    radial-gradient(ellipse 70% 45% at 50% 100%, rgba(251, 184, 48, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(16, 32, 44, 0.78) 0%, rgba(22, 20, 18, 0.9) 100%),
    var(--bg) url("assets/corn-field.webp") center / cover no-repeat;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

html.age-ok .age-gate {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.age-gate__inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100% - 48px, 420px);
  min-height: 100%;
  margin: 0 auto;
  padding: max(6vh, 32px) 0;
}

.age-gate__logo {
  width: min(78%, 300px);
  margin: 0 auto 44px;
}

.age-gate__title {
  margin: 0 0 10px;
  font: 400 clamp(28px, 6vw, 38px) / 1.12 var(--serif);
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
  outline: none;
}

.age-gate__lede {
  margin: 0 0 32px;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  text-wrap: pretty;
  color: rgba(232, 221, 200, 0.82);
}

/* ---------- Fields ---------- */

.ag-field {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.ag-label {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ag-sublabel {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: rgba(232, 221, 200, 0.72);
}

.ag-input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(232, 221, 200, 0.38);
  border-radius: 3px;
  background: rgba(22, 20, 18, 0.45);
  color: var(--cream);
  font: 500 18px / 1 var(--sans);
  letter-spacing: 0.04em;
  transition: border-color 0.2s ease;
}

.ag-input::placeholder { color: rgba(232, 221, 200, 0.38); }

.ag-input:hover { border-color: rgba(232, 221, 200, 0.6); }

.ag-input:focus-visible {
  outline: 2px solid var(--orange-peel);
  outline-offset: 2px;
  border-color: var(--orange-peel);
}

.ag-input[aria-invalid="true"] { border-color: var(--orange-peel); }

.ag-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  font-size: 16px;
  letter-spacing: 0;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23e8ddc8' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.ag-select option { color: var(--charcoal); background: #fff; }

.ag-dob__row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 12px;
}

.ag-dob__part .ag-input { text-align: center; }

/* ---------- Error, remember, button ---------- */

.age-gate__error {
  min-height: 1.4em;
  margin: -8px 0 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--orange-peel);
}

.age-gate__error:empty { margin-bottom: 6px; }

.ag-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 26px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(232, 221, 200, 0.82);
  cursor: pointer;
}

.ag-check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--orange-peel);
  cursor: pointer;
}

.ag-check input:focus-visible {
  outline: 2px solid var(--orange-peel);
  outline-offset: 2px;
}

.age-gate__button {
  display: block;
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 3px;
  background: var(--orange-peel);
  color: var(--charcoal);
  font: 600 16px / 1 var(--sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.age-gate__button:hover { background: #ffc94f; }

.age-gate__button:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.age-gate__fine {
  margin: 20px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  text-align: center;
  color: rgba(232, 221, 200, 0.66);
}

/* ---------- Denied + no-JS ---------- */

.age-gate__denied { text-align: center; }

.age-gate__link {
  display: inline-block;
  padding: 4px 0;
  color: var(--orange-peel);
  font-size: 15px;
  font-weight: 600;
  text-underline-offset: 4px;
}

.age-gate__link:focus-visible {
  outline: 2px solid var(--orange-peel);
  outline-offset: 4px;
}

/* Blocked earlier this session: show the message right away */
html.age-denied .age-gate__form { display: none; }
html.age-denied .age-gate__denied { display: block; }

.landing:focus { outline: none; }

html.no-js .age-gate__form,
html.no-js .age-gate__denied { display: none; }

.age-gate__noscript { margin-top: 8px; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .age-gate,
  html.age-ok .landing { transition: none; }
}
