@font-face {
  font-family: Vault Cinzel;
  src: url('/fonts/cinzel-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: Vault Alegreya;
  src: url('/fonts/alegreya-sans-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Vault Alegreya;
  src: url('/fonts/alegreya-sans-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #0b151b;
  --panel: #122127;
  --cream: #f2e9d5;
  --muted: #c1c1b1;
  --gold: #f1d298;
  --line: #b29158;
  --emerald: #85dcaa;
  --display: 'Vault Cinzel', Georgia, serif;
  --body: 'Vault Alegreya', system-ui, sans-serif;
  --gutter: max(2rem, (100% - 1240px) / 2);
  scroll-behavior: smooth;
}

*, ::before, ::after { box-sizing: border-box; }
body { margin: 0; color: var(--cream); background: var(--night); font: 400 1.1rem/1.45 var(--body); }
body:has(.gate-dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid var(--emerald); outline-offset: 4px; }
h1, h2, h3, p, figure { margin: 0; }
:is(h1, h2, h3) { font-family: var(--display); line-height: 1.12; text-wrap: balance; }
.skip-link { position: absolute; z-index: 5; top: .75rem; left: 1rem; padding: .6rem 1rem; background: var(--night); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

/* The hackathon banner sits above everything, in the normal flow; the page below it keeps its own frame. */
.blaze-banner { position: relative; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem 1.2rem;
  padding: .5rem var(--gutter); color: var(--cream); background: #0e2a22; border-bottom: 1px solid var(--line); font-size: .95rem; text-align: center; }
.blaze-banner[hidden] { display: none; }
.blaze-banner strong { color: var(--gold); font-family: var(--display); letter-spacing: .04em; }
.blaze-banner a { color: var(--emerald); text-decoration: underline; text-underline-offset: 3px; }
.blaze-banner button { padding: .1rem .6rem; color: var(--cream); background: transparent; border: 1px solid var(--line); border-radius: 4px; font-size: .85rem; }
.blaze-banner code { font: 400 .82rem/1.3 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.gate-frame { position: relative; }

.gate-header {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: clamp(.8rem, 2.4vw, 1.5rem) var(--gutter);
  background: linear-gradient(#0b141bd9, transparent);
}
.gate-header nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.6rem); }
.gate-brand { display: inline-flex; align-items: center; gap: .64rem; color: var(--gold); font: 750 clamp(1.08rem, 3vw, 1.42rem)/1 var(--display); }
.gate-brand img { object-fit: contain; }
.gate-header .gate-brand img { flex: none; width: 44px; height: 56px; filter: drop-shadow(0 2px 6px #000b); }
.quiet-link { padding: .42rem .12rem; color: var(--cream); background: none; border: 0; font-weight: 700; }
.quiet-link:hover { color: var(--gold); }
.gate-sign-in {
  min-height: 44px;
  padding: .45rem 1.1rem;
  color: var(--gold);
  border: 1px solid #b291588e;
  background: #101d24ab;
  transition: border-color .18s ease, background-color .18s ease;
}
.gate-sign-in:hover { border-color: var(--gold); background: #1c302f; }

.gate-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: max(43rem, 100svh);
  padding: 7.25rem var(--gutter) 7.3rem;
  overflow: hidden;
  background: #17252c;
}
.gate-landscape, .gate-guard, .gate-hero::before, .gate-hero::after { position: absolute; inset: 0; pointer-events: none; }
.gate-landscape { z-index: -4; width: 100%; height: 100%; object-fit: cover; object-position: 69% 39%; animation: gate-pan 22s ease-in-out 2 alternate both; }
.gate-hero::before {
  z-index: -2;
  content: '';
  background: linear-gradient(90deg, #0b151bf2 0%, #0b161dda 24%, #101d238e 46%, transparent 75%), linear-gradient(0deg, #0b151b 0%, #0b151b35 31%, transparent 51%);
}
.gate-hero::after {
  z-index: -1;
  content: '';
  background: radial-gradient(ellipse at 84% 27%, #f4c68924, transparent 49%);
  animation: gate-light 9s ease-in-out 3 alternate both;
}
.gate-guard { z-index: -3; min-width: 0; }
.gate-guard img { position: absolute; height: auto; filter: drop-shadow(1rem 1.2rem 1.2rem #111b1bbb); }
.gate-cavalry { right: 11%; bottom: 16%; width: clamp(13rem, 26vw, 30rem); }
.gate-archer { right: 1%; bottom: 13%; width: clamp(8rem, 16vw, 18rem); }
.gate-guard-soldier { right: 23%; bottom: 12%; width: clamp(9rem, 16vw, 19rem); }
.gate-copy { align-self: center; max-width: min(100%, 46rem); text-shadow: 0 2px 18px #090f13; }
.gate-copy > * { animation: gate-enter .7s cubic-bezier(.2,.8,.2,1) backwards; }
.gate-copy h1 { margin: .38rem 0 .18rem; color: var(--gold); font-size: clamp(3.9rem, 9.2vw, 8.7rem); font-weight: 800; letter-spacing: -.065em; line-height: .98; text-wrap: nowrap; }
.gate-eyebrow { display: flex; align-items: center; gap: .65rem; color: #efd5a5; font: 700 .82rem/1.3 var(--display); letter-spacing: .17em; text-transform: uppercase; }
.gate-eyebrow span { width: .47rem; height: .47rem; border: 1px solid var(--gold); background: #f2ce8552; transform: rotate(45deg); }
.gate-tagline { color: #f8f1e0; font: 740 clamp(1.45rem, 4vw, 2.95rem)/1.16 var(--display); letter-spacing: -.023em; animation-delay: .09s; }
.gate-intro { max-width: 35ch; margin-top: 1.1rem; color: #ece1cc; font-size: clamp(1.12rem, 1.65vw, 1.37rem); line-height: 1.36; animation-delay: .15s; }
.gate-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.25rem; margin-top: 1.8rem; animation-delay: .22s; }
.gate-entry-note { color: #e7d8b8; font-size: 1rem; }
.gate-button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 52px;
  padding: .68rem 1.1rem .66rem 1.3rem;
  border: 1px solid #a4b989;
  background: linear-gradient(135deg, #2d7151, #194636);
  color: #fcf2da;
  font: 790 .95rem/1.18 var(--display);
  box-shadow: inset 0 0 0 3px #1c3b326f, 0 7px 26px #0a1419a0;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.gate-button::after { position: absolute; inset: 3px; z-index: -1; content: ''; border: 1px solid #a5c79c66; transition: border-color .2s ease; }
.gate-button:hover { border-color: #def3bb; transform: translateY(-2px); }
.gate-button:hover::after { border-color: #d5e3bbaa; }
.gate-button span { color: #e5e8ba; font: 700 1.4rem/1 var(--body); }
.gate-scroll { position: absolute; bottom: 2.15rem; left: var(--gutter); display: flex; align-items: center; gap: .8rem; padding: .35rem 0; color: #e9ce99; font: 700 .76rem/1.3 var(--display); letter-spacing: .12em; transition: color .18s ease; }
.gate-scroll span { font: 700 1.3rem/1 var(--body); transition: transform .18s ease; }
.gate-scroll:hover { color: #fff1d1; }
.gate-scroll:hover span { transform: translateY(3px); }

.frontier { max-width: 1240px; margin: auto; padding: clamp(3.5rem, 7vw, 7.3rem) 2rem clamp(4rem, 8vw, 7rem); }
.frontier-heading { max-width: 42rem; margin: 0 auto clamp(3rem, 6vw, 5.5rem); text-align: center; }
.section-emblem { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem; max-width: 15rem; margin: 0 auto 1.4rem; }
.section-emblem::before, .section-emblem::after { content: ''; height: 1px; background: linear-gradient(90deg, transparent, #b19457a4); }
.section-emblem::after { transform: scaleX(-1); }
.frontier h2, .gate-finale h2 { color: var(--gold); font-size: clamp(1.95rem, 5vw, 4rem); font-weight: 750; letter-spacing: -.04em; }
.frontier-heading p { margin-top: .72rem; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.frontier-story { display: grid; grid-template-columns: 1.22fr 1fr; align-items: center; gap: clamp(2rem, 6.2vw, 6.6rem); }
.frontier-story + .frontier-story { margin-top: clamp(2.4rem, 5.9vw, 6rem); }
.story-reverse { grid-template-columns: 1fr 1.22fr; }
.story-reverse .story-art { grid-column: 2; grid-row: 1; }
.story-reverse .story-copy { grid-column: 1; grid-row: 1; padding-left: clamp(0rem, 5vw, 4.5rem); }
.story-art {
  position: relative;
  isolation: isolate;
  min-width: 0;
  aspect-ratio: 1.96;
  background: #203031;
  border: 1px solid #9d835764;
  overflow: hidden;
}
.story-art::after { position: absolute; inset: 5px; content: ''; border: 1px solid #dec79544; pointer-events: none; }
.story-art > img:first-child { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 49%; }
.story-atlas .story-land { filter: saturate(.85) brightness(.7); }
.story-atlas .story-castle { position: absolute; width: auto; height: 94%; bottom: 1%; left: 30%; filter: drop-shadow(0 .55rem .8rem #091a1ba6); }
.story-army > img:first-child { object-position: center 43%; }
.story-treaty > img:first-child { object-position: center 39%; }
.story-copy h3 { color: var(--gold); font-size: clamp(1.65rem, 3.2vw, 2.85rem); font-weight: 750; letter-spacing: -.035em; text-wrap: wrap; }
.story-copy p { max-width: 36ch; margin-top: .78rem; color: var(--muted); font-size: clamp(1.05rem, 1.9vw, 1.22rem); }

.gate-finale { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 27rem; padding: 4rem var(--gutter); text-align: center; overflow: hidden; border-block: 1px solid #9d83575c; }
.gate-finale img, .gate-finale::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.gate-finale img { z-index: -2; object-fit: cover; object-position: center 46%; }
.gate-finale::after { z-index: -1; content: ''; background: radial-gradient(ellipse at center, #0e1a22d6 19%, #101c22bc 56%, #10232273), linear-gradient(0deg, #0b151b, transparent 76%); }
.gate-finale p { max-width: 42ch; margin: .84rem auto 1.5rem; color: #f0e5d0; font-size: 1.14rem; }
.gate-finale > div { max-width: 48rem; }
.gate-finale .gate-eyebrow { display: block; margin-bottom: .72rem; color: var(--gold); font-size: .78rem; text-transform: uppercase; }
.gate-technologies { display: flex; flex-wrap: wrap; justify-content: center; gap: .85rem 2rem; margin: 0 auto 1.5rem; padding: .9rem 0; border-block: 1px solid #b796676e; }
.gate-technologies dt { color: var(--gold); font-family: var(--display); font-weight: 750; }
.gate-technologies dd { margin: .14rem 0 0; color: #e5d9c8; }
.gate-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem var(--gutter); }
.gate-footer .gate-brand { font-size: .98rem; }
[data-reveal].in-frame { animation: gate-enter .62s cubic-bezier(.2,.8,.2,1); }

.gate-dialog {
  width: min(34rem, calc(100% - 1.65rem));
  max-height: calc(100% - 2rem);
  padding: 0 1.5rem 1.55rem;
  color: var(--cream);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 3px #0c191b, 0 1.5rem 6rem #050809c2;
  overflow: auto;
}
.gate-dialog[open] { animation: gate-enter .2s ease-out; }
.gate-dialog::backdrop { background: #090f16ad; backdrop-filter: blur(4px); }
.gate-dialog-close { position: absolute; z-index: 1; top: .55rem; right: .55rem; width: 44px; height: 44px; padding: 0; color: var(--gold); background: #0c191bdd; border: 1px solid #ae916d9e; font-size: 1.55rem; line-height: 1; }
.gate-dialog-close:hover { border-color: var(--gold); }
.gate-dialog-header {
  margin: 0 -1.5rem 1.2rem;
  padding: 1.6rem 3.65rem 1.15rem 1.5rem;
  background: linear-gradient(90deg, #111c24f7, #11212aca), url('/art/event-season.webp') center 34%/cover;
  border-bottom: 1px solid #a88c625e;
}
.gate-dialog-header img { margin-bottom: .35rem; }
.gate-dialog-header h2 { color: var(--gold); font-size: clamp(1.28rem, 4.5vw, 1.87rem); font-weight: 760; }
.gate-dialog-header p { margin-top: .5rem; color: #e5d9c8; line-height: 1.35; }
.gate-dialog .identity-panel > h3 { margin: 0 0 .55rem; color: var(--gold); font-size: 1.03rem; }
.gate-dialog .identity-panel > p { margin-bottom: .75rem; color: var(--muted); }
.gate-dialog .identity-panel label { display: block; color: var(--gold); font-weight: 700; }
.gate-dialog .identity-panel .field { display: block; margin: .62rem 0; }
.gate-dialog .identity-panel :is(input, textarea) { display: block; width: 100%; margin-top: .25rem; padding: .62rem .65rem; color: var(--cream); background: #0c151b; border: 1px solid #77847c; border-radius: 2px; font: 400 .86rem/1.42 ui-monospace, monospace; resize: vertical; }
.gate-dialog .identity-panel :is(input, textarea):read-only { color: #d0cdb7; }
.gate-dialog .identity-panel .buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.gate-dialog .identity-panel .btn { display: inline-flex; align-items: center; justify-content: center; gap: .38rem; min-height: 44px; padding: .42rem .68rem; background: #1b2c33; border: 1px solid #758477; color: var(--cream); font-weight: 700; }
.gate-dialog .identity-panel .btn.primary { color: #fcf2da; border-color: #a4b989; background: linear-gradient(135deg, #2d7151, #194636); }
.gate-dialog .identity-panel .btn:hover { border-color: var(--gold); }
.gate-dialog .identity-panel .icon { width: 1rem; height: 1rem; }
.gate-dialog .identity-panel .form-error { margin: .45rem 0 0; color: #ffb7a9; }
.gate-dialog .identity-panel .form-error:empty { display: none; }

@keyframes gate-enter { from { opacity: .67; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes gate-pan { from { transform: scale(1); } to { transform: scale(1.035); } }
@keyframes gate-light { from { opacity: .35; } to { opacity: .85; } }

@media (max-width: 760px) {
  :root { --gutter: clamp(1.18rem, 5vw, 2.4rem); }
  .gate-header .gate-how-link { display: inline-flex; align-items: center; min-height: 44px; text-align: center; }
  .gate-header .gate-brand { gap: .5rem; }
  .gate-header .gate-brand img { width: 35px; height: 44px; }
  .gate-header nav { flex: none; gap: .9rem; }
  .gate-header .gate-sign-in, .gate-header .gate-how-link { white-space: nowrap; }
  .gate-hero { padding-top: 18rem; min-height: max(41rem, 100svh); }
  .gate-landscape { object-position: 67% top; }
  .gate-hero::before { background: linear-gradient(0deg, #0b151b 2%, #0c171ee6 38%, #0e192266 64%, #101d2315 86%), linear-gradient(90deg, #101c24aa, transparent 80%); }
  .gate-copy h1 { font-size: clamp(3rem, 12.8vw, 5.9rem); }
  .gate-copy { align-self: end; margin-bottom: 1.1rem; }
  .gate-cavalry { bottom: 46%; right: 12%; width: clamp(11rem, 45vw, 17rem); }
  .gate-archer { bottom: 46%; right: 0; width: clamp(7rem, 27vw, 11rem); }
  .gate-guard-soldier { bottom: 43%; right: 32%; width: clamp(7rem, 27vw, 12rem); }
  .gate-actions { margin-top: 1.15rem; }
  .frontier { padding-inline: var(--gutter); }
  .frontier-story, .story-reverse { grid-template-columns: 1fr; gap: 1.05rem; }
  .story-reverse .story-art, .story-reverse .story-copy { grid-column: auto; grid-row: auto; padding-left: 0; }
  .story-copy p { margin-top: .5rem; }
  .gate-finale { min-height: 23rem; }
}
@media (max-width: 760px) and (max-height: 720px) {
  .gate-hero { min-height: max(37rem, 100svh); padding-top: 13rem; padding-bottom: 4.8rem; }
  .gate-scroll { bottom: 1.3rem; }
  .gate-cavalry { right: 15%; bottom: 49%; }
  .gate-archer, .gate-guard-soldier { bottom: 45%; }
}
@media (max-width: 360px) {
  .gate-header nav { gap: .5rem; }
  .gate-header .gate-brand { gap: .4rem; }
  .gate-header .gate-brand img { width: 30px; height: 38px; }
  .gate-header .gate-sign-in, .gate-header .gate-how-link { font-size: .81rem; white-space: nowrap; }
  .gate-actions { align-items: flex-start; flex-direction: column; }
  .gate-copy { margin-bottom: 0; }
  .gate-dialog { padding-inline: .95rem; }
  .gate-dialog-header { margin-inline: -.95rem; padding-left: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Connect wallet on the start page */
.gate-button[hidden] { display: none; }
button.gate-button { cursor: pointer; }
.gate-wallet-button { border-color: #d9b56a; background: linear-gradient(135deg, #7a5a1e, #4a3510); }
.gate-wallet { padding: 1rem 1.25rem 1.35rem; color: #e5d9c8; line-height: 1.4; }
.gate-wallet-pair { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.gate-wallet-pair img { width: 230px; height: 230px; max-width: 100%; border: 6px solid #fff3d2; }
.gate-wallet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: .9rem; }
.gate-wallet-status { color: #f1e3bd; font-weight: 700; }
.gate-wallet-error { margin-top: .8rem; color: #ffb4a2; font-weight: 700; }
@media (max-width: 560px) { .gate-wallet-pair { grid-template-columns: 1fr; justify-items: center; } }
