:root {
  /* Primoria Exact Palette: warm stone, bone-paper, carbon ink, aged gold */
  --paper: #D4CDBD;
  --paper-2: #CAC2AF;
  --paper-3: #BDB4A0;
  --paper-up: #DCD6C7;
  --field: #E7E2D6;

  --ink: #24221D;
  --ink-2: #5A544A;
  --ink-3: #756E5E;

  --rule: #A89E86;
  --rule-2: #666052;

  --gold: #8A6114;
  --gold-lit: #C8952A;

  --moss: #4A6349;
  --clay: #9A4A2B;
  --stone: #1A1916;
  --stone-2: #232120;

  --fs-1: .73rem;
  --fs-2: .875rem;
  --fs-3: 1.0625rem;
  --fs-4: 1.25rem;
  --fs-5: 1.6rem;
  --fs-6: clamp(2rem, 4.6vw, 3.2rem);
  --fs-7: clamp(2.6rem, 7vw, 4.6rem);

  --page: 1180px;
  --rail: 170px;
  --gut: 52px;
  --measure: 62ch;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='0.5'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: only light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  font-size: var(--fs-3);
  line-height: 1.68;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--grain);
  opacity: .055;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 0;
}

b,
strong {
  font-weight: 600;
}

a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(138, 97, 20, .4);
  transition: border-color .2s;
}

a:hover {
  border-bottom-color: var(--gold);
}

p {
  margin: 0;
  max-width: var(--measure);
}

h1,
h2,
h3 {
  margin: 0;
}

/* ── LAYOUT WITH RAIL (SIDE COLUMN) ── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--page);
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.row {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: var(--gut);
  align-items: start;
}

@media (max-width: 880px) {
  .row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  :root {
    --gut: 0px;
  }
}

.rail {
  position: sticky;
  top: 70px;
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--fs-1);
  line-height: 1.5;
  color: var(--ink-3);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.rail .no {
  display: block;
  color: var(--gold);
  margin-bottom: 5px;
}

@media (max-width: 880px) {
  .rail {
    position: static;
  }

  .rail .no {
    display: inline;
    margin-right: 8px;
  }
}

section {
  padding-block: clamp(52px, 7vw, 92px);
  border-top: 1px solid var(--rule);
}

section.tight {
  padding-block: clamp(38px, 5vw, 60px);
}

h2 {
  font-family: Archivo, "Be Vietnam Pro", sans-serif;
  font-weight: 700;
  font-size: var(--fs-6);
  line-height: 1.1;
  letter-spacing: -.018em;
}

.lede {
  font-size: var(--fs-4);
  font-weight: 300;
  color: var(--ink-2);
  margin-top: 16px;
  max-width: 58ch;
}

.body-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 26px;
}

/* ── STICKY TOP NAV WITH SCROLL PROGRESS ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 25, 22, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #332F28;
  color: #E6E1D6;
}

.prog {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, .05);
}

.prog i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--gold-lit);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.nav-in {
  max-width: var(--page);
  margin: 0 auto;
  padding: 12px clamp(20px, 4vw, 40px);
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-mark {
  font-family: Archivo, sans-serif;
  font-weight: 800;
  letter-spacing: .15em;
  color: var(--gold-lit);
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  height: 28px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5));
}

.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.nav a.item {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--fs-1);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #C3BCAD;
  border: none;
  padding: 4px 0;
  position: relative;
}

.nav a.item:hover {
  color: #fff;
}

.nav a.item.dl {
  color: var(--gold-lit);
}

.nav-side {
  margin-left: auto;
}

.auth-btn {
  background: var(--gold-lit);
  color: #17160F !important;
  padding: 6px 14px !important;
  font-weight: 600;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
}

/* ── HERO SECTION ── */
.hero {
  position: relative;
  background: var(--stone);
  color: #E6E1D6;
  overflow: hidden;
  min-height: clamp(540px, 80vh, 860px);
  display: flex;
  align-items: center;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to bottom, rgba(26, 25, 22, .40) 0%, rgba(26, 25, 22, .55) 30%, rgba(26, 25, 22, .75) 60%, rgba(26, 25, 22, .92) 85%, #1A1916 100%),
    linear-gradient(90deg, rgba(26, 25, 22, .80) 0%, rgba(26, 25, 22, .35) 50%, rgba(26, 25, 22, .75) 100%),
    url("assets/images/hero.png");
  background-size: cover;
  background-position: center 38%;
  background-repeat: no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: .08;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: end;
}

