/* ═══════════════════════ TOKENS ═══════════════════════ */
:root {
  --cream: #F7F5F0;
  --cream2: #EDEAE3;
  --ink: #1A1814;
  --ink2: #3D3A35;
  --muted: #8A8680;
  --muted2: #C4C0BA;
  --dark: #111009;
  --dark2: #1C1A14;
  --dark3: #232119;
  --amber: #C8861A;
  --amber-light: #E8A83A;
  --amber-glow: rgba(200, 134, 26, .15);
  --border-light: rgba(26, 24, 20, .08);
  --border-dark: rgba(247, 245, 240, .09);
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
}

/* ═══════════════════════ RESET ═══════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--dark);
  color: var(--cream);
  font-family: var(--sans);
  overflow-x: hidden;
}
::selection { background: rgba(200, 134, 26, .25); color: var(--cream); }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: var(--sans); }

/* ═══════════════════════ SCROLLBAR ═══════════════════════ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 99px; }

/* ═══════════════════════ LANG CONTROL ═══════════════════════ */
[data-lt] { display: none; }
body.lt [data-en] { display: none !important; }
body.lt [data-lt] { display: revert !important; }
body.lt [data-lt].blk { display: block !important; }
body.lt [data-lt].flex { display: flex !important; }

/* ═══════════════════════ NAV ═══════════════════════ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: rgba(17, 16, 9, .82);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border-dark);
  transition: background .3s;
}
.nav-logo {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: -.01em;
  color: var(--cream);
  transition: opacity .2s;
}
.nav-logo:hover { opacity: .85; }
.nav-logo em { font-style: normal; color: var(--amber); }
.nav-center {
  display: flex;
  gap: 2rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav-center a {
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: rgba(247, 245, 240, .4);
  transition: color .2s, border-color .2s;
  padding: .2rem 0;
  border-bottom: 1px solid transparent;
}
.nav-center a:hover,
.nav-center a.nav-active {
  color: var(--cream);
  border-color: var(--amber);
}

/* ── LANG PILL ── */
.lang-pill {
  display: flex;
  background: rgba(247, 245, 240, .06);
  border: 1px solid var(--border-dark);
  border-radius: 99px;
  padding: 3px;
  position: relative;
  gap: 2px;
}
.lang-pill button {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .28rem .85rem;
  border: none;
  background: none;
  cursor: pointer;
  color: rgba(247, 245, 240, .35);
  border-radius: 99px;
  transition: color .2s;
  position: relative;
  z-index: 1;
}
.lang-pill button.active { color: var(--cream); }
.lang-pill .pill-bg {
  position: absolute;
  top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px);
  background: var(--dark3);
  border-radius: 99px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .3);
  transition: transform .25s var(--ease-in-out);
}
.lang-pill.lt .pill-bg { transform: translateX(100%); }

/* ═══════════════════════ HERO ═══════════════════════ */
.archive-hero {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 9rem 2rem 5rem;
  position: relative;
  overflow: hidden;
  text-align: center;
  background: var(--dark2);
}
.archive-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(200, 134, 26, .09) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 60%, rgba(200, 134, 26, .06) 0%, transparent 55%),
    radial-gradient(ellipse 100% 50% at 50% 100%, rgba(26, 24, 20, .4) 0%, transparent 60%);
  pointer-events: none;
}
.archive-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-dark) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 80%);
  pointer-events: none;
  opacity: .6;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber-light);
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
  animation: rise .9s .1s var(--ease-out) both;
}
.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  height: 1px;
  width: 28px;
  background: var(--amber);
  opacity: .5;
}

.hero-h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  line-height: 1.0;
  letter-spacing: -.03em;
  max-width: 720px;
  position: relative;
  z-index: 1;
  animation: rise .9s .25s var(--ease-out) both;
}
.hero-h1 .line-italic {
  display: block;
  font-style: italic;
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  max-width: 520px;
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(247, 245, 240, .45);
  font-weight: 300;
  margin: 2rem 0 2.5rem;
  position: relative;
  z-index: 1;
  animation: rise .9s .4s var(--ease-out) both;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
  animation: rise .9s .55s var(--ease-out) both;
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
  animation: rise .9s .7s var(--ease-out) both;
}
.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  background: rgba(247, 245, 240, .04);
  border: 1px solid var(--border-dark);
  border-radius: 1rem;
  padding: 1rem 1.8rem;
  transition: border-color .25s, background .25s, transform .25s;
}
.stat-pill:hover {
  border-color: rgba(200, 134, 26, .25);
  background: rgba(247, 245, 240, .06);
  transform: translateY(-2px);
}
.stat-num {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--amber-light);
  letter-spacing: -.02em;
}
.stat-label {
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(247, 245, 240, .35);
}

