/* ============================================================
   CONTINENTS MUD — main.css
   WCAG 2.2 AA verified contrast ratios documented inline
   ============================================================ */

/* --- Variables -------------------------------------------- */
:root {
  --bg:           #0b0d15;
  --surface-1:    #111520;  /* nav, card backgrounds         */
  --surface-2:    #161c2c;  /* hover states, elevated areas  */
  --surface-3:    #1d2438;  /* code blocks, infoboxes        */
  --border:       #1e2840;
  --border-hi:    #2a3a58;

  --primary:      #4d9fff;  /* 7.9:1 on --bg ✓              */
  --primary-bg:   #0c244e;
  --green:        #2fc060;  /* 8.9:1 on --bg ✓              */
  --green-bg:     #0a2015;
  --yellow:       #f0b030;  /* 7.5:1 on --bg ✓              */
  --red:          #ff6060;  /* 5.6:1 on --bg ✓              */

  --text:         #c8d4e8;  /* 13.9:1 on --bg ✓             */
  --text-2:       #6a7a9a;  /* 5.1:1 on --bg ✓ (min 4.5:1) */
  --text-3:       #98a8c0;  /* 9.0:1 on --bg ✓              */
  --heading:      #e8f0ff;  /* 17.7:1 on --bg ✓             */

  --font-body:    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "Courier New", Courier, monospace;

  --container:    1100px;
  --r:            4px;
  --r-lg:         8px;
  --nav-h:        58px;
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

/* --- WCAG: Skip link -------------------------------------- */
.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--primary); color: #000;
  padding: .5rem 1rem; border-radius: var(--r);
  font-weight: 600; z-index: 9999; text-decoration: none;
  font-size: .9rem;
}
.skip-link:focus { top: .5rem; }