@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.hero-title {
  font-family: Archivo, sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: .95;
  letter-spacing: -.02em;
  margin-top: 14px;
}

.hero-sub {
  color: var(--gold-lit);
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.hero-logo {
  width: min(540px, 100%);
  max-height: 480px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 14px 36px rgba(0, 0, 0, .85));
  transition: transform .3s ease, filter .3s ease;
}

.hero-logo:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 18px 42px rgba(200, 149, 42, .25)) drop-shadow(0 14px 36px rgba(0, 0, 0, .85));
}

.brush {
  position: relative;
  display: inline-block;
  color: #17160F;
  font-family: Archivo, sans-serif;
  font-weight: 700;
  font-size: var(--fs-1);
  text-transform: uppercase;
  letter-spacing: .15em;
  padding: 8px 18px;
  transform: rotate(-1.5deg);
  background: var(--gold-lit);
  clip-path: polygon(0 0, 100% 0, 96% 100%, 0 95%);
}

.thesis {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.thesis p {
  color: #D5CFC3;
  font-weight: 300;
}

.thesis .gold {
  color: var(--gold-lit);
  font-weight: 600;
}

.hero-cta {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* ── PRIMORIA BUTTON SIGNATURE ── */
.btn {
  font-family: Archivo, sans-serif;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-size: var(--fs-2);
  padding: 13px 26px;
  background: var(--gold-lit);
  color: #17160F;
  display: inline-block;
  border: 0;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% 90%, 2% 98%);
  transition: background .2s, transform .08s;
  text-decoration: none;
}

.btn:hover {
  background: #E0AC3E;
}

.btn:active {
  transform: translateY(1px);
}

.btn.ghost {
  background: transparent;
  color: #CFC9BC;
  box-shadow: inset 0 0 0 1px #4A463E;
  clip-path: none;
}

.btn.ghost:hover {
  color: var(--gold-lit);
  box-shadow: inset 0 0 0 1px var(--gold-lit);
}

/* ── BRUSH EDGES SEPARATORS ── */
.edge {
  position: relative;
  height: clamp(54px, 7vw, 98px);
  background: var(--from);
  overflow: hidden;
}

.edge::before,
.edge::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -34px;
  background: var(--to);
}

.edge::before {
  height: calc(50% + 34px);
  filter: url(#brush-a);
}

.edge::after {
  height: calc(62% + 34px);
  filter: url(#brush-b);
}

/* ── FEATURES GRID ── */
.feats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 30px;
  background: var(--rule);
}

@media (max-width: 980px) {
  .feats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .feats {
    grid-template-columns: 1fr;
  }
}

.feat {
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.feat .card-img {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--paper-3);
  position: relative;
}

.feat .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s cubic-bezier(.25, .8, .25, 1);
}

.feat:hover .card-img img {
  transform: scale(1.05);
}

