@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Jost:wght@400;500;600&display=swap");

.years-popup-root {
  --bg: #e8e3d6;
  --panel: #fbf7ee;
  --ink: #14233a;
  --muted: #6b7385;
  --line: #cfc6ae;
  --gold: #d9b86c;
  --gold2: #a8802f;
  --navy: #0a1628;
  --navy2: #16294a;
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(4, 9, 18, 0.82);
  backdrop-filter: blur(8px);
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  font-family: Jost, system-ui, sans-serif;
  color: var(--ink);
  box-sizing: border-box;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.years-popup-root *,
.years-popup-root *::before,
.years-popup-root *::after {
  box-sizing: border-box;
}

.years-popup-root.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: years-gj-fadein 0.6s ease;
}

body.years-popup-lock {
  overflow: hidden;
}

@keyframes years-gj-fadein {
  from { opacity: 0; }
}

.years-popup {
  position: relative;
  margin: auto;
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  border-radius: 4px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(217, 184, 108, 0.5), 0 50px 120px rgba(0, 0, 0, 0.65);
  animation: years-gj-rise 1.1s cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes years-gj-rise {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.94);
  }
}

.years-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fbf7ee;
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}

.years-popup-mark {
  position: relative;
  min-height: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 20px;
  color: #f3ecda;
  overflow: hidden;
  cursor: pointer;
  background: radial-gradient(ellipse at 50% 35%, var(--navy2), var(--navy) 72%);
}

.years-popup-mark::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(217, 184, 108, 0.4);
  pointer-events: none;
}

.years-popup-mark::after {
  content: "";
  position: absolute;
  top: 0;
  left: -70%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 240, 200, 0.16), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
}

.years-popup-mark.is-done::after {
  animation: years-gj-sheen 2.4s ease-out;
}

@keyframes years-gj-sheen {
  to { left: 140%; }
}

.years-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.years-kicker {
  position: relative;
  font: italic 600 20px Cormorant Garamond, Georgia, serif;
  color: var(--gold);
  letter-spacing: 0.06em;
  opacity: 0;
  animation: years-gj-fadein 1.4s 0.3s forwards;
}

.years-stage {
  position: relative;
  width: min(300px, 68vw);
  aspect-ratio: 1;
  margin: 6px 0 0;
}

.years-stage svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.years-tick {
  stroke: rgba(217, 184, 108, 0.2);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.years-stage.is-go .years-tick {
  animation: years-gj-lit 0.5s forwards;
  animation-delay: var(--t);
}

@keyframes years-gj-lit {
  to {
    stroke: #f0d58c;
    filter: drop-shadow(0 0 3px #f0d58c);
  }
}

.years-orbit {
  transform-origin: 200px 200px;
  animation: years-gj-spin 90s linear infinite;
}

@keyframes years-gj-spin {
  to { transform: rotate(360deg); }
}

.years-halo {
  opacity: 0;
}

.years-stage.is-go .years-halo {
  animation: years-gj-halo 5s 0.4s ease-in-out infinite;
}

@keyframes years-gj-halo {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.6; }
}

.years-emb {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  transform: translateY(-50%);
  aspect-ratio: 640 / 562;
  --logo: url("/images/gj-emblem.webp");
}

.years-emb > * {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.years-emb-col {
  background-image: var(--logo);
  clip-path: inset(100% 0 0 0);
}

.years-emb-gold,
.years-emb-glint {
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
}

.years-emb-gold {
  background: linear-gradient(160deg, #fff1c2, #e0b95a 45%, #a8802f);
  clip-path: inset(100% 0 0 0);
  filter: drop-shadow(0 0 6px rgba(240, 213, 140, 0.7));
}

.years-emb-glint {
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.9) 50%, transparent 58%) 150% 0 / 250% 100% no-repeat;
}

.years-emb-edge {
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff3c9, transparent);
  box-shadow: 0 0 14px 3px rgba(240, 213, 140, 0.8);
  opacity: 0;
}

