/* ==========================================================
   TIME LORDS — styles
   ========================================================== */
:root {
  --bg: #05060f;
  --bg-2: #0a0d22;
  --panel: rgba(16, 21, 52, .62);
  --panel-solid: #10153a;
  --line: rgba(159, 183, 255, .16);
  --line-strong: rgba(159, 183, 255, .34);
  --text: #e6eaf5;
  --muted: #9aa3c0;
  --silver: #c9d1e6;
  --blue: #5b7cfa;
  --blue-2: #9fb7ff;
  --purple: #8b5cf6;
  --purple-2: #b794ff;
  --gold: #e8c46a;
  --radius: 16px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .7);
  --grad: linear-gradient(120deg, var(--silver), var(--blue-2) 40%, var(--purple-2));
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(139, 92, 246, .22), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(91, 124, 250, .18), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font-body);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue-2); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: .02em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

.container { width: min(1140px, 100% - 32px); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .85em 1.5em; border-radius: 999px;
  font-weight: 600; font-size: .98rem; letter-spacing: .01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(120deg, var(--blue), var(--purple));
  color: #fff;
  box-shadow: 0 10px 30px -8px rgba(124, 92, 246, .7), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover { color: #fff; box-shadow: 0 14px 40px -8px rgba(124, 92, 246, .9), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-ghost { border-color: var(--line-strong); color: var(--silver); background: rgba(255,255,255,.03); }
.btn-ghost:hover { border-color: var(--blue-2); color: #fff; }
.btn-small { padding: .55em 1.1em; font-size: .9rem; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px max(16px, calc((100% - 1140px) / 2));
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(5, 6, 15, .78); backdrop-filter: blur(14px); border-color: var(--line); }
.brand { display: flex; align-items: center; gap: .6em; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--silver); letter-spacing: .06em; }
.brand:hover { color: #fff; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a:not(.btn) { color: var(--muted); font-weight: 500; font-size: .95rem; position: relative; }
.nav-links a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--grad); transform: scaleX(0); transition: transform .25s; }
.nav-links a:not(.btn):hover { color: #fff; }
.nav-links a:not(.btn):hover::after { transform: scaleX(1); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--silver); margin: 5px 0; transition: transform .25s, opacity .25s; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; position: relative;
  display: grid; place-items: center; text-align: center;
  padding: 110px 16px 80px; overflow: hidden;
}
.hero-rings { position: absolute; width: min(880px, 140vw); aspect-ratio: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: .55; filter: drop-shadow(0 0 30px rgba(139, 92, 246, .35)); }
.ring { transform-origin: 300px 300px; }
.r1 { animation: spin 140s linear infinite; }
.r2 { animation: spin 90s linear infinite reverse; }
.r3 { animation: spin 60s linear infinite; }
.r4 { animation: spin 30s linear infinite reverse; }
.hands line { transform-origin: 300px 300px; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-content { position: relative; max-width: 820px; }
.eyebrow { text-transform: uppercase; letter-spacing: .28em; font-size: .78rem; color: var(--blue-2); font-weight: 600; margin-bottom: 1.2em; }
.hero h1 {
  font-size: clamp(3.2rem, 11vw, 7.5rem); font-weight: 900; margin: 0 0 .15em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 60px rgba(139, 92, 246, .25);
  letter-spacing: .04em;
}
.tagline { font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: var(--silver); margin-bottom: 2em; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.next-event {
  margin: 2.6em auto 0; display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4em 1em;
  padding: .8em 1.4em; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px);
  font-size: .92rem; color: var(--muted);
}
.next-event .label { text-transform: uppercase; letter-spacing: .18em; font-size: .7rem; color: var(--purple-2); font-weight: 600; }
.next-event strong { color: #fff; font-weight: 600; }
.countdown { font-variant-numeric: tabular-nums; color: var(--blue-2); font-weight: 600; }

.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--line-strong); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--blue-2); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 120px) 0; position: relative; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(16, 21, 58, .45) 15%, rgba(16, 21, 58, .45) 85%, transparent); }
.kicker { text-transform: uppercase; letter-spacing: .26em; font-size: .78rem; font-weight: 600; color: var(--purple-2); margin-bottom: .8em; display: flex; align-items: center; gap: .8em; }
.kicker::before { content: ""; width: 34px; height: 1px; background: var(--grad); }
.lead { color: var(--muted); max-width: 720px; font-size: 1.05rem; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- About ---------- */
.about-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; margin-bottom: 48px; }
.about-text p { font-size: 1.1rem; color: var(--silver); }
.about-text p:first-child::first-letter { font-family: var(--font-display); font-size: 3.2em; float: left; line-height: .9; margin: .06em .12em 0 0; color: var(--blue-2); }
.stats { display: grid; gap: 14px; }
.stat { padding: 20px 24px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); display: flex; align-items: baseline; gap: 16px; }
.stat strong { font-family: var(--font-display); font-size: 2.2rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; min-width: 3ch; }
.stat span { color: var(--muted); }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; position: relative; overflow: hidden; backdrop-filter: blur(8px);
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--grad); opacity: 0; transition: opacity .3s;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card:hover::before { opacity: .8; }
.icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(91, 124, 250, .25), rgba(139, 92, 246, .25)); border: 1px solid var(--line-strong); color: var(--blue-2); }
.icon svg { width: 26px; height: 26px; }
.card p { color: var(--muted); margin: 0; }