.feat-bg-1 {
  background-color: #556B2F;
  background-image: radial-gradient(#6B8E23, #2E3B14);
}

.feat-bg-2 {
  background-color: #8B4513;
  background-image: radial-gradient(#A0522D, #4A240A);
}

.feat-bg-3 {
  background-color: #2F4F4F;
  background-image: radial-gradient(#3E6666, #1A2E2E);
}

.feat-bg-4 {
  background-color: #708090;
  background-image: radial-gradient(#8798A5, #424D57);
}

.feat-bg-5 {
  background-color: #483D8B;
  background-image: radial-gradient(#5D4FAD, #27214E);
}

.feat-bg-6 {
  background-color: #8FBC8F;
  background-image: radial-gradient(#9ACD32, #475E19);
}

.feat .body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.feat h3 {
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: var(--fs-4);
  font-weight: 600;
}

.feat p {
  font-size: var(--fs-2);
  color: var(--ink-2);
}

.feat .note {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--fs-1);
  color: var(--gold);
  margin-top: auto;
  padding-top: 10px;
}

/* ── DARK ZONE (STORY / FACTIONS) ── */
.dark {
  background: var(--stone-2);
  color: #E6E1D6;
  position: relative;
  padding-block: clamp(52px, 7vw, 92px);
}

.dark h2 {
  color: #F0EBE0;
}

.dark .lede {
  color: #B6AFA1;
}

.dark .rail {
  color: #7C7566;
}

.dark .rail .no {
  color: var(--gold-lit);
}

.orgs {
  margin-top: 34px;
  border-top: 1px solid #3A3630;
}

.org {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
  gap: clamp(14px, 3vw, 38px);
  padding: 22px 0;
  border-bottom: 1px solid #3A3630;
  transition: background .2s;
}

.org:hover {
  background: rgba(200, 149, 42, .04);
}

.org h3 {
  color: #F0EBE0;
  font-family: Archivo, sans-serif;
  font-size: var(--fs-4);
}

.org .q {
  color: var(--gold-lit);
  font-size: var(--fs-2);
  margin-bottom: 8px;
  font-weight: 300;
}

.org .d {
  color: #B6AFA1;
  font-size: var(--fs-2);
}

.story-banner {
  margin-top: 26px;
  border: 1px solid #3A3630;
  overflow: hidden;
  position: relative;
  max-height: 380px;
}

.story-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── STATS NUMBERS ── */
.figs {
  display: flex;
  flex-wrap: wrap;
  margin-top: 26px;
  border-top: 1px solid var(--rule);
}

.fig {
  flex: 1 1 22%;
  min-width: 150px;
  padding: 20px 20px 20px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
}

.fig .n {
  font-family: Archivo, sans-serif;
  font-weight: 800;
  font-size: var(--fs-5);
  color: var(--ink);
  line-height: 1;
}

.fig .k {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--fs-1);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 6px;
}

.fig .d {
  font-size: var(--fs-2);
  color: var(--ink-2);
  margin-top: 4px;
}

/* ── AUTH REGISTRATION LAYOUT ── */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 32px;
  margin-top: 26px;
  align-items: start;
}

@media (max-width: 880px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }
}

.auth-box {
  background: var(--paper-up);
  padding: 30px;
  border-left: 3px solid var(--gold-lit);
  box-shadow: 0 10px 26px -24px rgba(26, 25, 22, .85);
}

.auth-visual {
  background: var(--paper-up);
  border: 1px solid var(--rule);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.auth-visual img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}

.auth-visual-caption {
  padding: 16px 20px;
  border-top: 1px solid var(--rule);
}

.auth-visual-caption .tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--fs-1);
  letter-spacing: .14em;
  color: var(--gold);
  display: block;
  margin-bottom: 4px;
}

.auth-visual-caption p {
  font-size: var(--fs-2);
  color: var(--ink-2);
  line-height: 1.5;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--fs-1);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  background: var(--field);
  border: 0;
  border-bottom: 2px solid var(--rule-2);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-3);
  padding: 12px 14px;
  outline: 0;
  transition: border-color .2s, background .2s;
}

.field input:focus {
  border-bottom-color: var(--gold);
  background: #EFEBE1;
}

.form-action {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.status-msg {
  font-size: var(--fs-2);
  font-weight: 500;
}

.status-msg.ok {
  color: var(--moss);
}

.status-msg.err {
  color: var(--clay);
}

.info-note {
  margin-top: 20px;
  font-size: var(--fs-2);
  color: var(--ink-2);
  max-width: 60ch;
}

/* ── FAQ DETAILS ── */
.qa {
  margin-top: 24px;
  border-top: 1px solid var(--rule);
}

details {
  border-bottom: 1px solid var(--rule);
}

summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  transition: color .2s;
}

summary:hover {
  color: var(--gold);
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  color: var(--gold);
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.2rem;
}

details[open] summary::after {
  content: "−";
}

.ans {
  padding-bottom: 16px;
  font-size: var(--fs-2);
  color: var(--ink-2);
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--rule);
  padding: 34px 0 60px;
  margin-top: 40px;
}

footer .sig {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--fs-1);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

footer p {
  font-size: var(--fs-2);
  color: var(--ink-3);
}

/* ── SOCIAL LINKING BUTTONS & BADGES ── */
.social-link-card {
  transition: all 0.3s ease;
}

.badge-status {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

.badge-status.unverified {
  background: rgba(220, 38, 38, 0.12);
  color: #ef4444;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.badge-status.verified {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.social-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 580px) {
  .social-btn-group {
    grid-template-columns: 1fr;
  }
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--rule);
  cursor: pointer;
  background: #ffffff;
  color: #1a1916;
  border-radius: 4px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.08);
}

.social-btn.google-btn:hover {
  border-color: #ea4335;
}

.social-btn.discord-btn {
  background: #5865F2;
  color: #ffffff;
  border-color: #4752c4;
}

.social-btn.discord-btn:hover {
  background: #4752c4;
}

.social-btn.is-linked {
  background: #f0fdf4 !important;
  color: #166534 !important;
  border-color: #86efac !important;
  cursor: default;
}