.years-stage.is-go .years-emb-gold {
  animation: years-gj-wipe 3.6s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

.years-stage.is-go .years-emb-col {
  animation: years-gj-wipe 3.2s cubic-bezier(0.215, 0.61, 0.355, 1) 0.4s forwards;
}

.years-stage.is-go .years-emb-edge {
  animation: years-gj-edge 3.6s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

.years-popup-mark.is-done .years-emb-glint {
  animation: years-gj-glint 1.6s ease-out;
}

@keyframes years-gj-wipe {
  to { clip-path: inset(0); }
}

@keyframes years-gj-edge {
  0% { bottom: 0; opacity: 1; }
  92% { opacity: 1; }
  100% { bottom: calc(100% - 2px); opacity: 0; }
}

@keyframes years-gj-glint {
  to { background-position: -50% 0; }
}

.years-count {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 14px;
}

.years-num {
  font: 700 clamp(92px, 15vw, 128px) / 1.15 Cormorant Garamond, Georgia, serif;
  letter-spacing: 0.02em;
  background: linear-gradient(100deg, #8c6a22 0%, #e9cf8b 25%, #fff3c9 40%, #d9b86c 55%, #8c6a22 75%, #e9cf8b 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: years-gj-foil 5s linear infinite;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

@keyframes years-gj-foil {
  to { background-position: -150% 0; }
}

.years-popup-mark.is-done .years-num {
  animation: years-gj-foil 5s linear infinite, years-gj-swell 1.4s cubic-bezier(0.2, 1.3, 0.3, 1);
  opacity: 1;
  filter: drop-shadow(0 0 14px rgba(240, 213, 140, 0.45));
}

@keyframes years-gj-swell {
  0% { transform: scale(0.88); }
  45% { transform: scale(1.12); }
  100% { transform: none; }
}

.years-yrs {
  font: italic 600 24px Cormorant Garamond, Georgia, serif;
  color: #f3ecda;
  margin-top: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.9s;
}

.years-popup-mark.is-done .years-yrs {
  opacity: 1;
  transform: none;
}

.years-brand {
  position: relative;
  text-align: center;
  margin-top: 24px;
  opacity: 0;
  transition: 1.2s 0.2s;
}

.years-popup-mark.is-done .years-brand {
  opacity: 1;
}

.years-brand b {
  display: block;
  font: 600 22px Cormorant Garamond, Georgia, serif;
  letter-spacing: 0.2em;
  color: #f3ecda;
  white-space: nowrap;
}

.years-brand span {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-top: 6px;
  font: 400 11px Jost, sans-serif;
  letter-spacing: 0.35em;
  color: var(--gold);
}

.years-brand span::before,
.years-brand span::after {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}

.years-tag {
  display: block;
  margin-top: 14px;
  font: italic 600 15px Cormorant Garamond, Georgia, serif;
  letter-spacing: 1.1em;
  opacity: 0;
  filter: blur(7px);
  background: linear-gradient(100deg, #b8892c 0%, #f6e3a0 30%, #fffbe6 45%, #e0b95a 60%, #b8892c 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: letter-spacing 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) 1s, opacity 1.6s 1s, filter 1.8s 1s;
}

.years-popup-mark.is-done .years-tag {
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  opacity: 1;
  filter: none;
  animation: years-gj-foil 4s 3s linear infinite;
}

.years-swoosh {
  display: block;
  width: 150px;
  height: 9px;
  margin: 8px auto 0;
  overflow: visible;
}

.years-swoosh path {
  fill: none;
  stroke: #d9b86c;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 4px rgba(240, 213, 140, 0.7));
}

.years-popup-mark.is-done .years-swoosh path {
  animation: years-gj-draw 1.6s 1.8s ease forwards;
}

@keyframes years-gj-draw {
  to { stroke-dashoffset: 0; }
}

.years-popup-formside {
  padding: 52px 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.years-popup-formside h2 {
  margin: 0 0 6px;
  font: 600 36px / 1.1 Cormorant Garamond, Georgia, serif;
}

.years-form-lead {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.years-popup-formside label {
  display: block;
  margin: 0 0 20px;
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
}

.years-popup-formside input,
.years-popup-formside select {
  display: block;
  width: 100%;
  padding: 8px 0 10px;
  margin-top: 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 500 17px Jost, sans-serif;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.years-popup-formside select option {
  color: #14233a;
}

.years-popup-formside input:focus,
.years-popup-formside select:focus {
  outline: none;
  border-bottom-color: var(--gold2);
  box-shadow: 0 1px 0 var(--gold2);
}

.years-go {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 10px;
  border: 0;
  cursor: pointer;
  padding: 16px;
  border-radius: 2px;
  font: 600 16px Jost, sans-serif;
  color: #1d1405;
  background: linear-gradient(110deg, #b98d35, #f0d58c 45%, #c79a3e);
  box-shadow: 0 12px 28px rgba(168, 128, 47, 0.35);
}

.years-go::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 35%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: skewX(-20deg);
  animation: years-gj-sweep 3.4s ease-in-out infinite;
}

@keyframes years-gj-sweep {
  to { left: 140%; }
}

.years-popup-note {
  min-height: 1.2em;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.years-thanks {
  display: none;
  text-align: center;
  padding: 40px 0;
}

.years-thanks .years-mk {
  font: 700 70px Cormorant Garamond, Georgia, serif;
  color: var(--gold2);
  animation: years-gj-swell 1s;
}

.years-thanks p {
  color: var(--muted);
  line-height: 1.6;
}

.years-popup-formside.is-sent form,
.years-popup-formside.is-sent .years-form-head {
  display: none;
}

.years-popup-formside.is-sent .years-thanks {
  display: block;
}

.years-again {
  background: none;
  border: 0;
  color: var(--gold2);
  font: 500 15px Jost, sans-serif;
  cursor: pointer;
  text-decoration: underline;
}

.years-popup-root :focus-visible {
  outline: 2px solid var(--gold2);
  outline-offset: 3px;
}

@media (max-width: 800px) {
  .years-popup {
    grid-template-columns: 1fr;
  }

  .years-popup-mark {
    min-height: 660px;
  }

  .years-popup-formside {
    padding: 34px 24px;
  }

  .years-brand b {
    letter-spacing: 0.12em;
    white-space: normal;
  }

  .years-tag {
    letter-spacing: 0.4em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .years-orbit,
  .years-num,
  .years-go::after {
    animation: none;
  }
}
