/* =========================================================
   Marches of the Crown: landing page styles
   Grounded medieval theme: parchment, heraldic red & gold.
   ========================================================= */

:root {
  --parchment:      #efe3c8;
  --parchment-2:    #e6d5af;
  --ink:            #2b2016;
  --ink-soft:       #4a3a29;
  --gold:           #c9a23f;
  --gold-deep:      #a9832a;
  --heraldic-red:   #8f2c22;
  --heraldic-red-2: #b23a2c;
  --wood:           #3a2a1c;
  --wood-dark:      #2a1d13;
  --forest:         #3f6b3a;
  --line:           #cbb488;

  --shadow: 0 2px 6px rgba(43, 32, 22, .25);
  --radius: 6px;
  --wrap: 1120px;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--parchment);
  /* subtle parchment texture without external images */
  background-image:
    radial-gradient(circle at 20% 15%, rgba(201, 162, 63, .10), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(143, 44, 34, .08), transparent 40%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand__text { font-family: var(--serif); line-height: 1.15; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

a { color: var(--heraldic-red); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: .3px;
  padding: 12px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn--primary {
  background: linear-gradient(#d8b24f, var(--gold-deep));
  color: #34260c;
  border-color: #83641c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), var(--shadow);
  font-weight: 600;
}
.btn--primary:hover { transform: translateY(-1px); background: linear-gradient(#e2bf5c, #b58f2f); }
.btn--ghost {
  background: transparent;
  color: var(--parchment);
  border-color: var(--gold);
}
.btn--ghost:hover { background: rgba(201, 162, 63, .2); color: #fff; border-color: #e2bf5c; }
.btn--block { width: 100%; text-align: center; }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(var(--wood), var(--wood-dark));
  border-bottom: 3px solid var(--gold-deep);
  box-shadow: var(--shadow);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; min-height: 62px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__crest { display: inline-flex; }
.brand__text { color: var(--parchment); font-size: 1.25rem; font-weight: 600; letter-spacing: .4px; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: #e9dcc0; text-decoration: none; font-family: var(--serif);
  padding: 8px 12px; border-radius: var(--radius); font-size: 1.02rem;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav__cta {
  background: linear-gradient(#d8b24f, var(--gold-deep));
  color: #34260c !important; font-weight: 600; margin-left: 6px;
  border: 1px solid #83641c;
}
.nav__cta:hover { background: linear-gradient(#e2bf5c, #b58f2f) !important; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none;
  border: 0; padding: 8px; cursor: pointer;
}
.nav-toggle__bar { width: 24px; height: 2px; background: var(--parchment); display: block; }

/* ---------------- Hero ---------------- */
.hero {
  background:
    linear-gradient(rgba(42, 29, 19, .72), rgba(42, 29, 19, .72)),
    repeating-linear-gradient(135deg, #3a2a1c 0 22px, #34251a 22px 44px);
  color: var(--parchment);
  border-bottom: 3px solid var(--gold-deep);
}
.hero__inner {
  display: grid; grid-template-columns: 1.35fr .9fr; gap: 40px;
  align-items: center; padding: 66px 20px 72px;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: 2px; font-size: .78rem;
  color: var(--gold); margin: 0 0 14px; font-weight: 700;
}
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); margin: 0 0 18px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.lede { font-size: 1.12rem; color: #ecdfc6; max-width: 54ch; margin: 0 0 26px; }
.lede--soon { font-size: 1rem; color: var(--gold); font-style: italic; border-left: 3px solid var(--gold-deep); padding-left: 14px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }
.hero__badges {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px;
  padding: 0; margin: 0; color: #d7c9ab; font-size: .92rem;
}
.hero__badges li { position: relative; padding-left: 20px; }
.hero__badges li::before {
  content: "\2694"; position: absolute; left: 0; color: var(--gold);
}

/* Register card */
.signup {
  background: var(--parchment);
  color: var(--ink);
  border: 1px solid var(--line);
  border-top: 5px solid var(--heraldic-red);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.signup__flag {
  display: inline-block; margin: 0 auto 12px; text-align: center;
  background: var(--heraldic-red); color: #fff; font-family: var(--serif);
  font-size: .78rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px; align-self: center;
}
.signup { display: flex; flex-direction: column; }
.signup__flag { align-self: center; }
.signup__title { margin: 0 0 18px; font-size: 1.5rem; text-align: center; color: var(--heraldic-red); }
.signup__form label { display: block; margin-bottom: 14px; }
.signup__form label > span { display: block; font-size: .82rem; font-weight: 700; letter-spacing: .4px; margin-bottom: 5px; color: var(--ink-soft); text-transform: uppercase; }
.signup__form input,
.signup__form select {
  width: 100%; padding: 11px 12px; font-size: 1rem; font-family: var(--sans);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fbf6e9; color: var(--ink);
}
.signup__form input:focus,
.signup__form select:focus { outline: 2px solid var(--gold-deep); outline-offset: 1px; }
.signup__note { min-height: 1.2em; margin: 12px 0 0; font-size: .92rem; font-weight: 600; }
.signup__note.is-ok { color: var(--forest); }
.signup__note.is-err { color: var(--heraldic-red); }
.signup__fineprint { margin: 12px 0 0; font-size: .8rem; color: var(--ink-soft); text-align: center; }
.signup__teaser { margin: 0 0 18px; text-align: center; color: var(--ink-soft); }
.signup__world { margin-bottom: 18px; }

/* ---------------- Waitlist modal ---------------- */
.modal {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.modal::backdrop {
  background: rgba(20, 13, 7, .66);
  backdrop-filter: blur(2px);
}
.modal:not([open]) { display: none; }
.modal__panel {
  position: relative;
  margin: 0;
  overflow-y: auto;
  max-height: calc(100vh - 32px);
  animation: modal-in .18s ease;
}
.modal__close {
  position: absolute; top: 10px; right: 12px;
  width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center;
  font-size: 1.6rem; line-height: 1; font-family: var(--sans);
  color: var(--ink-soft); background: transparent;
  border: 0; border-radius: 999px; cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.modal__close:hover { background: rgba(143, 44, 34, .12); color: var(--heraldic-red); }
.modal__close:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 1px; }
body.modal-open { overflow: hidden; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------- Sections ---------------- */
.section { padding: 68px 0; }
.section--parchment { background: var(--parchment-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section--dark {
  background: linear-gradient(var(--wood), var(--wood-dark));
  color: var(--parchment);
  border-top: 3px solid var(--gold-deep);
  border-bottom: 3px solid var(--gold-deep);
}
.section__head { text-align: center; max-width: 62ch; margin: 0 auto 44px; }
.section__head h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin: 0 0 12px; }
.section__head p { font-size: 1.08rem; color: var(--ink-soft); margin: 0; }

/* ---------------- Feature grid ---------------- */
.grid { display: grid; gap: 22px; }
.grid--features { grid-template-columns: repeat(3, 1fr); }
.card {
  background: #fbf6e9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(43, 32, 22, .22); }
.card__icon { font-size: 2rem; line-height: 1; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: 1.28rem; color: var(--heraldic-red); }
.card p { margin: 0; color: var(--ink-soft); }

/* ---------------- World / phases ---------------- */
.world { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.world__copy h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); margin: 0 0 16px; }
.world__copy p { font-size: 1.08rem; color: var(--ink-soft); margin: 0 0 14px; }
.world__note { font-style: italic; }
.phases { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.phases li {
  display: flex; gap: 16px; align-items: flex-start;
  background: #fbf6e9; border: 1px solid var(--line); border-left: 4px solid var(--gold-deep);
  border-radius: var(--radius); padding: 16px 18px;
}
.phases__no {
  flex: 0 0 auto; font-family: var(--serif); font-weight: 700; font-size: 1.1rem;
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--heraldic-red); color: #fff; border-radius: 50%;
}
.phases h3 { margin: 0 0 4px; font-size: 1.15rem; }
.phases p { margin: 0; color: var(--ink-soft); font-size: .98rem; }

/* ---------------- Resources ---------------- */
.grid--resources { grid-template-columns: repeat(4, 1fr); }
.resource {
  text-align: center; padding: 26px 18px;
  background: #fbf6e9; border: 1px solid var(--line);
  border-top: 4px solid var(--gold-deep); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.resource--food   { border-top-color: var(--forest); }
.resource--timber { border-top-color: #7a5a2a; }
.resource--iron   { border-top-color: #6b6f76; }
.resource--coin   { border-top-color: var(--gold); }
.resource__glyph { font-size: 2.2rem; display: block; margin-bottom: 8px; }
.resource h3 { margin: 0 0 6px; font-size: 1.2rem; }
.resource p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------------- Houses band ---------------- */
.houses { text-align: center; max-width: 68ch; margin: 0 auto; }
.houses h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin: 0 0 14px; color: #fff; }
.houses__lede { font-size: 1.1rem; color: #e6d8bc; margin: 0 auto 22px; }
.houses__quote {
  font-family: var(--serif); font-size: 1.3rem; font-style: italic;
  color: var(--gold); margin: 0 auto 28px; max-width: 46ch; line-height: 1.4;
}

/* ---------------- Footer ---------------- */
.footer { background: var(--wood-dark); color: #cbbb9a; padding: 34px 0; }
.footer__inner { display: grid; gap: 14px; text-align: center; }
.footer__brand { font-family: var(--serif); font-size: 1.2rem; color: var(--parchment); margin: 0; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; }
.footer__nav a { color: #e2d3b3; text-decoration: none; font-size: .96rem; }
.footer__nav a:hover { color: #fff; text-decoration: underline; }
.footer__legal { margin: 0; font-size: .85rem; color: #a99a7c; max-width: 60ch; margin: 0 auto; }
.footer__credit { margin: 0; font-size: .8rem; color: #a99a7c; max-width: 60ch; margin: 0 auto; }
.footer__credit a { color: #e2d3b3; text-decoration: none; }
.footer__credit a:hover { color: #fff; text-decoration: underline; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; gap: 34px; padding: 48px 20px 56px; }
  .world { grid-template-columns: 1fr; gap: 28px; }
  .grid--features { grid-template-columns: repeat(2, 1fr); }
  .grid--resources { grid-template-columns: repeat(2, 1fr); }

  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--wood-dark); border-bottom: 3px solid var(--gold-deep);
    padding: 8px 12px 14px; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 10px; border-radius: 0; }
  .nav__cta { margin: 8px 0 0; text-align: center; }
}

@media (max-width: 520px) {
  .grid--features, .grid--resources { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .btn { width: 100%; text-align: center; }
  .hero__actions { flex-direction: column; }
}

/* ---------------- Reduced motion (design doc requirement) ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