/* --- WCAG: Global focus indicator (3px, 3:1+ contrast) --- */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* --- Typography ------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--heading);
  line-height: 1.2;
  font-weight: 600;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p  { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a              { color: var(--primary); text-decoration: none; }
a:hover        { text-decoration: underline; }
strong, b      { color: var(--heading); font-weight: 600; }

ul, ol         { padding-left: 1.5rem; }
li             { margin-bottom: .3rem; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

pre, code { font-family: var(--font-mono); }

pre {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  color: var(--text-3);
  line-height: 1.55;
  white-space: pre-wrap;
  font-size: .875rem;
}

code {
  background: var(--surface-3);
  color: var(--green);
  padding: .1em .35em;
  border-radius: 3px;
  font-size: .9em;
}

/* --- Layout helpers --------------------------------------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page-wrap { padding: 3rem 0 5rem; }

/* --- Site header / nav ------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
  gap: 1.5rem;
}

/* Brand */
.site-brand a {
  display: flex; align-items: center; gap: .55rem;
  color: var(--heading); text-decoration: none;
  font-weight: 700; font-size: 1.05rem;
  letter-spacing: .025em; white-space: nowrap;
}
.site-brand a:hover { color: #fff; text-decoration: none; }
.brand-icon { color: var(--green); font-size: 1.25rem; line-height: 1; }

/* Nav list */
.main-nav {
  display: flex; align-items: center;
  list-style: none; gap: .15rem;
  padding: 0; margin: 0; flex: 1;
}

.main-nav a {
  display: block;
  padding: .45rem .7rem;
  color: var(--text-3);
  font-size: .875rem;
  border-radius: var(--r);
  white-space: nowrap;
  text-decoration: none;
}
.main-nav a:hover           { color: var(--heading); background: var(--surface-2); text-decoration: none; }
.main-nav a[aria-current]   { color: var(--primary); background: var(--primary-bg); }

/* Play Now special button */
.nav-play a {
  background: var(--green-bg) !important;
  color: var(--green) !important;
  border: 1px solid color-mix(in srgb, var(--green) 40%, transparent);
  font-weight: 600;
}
.nav-play a:hover { background: #0e2c1c !important; text-decoration: none; }

/* Hamburger */
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  width: 44px; height: 44px;
  background: none;
  border: 1px solid var(--border-hi);
  border-radius: var(--r);
  cursor: pointer;
  padding: 10px;
  margin-left: auto; flex-shrink: 0;
}
.nav-toggle span {
  display: block; height: 2px;
  background: var(--text-3); border-radius: 2px; width: 100%;
}
.nav-toggle:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* --- Hero ------------------------------------------------- */
.hero {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(24,50,110,.5) 0%, transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 5rem 0 4.5rem;
  text-align: center;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  color: #fff;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.1;
  margin-bottom: .75rem;
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-3);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-ctas {
  display: flex; justify-content: center;
  gap: 1rem; flex-wrap: wrap;
}

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem 1.75rem;
  border-radius: var(--r);
  font-family: inherit; font-size: 1rem; font-weight: 600;
  cursor: pointer; border: none;
  text-decoration: none;
  min-height: 44px; min-width: 44px;
  transition: background .12s;
}
.btn:hover        { text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

.btn-green        { background: var(--green); color: #000; }
.btn-green:hover  { background: #38d070; }

.btn-primary      { background: var(--primary); color: #000; }
.btn-primary:hover { background: #68adff; }

.btn-outline {
  background: transparent; color: var(--text-3);
  border: 1px solid var(--border-hi);
}
.btn-outline:hover { background: var(--surface-2); color: var(--heading); }

.btn-sm { padding: .4rem 1rem; font-size: .875rem; min-height: 36px; }

/* --- Page header (inner pages) ---------------------------- */
.page-header {
  padding: 2.25rem 0 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.page-header h1 { font-size: 2rem; margin-bottom: .4rem; }

.breadcrumb {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--text-2);
  list-style: none; padding: 0; margin-top: .4rem;
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb li + li::before { content: '›'; }

/* --- Cards ------------------------------------------------ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: flex; flex-direction: column;
}
.card:hover { border-color: var(--border-hi); }

.card-icon { font-size: 2rem; margin-bottom: .9rem; line-height: 1; }
.card h3   { font-size: 1.05rem; margin-bottom: .5rem; }
.card p    { color: var(--text-3); font-size: .9rem; flex: 1; }

.card-link {
  margin-top: 1.1rem;
  font-size: .875rem; font-weight: 600;
  color: var(--primary);
  display: inline-flex; align-items: center; gap: .3rem;
}
.card-link:hover { text-decoration: underline; }

/* Clickable card wrapper */
a.card-wrap {
  text-decoration: none; display: flex; flex-direction: column;
  border-radius: var(--r-lg);
}
a.card-wrap:hover        { text-decoration: none; }
a.card-wrap:hover .card  { border-color: var(--primary); }
a.card-wrap:focus-visible {
  outline: 3px solid var(--primary); outline-offset: 4px;
  border-radius: var(--r-lg);
}

/* --- Features section (home) ------------------------------ */
.features {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}
.features-header { text-align: center; margin-bottom: 2.5rem; }
.features-header h2 { font-size: 1.85rem; margin-bottom: .5rem; }
.features-header p  { color: var(--text-3); max-width: 480px; margin: 0 auto; }

/* --- Intro quote box ------------------------------------- */
.quote-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: var(--r-lg);
  padding: 2rem 2.25rem;
  margin: 3rem 0;
  font-family: var(--font-mono);
  font-size: .9rem;
  line-height: 1.75;
  color: var(--text-3);
}
.quote-box p { margin-bottom: .75rem; }

/* --- Section heading utility ------------------------------ */
.section-head { margin-bottom: 2rem; }
.section-head h2 { margin-bottom: .4rem; }
.section-head p  { color: var(--text-3); font-size: .95rem; }

/* --- Tables ----------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.data-table {
  width: 100%; border-collapse: collapse;
  font-size: .9rem;
}
.data-table th {
  background: var(--surface-2);
  color: var(--heading);
  padding: .6rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-hi);
  font-size: .78rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.data-table td {
  padding: .5rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td      { background: var(--surface-1); }

/* Skill table specifics */
.skill-table { font-family: var(--font-mono); }
.skill-level { color: var(--yellow); font-weight: 600; white-space: nowrap; }
.skill-name  { color: var(--green); }

/* Area list */
.lvl-badge {
  display: inline-block;
  font-family: var(--font-mono); font-size: .78rem;
  background: var(--surface-3); color: var(--text-3);
  padding: .15rem .5rem; border-radius: 3px;
  white-space: nowrap;
}
.lvl-badge-all { background: var(--green-bg); color: var(--green); }

/* --- Prose / content areas -------------------------------- */
.prose { max-width: 780px; }
.prose h2 { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.prose h3 { margin-top: 1.75rem; margin-bottom: .5rem; }

/* Callouts */
.callout {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-3);
  font-size: .925rem;
  line-height: 1.6;
}
.callout-green { border-left-color: var(--green); }
.callout-yellow { border-left-color: var(--yellow); }

/* Infoboxes */
.infobox {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

/* Creation guide command style */
.mud-prompt { color: var(--red); font-family: var(--font-mono); font-weight: 600; }
.mud-input  { color: var(--green); font-family: var(--font-mono); }
.mud-note   { color: var(--text-3); font-size: .9rem; margin-bottom: 1.25rem; }

/* QP table */
.qp-points { color: var(--yellow); font-family: var(--font-mono); font-weight: 600; text-align: right; white-space: nowrap; }
.qp-desc   { color: var(--heading); font-weight: 600; }
.qp-limit  { color: var(--text-3); font-size: .85rem; }

/* Clan commands table */
.cmd-name   { color: var(--green); font-family: var(--font-mono); font-weight: 600; }
.cmd-access { color: var(--text-2); font-size: .85rem; }

/* --- Socials list ----------------------------------------- */
.socials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .25rem;
  font-family: var(--font-mono);
  font-size: .875rem;
}
.social-cmd { color: var(--green); padding: .2rem 0; }

/* --- Map images ------------------------------------------- */
.map-block { margin-bottom: 2.5rem; }
.map-block h3 { margin-bottom: 1rem; }
.map-block img {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  max-width: 100%;
}

/* --- Forms (donate, admin) -------------------------------- */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; font-size: .875rem;
  font-weight: 600; color: var(--heading);
  margin-bottom: .4rem;
}
.form-control {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border-hi);
  border-radius: var(--r);
  padding: .6rem .875rem;
  color: var(--text);
  font-family: inherit; font-size: .95rem;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(77,159,255,.2);
}
textarea.form-control { min-height: 90px; resize: vertical; }

.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }

/* --- Footer ----------------------------------------------- */
.site-footer {
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 4rem;
  color: var(--text-2);
  font-size: .875rem;
}
.footer-inner {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 1.25rem;
}
.footer-brand { font-weight: 600; color: var(--text-3); }
.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a { color: var(--text-2); }
.footer-links a:hover { color: var(--text); }
.footer-telnet { font-family: var(--font-mono); font-size: .8rem; }
.footer-copy   { font-size: .78rem; color: var(--text-3); margin-top: .75rem; text-align: center; }

/* --- Admin bar -------------------------------------------- */
.admin-bar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: .6rem 0;
  font-size: .8rem;
  color: var(--text-2);
}
.admin-bar .container { display: flex; align-items: center; gap: 1rem; }
.admin-bar a { color: var(--text-2); }
.admin-bar a:hover { color: var(--primary); }

/* --- Responsive ------------------------------------------- */
@media (max-width: 900px) {
  h1 { font-size: 1.9rem; }
  .hero { padding: 3.5rem 0 3rem; }
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }

  .main-nav {
    display: none;
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--surface-1);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: .75rem;
    gap: .1rem;
    z-index: 199;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .main-nav.open { display: flex; }
  .main-nav a    { padding: .75rem 1rem; }

  .header-inner  { gap: .75rem; }
  .hero          { padding: 2.5rem 0 2.25rem; }
  .card-grid     { grid-template-columns: 1fr; }
  .footer-inner  { flex-direction: column; align-items: flex-start; }
  .form-row      { flex-direction: column; }
  .socials-grid  { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

@media (max-width: 480px) {
  .hero-ctas { flex-direction: column; align-items: center; }
  .btn       { width: 100%; justify-content: center; max-width: 280px; }
}