/* ---------- Recruitment ---------- */
.legend { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 26px; }
.pill { display: inline-block; padding: .25em .8em; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .04em; border: 1px solid; }
.p-high { color: #86efac; border-color: rgba(134, 239, 172, .4); background: rgba(134, 239, 172, .08); }
.p-medium { color: var(--blue-2); border-color: rgba(159, 183, 255, .4); background: rgba(159, 183, 255, .08); }
.p-low { color: var(--silver); border-color: rgba(201, 209, 230, .3); background: rgba(201, 209, 230, .05); }
.p-closed { color: #8a8fa5; border-color: rgba(138, 143, 165, .25); background: transparent; }

.recruit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.class-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--cc, var(--blue)); transition: transform .2s, background .2s;
}
.class-card:hover { transform: translateY(-2px); background: rgba(22, 28, 70, .75); }
.class-card.closed { opacity: .45; }
.class-dot { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #0b0d1c;
  background: var(--cc); box-shadow: 0 0 18px -4px var(--cc); }
.class-info { flex: 1; min-width: 0; }
.class-name { font-weight: 600; color: var(--cc); }
.class-roles { font-size: .82rem; color: var(--muted); }

.cta-band {
  margin-top: 48px; padding: clamp(24px, 4vw, 40px); border-radius: 20px;
  display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(120deg, rgba(91, 124, 250, .18), rgba(139, 92, 246, .22));
  border: 1px solid var(--line-strong);
}
.cta-band h3 { font-size: 1.6rem; margin-bottom: .25em; }
.cta-band p { color: var(--silver); margin: 0; }