/* ═══════════════════════ BUTTONS ═══════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 2rem;
  background: var(--cream);
  color: var(--ink);
  border-radius: .5rem;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .01em;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
  position: relative;
  overflow: hidden;
}
.btn-primary:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 1.8rem;
  background: transparent;
  color: rgba(247, 245, 240, .7);
  border: 1px solid var(--border-dark);
  border-radius: .5rem;
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s, color .2s;
}
.btn-outline:hover {
  border-color: var(--amber);
  background: var(--amber-glow);
  color: var(--cream);
  transform: translateY(-2px);
}

/* ═══════════════════════ RIBBON ═══════════════════════ */
.ribbon {
  background: var(--ink);
  color: rgba(247, 245, 240, .45);
  padding: 1.4rem 0;
  overflow: hidden;
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, .04);
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}
.ribbon-track {
  display: flex;
  gap: 3.5rem;
  white-space: nowrap;
  animation: marquee 28s linear infinite;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.ribbon-item {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
}
.ribbon-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  opacity: .7;
  flex-shrink: 0;
}

/* ═══════════════════════ MAIN SECTION ═══════════════════════ */
.archive-main {
  padding: 5rem 2rem 7rem;
  background: var(--dark);
}
.container {
  max-width: 960px;
  margin: 0 auto;
}

/* ═══════════════════════ DISCLAIMER ═══════════════════════ */
.disclaimer {
  background: rgba(200, 134, 26, .06);
  border: 1px solid rgba(200, 134, 26, .12);
  padding: 1.4rem 1.6rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border-radius: .9rem;
  margin-bottom: 3rem;
}
.disclaimer-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: .1rem; }
.disclaimer p {
  font-size: .85rem;
  line-height: 1.7;
  color: rgba(247, 245, 240, .55);
}
.disclaimer p strong { color: var(--amber-light); font-weight: 600; }
.disclaimer a {
  color: var(--amber-light);
  border-bottom: 1px solid rgba(232, 168, 58, .3);
  transition: border-color .2s;
}
.disclaimer a:hover { border-color: var(--amber-light); }

/* ═══════════════════════ SEARCH & FILTERS ═══════════════════════ */
.search-bar-wrap { margin-bottom: 1.5rem; }

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1.2rem;
}
.search-icon {
  position: absolute;
  left: 1.2rem;
  color: rgba(247, 245, 240, .3);
  pointer-events: none;
}
.search-bar input {
  width: 100%;
  background: rgba(247, 245, 240, .04);
  border: 1px solid var(--border-dark);
  border-radius: .75rem;
  padding: 1rem 3rem 1rem 3.2rem;
  font-family: var(--sans);
  font-size: .92rem;
  color: var(--cream);
  outline: none;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.search-bar input::placeholder { color: rgba(247, 245, 240, .25); }
.search-bar input:focus {
  border-color: rgba(200, 134, 26, .4);
  background: rgba(247, 245, 240, .06);
  box-shadow: 0 0 0 3px var(--amber-glow);
}
.search-clear {
  position: absolute;
  right: .8rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(247, 245, 240, .08);
  color: rgba(247, 245, 240, .5);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}
.search-clear:hover {
  background: rgba(247, 245, 240, .15);
  color: var(--cream);
}

.filter-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.filter-btn {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .04em;
  padding: .45rem 1rem;
  border-radius: 99px;
  border: 1px solid var(--border-dark);
  background: rgba(247, 245, 240, .03);
  color: rgba(247, 245, 240, .4);
  cursor: pointer;
  transition: all .2s var(--ease-in-out);
}
.filter-btn:hover {
  border-color: rgba(247, 245, 240, .15);
  color: var(--cream);
}
.filter-btn.active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 4px 15px var(--amber-glow);
}

.results-meta {
  font-size: .8rem;
  color: rgba(247, 245, 240, .3);
  margin-bottom: 1.5rem;
  letter-spacing: .02em;
}

