/* Megency website, Frontier theme (matches the in-game UI: ink, ember, paper, slab type). */
:root {
  --ink: #0a0806;
  --ink-2: #120e0a;
  --ink-3: #1b150f;
  --ember: #ff6b1a;
  --glow: #ffa040;
  --paper: #f5efe6;
  --sand: #cdbba6;
  --dust: #a8957f;
  --hair: rgba(245, 239, 230, .14);
  --hair-strong: rgba(255, 160, 64, .38);
  --slab: 'Zilla Slab', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1160px;
  --ease: cubic-bezier(.2, .9, .3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; overflow-x: clip; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--slab); line-height: 1.08; margin: 0; letter-spacing: .01em; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--ember); color: var(--ink); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  background: rgba(10, 8, 6, .72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav[data-scrolled] { border-bottom-color: var(--hair); background: rgba(10, 8, 6, .9); }
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 20px var(--slab); text-transform: uppercase; letter-spacing: .06em; }
.nav__brand img { width: 36px; height: 36px; }
.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links a { text-decoration: none; color: var(--sand); font-size: 15px; font-weight: 500; transition: color .18s ease; }
.nav__links a:hover { color: var(--paper); }
.nav__links .nav__cta { color: var(--ink); background: var(--ember); padding: 8px 16px; font-weight: 600; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); transition: background .18s ease, transform .09s ease; }
.nav__links .nav__cta:hover { color: var(--ink); background: var(--glow); }
.nav__toggle { display: none; background: none; border: 1px solid var(--hair); color: var(--paper); width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  font: 600 16px var(--sans); text-decoration: none; cursor: pointer; border: 0;
  transition: transform .18s var(--ease), background .18s ease, color .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.97); transition-duration: .09s; }
.btn--primary { background: var(--ember); color: var(--ink); clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); padding-right: 34px; }
.btn--primary:hover { background: var(--glow); }
.btn--ghost { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1px var(--hair); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--hair-strong); color: var(--glow); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* Hero */
.hero {
  position: relative; overflow-x: clip;
  min-height: calc(100svh - 70px);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 40px;
  padding: 64px var(--gutter) 88px;
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
}
.hero__glow {
  position: absolute; inset: -10% -20% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px; z-index: -1;
  background: radial-gradient(circle at 60% 40%, rgba(255, 107, 26, .22), rgba(255, 107, 26, 0) 60%);
  animation: drift 12s ease-in-out infinite alternate;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 160, 64, .08), transparent 55%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--glow); font-size: 13px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 0 rgba(255, 107, 26, .7); animation: pulse 2s ease-out infinite; }