/* ---------- Events ---------- */
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-top: 30px; }
.event { display: flex; flex-direction: column; gap: 10px; }
.event-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.event-day { font-family: var(--font-display); font-size: 1.05rem; color: var(--silver); letter-spacing: .08em; text-transform: uppercase; }
.tag { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: .25em .7em; border-radius: 6px; background: rgba(139, 92, 246, .18); color: var(--purple-2); }
.tag.Raid { background: rgba(232, 196, 106, .14); color: var(--gold); }
.tag.Dungeon { background: rgba(91, 124, 250, .2); color: var(--blue-2); }
.tag.Social { background: rgba(139, 92, 246, .2); color: var(--purple-2); }
.tag.PvP { background: rgba(244, 114, 114, .16); color: #fca5a5; }
.event h3 { margin: 0; font-size: 1.2rem; }
.event-time { font-size: 1.5rem; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.event-time small { font-size: .85rem; color: var(--muted); font-weight: 500; margin-left: .3em; }
.event-next { font-size: .82rem; color: var(--blue-2); }
.event-time small.block { display: block; margin: 2px 0 0; }
.event-time .tbd { font-size: 1.15rem; color: var(--silver); }
.event-loc { display: flex; align-items: center; gap: .45em; color: var(--blue-2); font-size: .92rem; font-weight: 500; }
.event-loc svg { width: 16px; height: 16px; }
.event.featured { grid-column: 1 / -1; background: linear-gradient(120deg, rgba(91, 124, 250, .2), rgba(139, 92, 246, .26)); border-color: var(--line-strong); }
.event.featured h3 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.event.featured p { max-width: 640px; color: var(--silver); }
.tag.Meetup { background: rgba(232, 196, 106, .16); color: var(--gold); }
.p-open { color: #86efac; border-color: rgba(134, 239, 172, .4); background: rgba(134, 239, 172, .08); }

/* ---------- News ---------- */
.news { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 30px; }
.news-item.latest { grid-row: span 2; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(140deg, rgba(91, 124, 250, .2), rgba(139, 92, 246, .24)); border-color: var(--line-strong); }
.news-item.latest h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
.news-item.latest p { color: var(--silver); font-size: 1.05rem; }
.news-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: .85rem; color: var(--muted); }
.news-item h3 { margin-bottom: .4em; }
.news-more { margin-top: 24px; }
.tag.Guild { background: rgba(159, 183, 255, .16); color: var(--blue-2); }
.tag.Event { background: rgba(232, 196, 106, .14); color: var(--gold); }
.tag.Goal { background: rgba(134, 239, 172, .12); color: #86efac; }

/* ---------- Governance ---------- */
.governance { margin: -24px 0 64px; padding: clamp(24px, 4vw, 40px); border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.governance h3 { font-size: 1.6rem; }
.gov-steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: none; position: relative; }
.gov-step { position: relative; padding: 22px; border-radius: 14px; background: rgba(5, 6, 15, .45); border: 1px solid var(--line); }
.gov-step:not(:last-child)::after { content: ""; position: absolute; top: 40px; right: -20px; width: 20px; height: 2px; background: var(--grad); }
.gov-num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; margin-bottom: 14px;
  font-family: var(--font-display); font-weight: 700; color: #fff; background: linear-gradient(120deg, var(--blue), var(--purple)); box-shadow: 0 0 20px -4px rgba(139, 92, 246, .8); }
.gov-step h4 { margin: 0 0 .4em; font-family: var(--font-display); font-size: 1.1rem; color: var(--silver); }
.gov-step p { margin: 0; color: var(--muted); }
@media (max-width: 900px) {
  .gov-steps { grid-template-columns: 1fr; }
  .gov-step:not(:last-child)::after { top: auto; bottom: -20px; right: auto; left: 39px; width: 2px; height: 20px; }
}

/* ---------- Community ---------- */
.community { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 30px; max-width: 420px; }
.community.both { grid-template-columns: 350px 1fr; max-width: none; }
.discord-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong); background: var(--panel-solid); box-shadow: var(--shadow); }
.discord-frame iframe { display: block; width: 100%; height: 520px; border: 0; }

/* ---------- Goals ---------- */
.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 30px; }
.goal { display: flex; flex-direction: column; }
.goal p { flex: 1; margin-bottom: 20px; }
.bar { height: 10px; border-radius: 999px; background: rgba(5, 6, 15, .7); border: 1px solid var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--purple), var(--gold)); box-shadow: 0 0 16px rgba(139, 92, 246, .6); transition: width 1.2s ease; }
.bar.indeterminate span { background: linear-gradient(90deg, transparent, rgba(139, 92, 246, .8), rgba(232, 196, 106, .8), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: shimmer 2.4s ease-in-out infinite; box-shadow: none; }
@keyframes shimmer { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.goal-status { display: flex; justify-content: space-between; margin-top: 10px; font-size: .88rem; color: var(--muted); }
.goal-status strong { color: var(--gold); }
.goal.done .goal-status span { color: #86efac; font-weight: 600; }

/* ---------- Roster ---------- */
.officers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 28px 0 64px; }
.officer .rank + h3 { margin-bottom: .6em; }
[hidden] { display: none !important; }
.officer { text-align: center; padding-top: 34px; }
.avatar { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: var(--cc);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.08), rgba(5, 6, 15, .9));
  border: 2px solid var(--cc); box-shadow: 0 0 0 6px rgba(255,255,255,.02), 0 0 30px -6px var(--cc); }