/* ═══════════════════════ ARCHIVE CARDS ═══════════════════════ */
.archive-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.archive-card {
  background: rgba(247, 245, 240, .02);
  border: 1px solid rgba(247, 245, 240, .06);
  border-radius: 1.2rem;
  padding: 1.8rem;
  transition: border-color .3s, background .3s, transform .3s var(--ease-out), box-shadow .3s;
  animation: cardIn .5s var(--ease-out) both;
}
.archive-card:hover {
  border-color: rgba(200, 134, 26, .3);
  background: rgba(247, 245, 240, .04);
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .25);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.card-version {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.version-num {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: -.02em;
  color: #fff;
}
.version-badge {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .2rem .65rem;
  border-radius: 99px;
  border: 1px solid;
}
.badge-stable {
  background: rgba(74, 222, 128, .1);
  color: #4ADE80;
  border-color: rgba(74, 222, 128, .25);
}
.badge-beta {
  background: var(--amber-glow);
  color: var(--amber-light);
  border-color: rgba(200, 134, 26, .2);
}
.badge-alpha {
  background: rgba(168, 130, 255, .1);
  color: #C4B5FD;
  border-color: rgba(168, 130, 255, .25);
}

.card-meta {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: rgba(247, 245, 240, .4);
}
.meta-item svg { opacity: .5; flex-shrink: 0; }

.card-summary {
  font-size: .88rem;
  line-height: 1.7;
  color: rgba(247, 245, 240, .45);
  margin-bottom: 1.4rem;
  max-width: 640px;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(247, 245, 240, .06);
}

.btn-changelog {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1.1rem;
  background: transparent;
  border: 1px solid rgba(247, 245, 240, .1);
  border-radius: .5rem;
  font-size: .82rem;
  font-weight: 500;
  color: rgba(247, 245, 240, .6);
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s, transform .2s;
}
.btn-changelog:hover {
  border-color: var(--amber);
  background: var(--amber-glow);
  color: var(--cream);
  transform: translateY(-1px);
}

.dl-group {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
}

.btn-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .65rem 1.1rem;
  border-radius: .5rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.btn-dl-chrome {
  background: var(--cream);
  color: var(--ink);
  border: none;
}
.btn-dl-chrome:hover {
  background: #fff;
  transform: translateY(-1px);
}
.btn-dl-firefox {
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(247, 245, 240, .15);
}
.btn-dl-firefox:hover {
  border-color: #FF941A;
  background: rgba(255, 148, 26, .08);
  transform: translateY(-1px);
}
.btn-dl.is-disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: auto;
}
.btn-dl.is-disabled:hover {
  transform: none;
  background: var(--cream);
}
.btn-dl.btn-dl-firefox.is-disabled:hover {
  background: transparent;
  border-color: rgba(247, 245, 240, .15);
}

/* ═══════════════════════ EMPTY STATE ═══════════════════════ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  border: 1px dashed rgba(247, 245, 240, .1);
  border-radius: 1.2rem;
  margin-top: 1rem;
}
.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.empty-state h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin-bottom: .5rem;
  color: rgba(247, 245, 240, .8);
}
.empty-state p {
  font-size: .88rem;
  color: rgba(247, 245, 240, .35);
  margin-bottom: 1.5rem;
}

/* ═══════════════════════ MODAL ═══════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(17, 16, 9, .65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease-out);
  padding: 1.5rem;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  background: var(--dark2);
  color: var(--cream);
  border: 1px solid var(--border-dark);
  border-radius: 1.5rem;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  transform: scale(.96);
  transition: transform .4s var(--ease-out);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.modal-overlay.open .modal-card { transform: scale(1); }
.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(247, 245, 240, .06);
  border: none;
  color: var(--muted2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background .2s, color .2s;
}
.modal-close:hover {
  background: rgba(247, 245, 240, .15);
  color: #fff;
}
.modal-title {
  font-family: var(--serif);
  font-size: 1.8rem;
  margin-bottom: .35rem;
  letter-spacing: -.02em;
}
.modal-subtitle {
  font-size: .85rem;
  color: rgba(247, 245, 240, .35);
  margin-bottom: 1.8rem;
}
.changelog-list {
  list-style: none;
  margin-bottom: 2rem;
}
.changelog-list li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: .55rem;
  font-size: .88rem;
  line-height: 1.65;
  color: rgba(247, 245, 240, .55);
}
.changelog-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--amber);
  font-size: 1.1rem;
  top: -1px;
}
.modal-dl-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  padding-top: 1.5rem;
  border-top: 1px dashed rgba(247, 245, 240, .1);
}

/* ═══════════════════════ FOOTER ═══════════════════════ */
footer {
  background: var(--dark);
  padding: 2.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--border-dark);
}
.f-logo {
  font-family: var(--serif);
  font-size: 1rem;
  color: rgba(247, 245, 240, .6);
}
.f-logo em { font-style: normal; color: var(--amber); }
.f-copy {
  font-size: .78rem;
  color: rgba(247, 245, 240, .25);
  letter-spacing: .02em;
}

/* ═══════════════════════ REVEAL ANIMATIONS ═══════════════════════ */
.r {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.r.in { opacity: 1; transform: none; }
.r.d1 { transition-delay: .08s; }
.r.d2 { transition-delay: .16s; }
.r.d3 { transition-delay: .24s; }

/* ═══════════════════════ KEYFRAMES ═══════════════════════ */
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ═══════════════════════ RESPONSIVE ═══════════════════════ */
@media (max-width: 900px) {
  nav .nav-center { display: none; }
}
@media (max-width: 600px) {
  nav { padding: 0 1.25rem; }
  .archive-hero { padding: 8rem 1.25rem 4rem; min-height: auto; }
  .archive-main { padding: 3.5rem 1.25rem 5rem; }
  .archive-card { padding: 1.4rem; }
  .card-actions { flex-direction: column; align-items: stretch; }
  .dl-group { flex-direction: column; }
  .btn-dl { justify-content: center; }
  .modal-dl-row { grid-template-columns: 1fr; }
  footer { flex-direction: column; text-align: center; }
  .hero-stats { gap: 1rem; }
  .stat-pill { padding: .85rem 1.4rem; }
}