.hero h1 { margin-top: 18px; font-size: clamp(52px, 9vw, 112px); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
.hero h1 span { color: var(--ember); }
.lede { margin-top: 22px; max-width: 34em; color: var(--sand); font-size: clamp(16px, 1.6vw, 19px); }
.hero__actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero__meta { margin-top: 16px; color: var(--dust); font-size: 14px; }
.hero__mark { margin: 0; justify-self: center; width: min(420px, 100%); position: relative; }
.hero__mark img { width: 100%; height: auto; filter: drop-shadow(0 30px 60px rgba(255, 107, 26, .25)); animation: float 7s ease-in-out infinite; }
.hero__mark::after { content: ''; position: absolute; inset: 8% 8% -6%; border: 1px solid var(--hair-strong); clip-path: polygon(0 0, 22% 0, 22% 1px, 1px 1px, 1px 22%, 0 22%, 0 78%, 1px 78%, 1px calc(100% - 1px), 22% calc(100% - 1px), 22% 100%, 78% 100%, 78% calc(100% - 1px), calc(100% - 1px) calc(100% - 1px), calc(100% - 1px) 78%, 100% 78%, 100% 22%, calc(100% - 1px) 22%, calc(100% - 1px) 1px, 78% 1px, 78% 0); pointer-events: none; }

/* Sections */
.section { padding: 96px var(--gutter); max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; }
.section--alt { max-width: none; background: linear-gradient(180deg, rgba(27, 21, 15, .65), rgba(18, 14, 10, .4)); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.section--alt > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section__head { margin-bottom: 44px; }
.kicker { display: block; color: var(--glow); font-size: 13px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; margin-bottom: 12px; }
.section h2 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 700; }

.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.feature { padding: 26px 22px 28px; background: var(--ink-3); border-left: 2px solid var(--ember); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%); transition: transform .22s var(--ease), background .22s ease; }
.feature:hover { transform: translateY(-3px); background: #221a12; }
.feature svg { width: 30px; height: 30px; color: var(--glow); }
.feature h3 { margin-top: 18px; font-size: 22px; }
.feature p { margin-top: 10px; color: var(--sand); font-size: 15px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: none; }
.step { position: relative; padding: 0 22px 0 0; }
.step::before { content: ''; position: absolute; top: 19px; left: 56px; right: 14px; height: 1px; background: linear-gradient(90deg, var(--hair-strong), transparent); }
.step:last-child::before { display: none; }
.step__no { display: inline-grid; place-items: center; width: 42px; height: 40px; font: 700 18px var(--slab); color: var(--ink); background: var(--ember); clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.step h3 { margin-top: 18px; font-size: 21px; }
.step p { margin-top: 8px; color: var(--sand); font-size: 15px; }
.spec { margin-top: 48px; padding: 22px 26px; border: 1px solid var(--hair); display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 32px; }
.spec h3 { font-size: 18px; color: var(--glow); text-transform: uppercase; letter-spacing: .08em; }
.spec ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--sand); }
.spec li::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 10px; background: var(--ember); transform: translateY(-2px) rotate(45deg); }

.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--hair); border: 1px solid var(--hair); }
.rule { background: var(--ink); padding: 24px 22px; transition: background .2s ease; }
.rule:hover { background: var(--ink-3); }
.rule h3 { font-size: 19px; }
.rule p { margin-top: 8px; color: var(--sand); font-size: 15px; }

.community { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.community p { margin-top: 12px; color: var(--sand); }
.community__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.footer { padding: 40px var(--gutter) 48px; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; display: grid; gap: 10px; color: var(--dust); font-size: 14px; }
.footer__brand { display: flex; align-items: center; gap: 10px; color: var(--paper); font: 700 17px var(--slab); text-transform: uppercase; letter-spacing: .06em; }
.footer__copy { color: #7d6d5c; }

/* Motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--d, 0ms); }
.reveal[data-in] { opacity: 1; transform: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 26, .7); } 70% { box-shadow: 0 0 0 10px rgba(255, 107, 26, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 107, 26, 0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(-6%, 4%); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__glow, .hero__mark img, .pulse { animation: none; }
}

/* Layout breakpoints */
@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 0; }
  .step:nth-child(2)::before { display: none; }
}
@media (max-width: 760px) {
  .nav__toggle { display: inline-flex; }
  .nav__links { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 18px; background: rgba(10, 8, 6, .97); border-bottom: 1px solid var(--hair); display: none; }
  .nav[data-open] .nav__links { display: flex; }
  .nav__links a { padding: 14px 0; border-bottom: 1px solid var(--hair); }
  .nav__links .nav__cta { margin-top: 12px; text-align: center; border: 0; }
  .hero { grid-template-columns: 1fr; padding-top: 40px; min-height: auto; text-align: left; }
  .hero__mark { order: -1; width: min(220px, 60%); justify-self: start; }
  .hero__actions .btn { flex: 1 1 220px; }
  .section { padding: 72px var(--gutter); }
  .features, .steps { grid-template-columns: 1fr; }
  .step::before { display: none; }
}

/* 404 */
.notfound { min-height: 100svh; display: grid; place-content: center; text-align: center; gap: 18px; }
.notfound img { margin: 0 auto; }
.notfound h1 { font-size: clamp(34px, 6vw, 60px); }
.notfound__text { color: var(--sand); }