.officer .rank { font-size: .74rem; text-transform: uppercase; letter-spacing: .2em; color: var(--purple-2); font-weight: 600; }
.officer h3 { margin: .3em 0 .1em; }
.officer .meta { font-size: .88rem; color: var(--cc); margin-bottom: .8em; }

.roster-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.roster-head h3 { font-size: 1.6rem; margin: 0; }
.roster-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.roster-tools input {
  background: rgba(5, 6, 15, .6); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 999px; padding: .6em 1.1em; font: inherit; font-size: .92rem; width: 230px; max-width: 100%;
}
.roster-tools input:focus { outline: none; border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(91, 124, 250, .25); }
.role-filter { display: flex; gap: 6px; }
.chip { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); border-radius: 999px; padding: .45em .95em; font: inherit; font-size: .85rem; cursor: pointer; transition: all .2s; }
.chip:hover { color: #fff; border-color: var(--blue-2); }
.chip.active { background: linear-gradient(120deg, var(--blue), var(--purple)); color: #fff; border-color: transparent; }

.table-wrap { border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); overflow-x: auto; }
.roster-table { width: 100%; border-collapse: collapse; min-width: 480px; }
.roster-table th, .roster-table td { text-align: left; padding: 14px 20px; }
.roster-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.roster-table tbody tr { border-bottom: 1px solid rgba(159, 183, 255, .07); transition: background .2s; }
.roster-table tbody tr:last-child { border-bottom: 0; }
.roster-table tbody tr:hover { background: rgba(91, 124, 250, .07); }
.roster-table .nm { font-weight: 600; color: var(--cc); }
.empty { padding: 24px; text-align: center; color: var(--muted); margin: 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0; background: rgba(5, 6, 15, .7); }
.footer-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.footer p { margin: 0; color: var(--muted); font-size: .9rem; }
.footer .fine { font-size: .76rem; opacity: .7; max-width: 640px; margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-layout { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat { flex-direction: column; gap: 2px; padding: 16px; }
  .stat strong { font-size: 1.8rem; }
  .pillars { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .news { grid-template-columns: 1fr; }
  .news-item.latest { grid-row: auto; }
  .community.both { grid-template-columns: 1fr; }
  .discord-frame iframe { height: 460px; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 64px; left: 12px; right: 12px; flex-direction: column; gap: 4px; align-items: stretch;
    background: rgba(10, 13, 34, .97); border: 1px solid var(--line); border-radius: 16px; padding: 12px;
    opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity .25s, transform .25s;
  }
  .nav-links a:not(.btn) { padding: 12px 14px; border-radius: 10px; }
  .nav-links a:not(.btn)::after { display: none; }
  .nav-links a:not(.btn):hover { background: rgba(91, 124, 250, .1); }
  .nav-links .btn { justify-content: center; margin-top: 6px; }
  .nav.open .nav-links { opacity: 1; pointer-events: auto; transform: none; }
  .nav.open { background: rgba(5, 6, 15, .9); backdrop-filter: blur(14px); }
  .nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .stats { grid-template-columns: 1fr; }
  .stat { flex-direction: row; align-items: baseline; gap: 14px; }
  .roster-tools { width: 100%; }
  .roster-tools input { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
