/* ============================================================
   The Mighty OZ — Omicron Zeta Chapter · Design System
   Ported from the Seventh District / oppf7d.org token system
   (same Omega Psi Phi Royal Purple + Old Gold brand). Tokens
   first, then base elements, then components.
   ============================================================ */

:root {
  color-scheme: light;

  /* Brand — Royal Purple */
  --p-900:#1E0843; --p-800:#2C0E55; --p-700:#3A1470; --p-600:#4B1A87;
  --p-500:#5E2AA5; --p-400:#8557C4; --p-300:#B699DB; --p-200:#D9C9EC;
  --p-100:#EDE4F6; --p-50:#F6F1FB;

  /* Brand — Old Gold */
  --g-900:#6B5516; --g-800:#8B6E1D; --g-700:#A78623; --g-600:#C9A437;
  --g-500:#D9B95A; --g-400:#E5CB82; --g-300:#EEDCA9; --g-200:#F4E8C6;
  --g-100:#F9F1DC; --g-50:#FCF8ED;

  /* Neutrals */
  --ink-900:#0F0D14; --ink-800:#1F1B27; --ink-700:#3B3543; --ink-600:#55505D;
  --ink-500:#6F6A77; --ink-400:#8F8B96; --ink-300:#B4B0BA; --ink-200:#D8D5DD;
  --ink-100:#EAE8EE; --ink-50:#F5F4F7;
  --canvas:#FBF9F4; --paper:#FFFFFF;

  /* Feedback — the only red on the site, reserved for a write that did not happen */
  --err-700:#8C1D18; --err-100:#F4CFCC; --err-50:#FCEEED;

  --shadow-1: 0 1px 2px rgba(15,13,20,.05);
  --shadow-2: 0 6px 16px rgba(15,13,20,.07);
  --shadow-3: 0 18px 40px rgba(15,13,20,.10);
  --shadow-4: 0 30px 60px rgba(30,8,67,.18);

  --r-sm:4px; --r-md:8px; --r-lg:14px; --r-xl:22px; --r-full:9999px;

  --ease: cubic-bezier(.16,1,.3,1);
  --dur-1:150ms; --dur-2:260ms; --dur-3:420ms;

  --container: 1180px;
  --container-wide: 1440px;

  --section-y-xs: 48px;
  --section-y-sm: 72px;
  --section-y-md: 96px;
  --section-y-lg: 128px;

  --focus-ring: 0 0 0 2px var(--canvas), 0 0 0 4px var(--p-500);
  --focus-ring-dark: 0 0 0 2px var(--p-900), 0 0 0 4px var(--g-400);

  /* Typographic voice — deliberately distinct from other Omega chapter sites.
     Fraunces (a warm, high-character old-style serif) for display; Manrope
     (modern geometric sans) for body/UI. */
  --font-display: "Fraunces", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..900;1,9..144,400..800&family=Manrope:wght@400;500;600;700;800&display=swap');

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-800);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--p-600); text-decoration: none; transition: color var(--dur-1) var(--ease); }
a:hover { color: var(--p-500); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  color: var(--ink-900);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p { margin: 0 0 1.1em; }

::selection { background: var(--p-500); color: #fff; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.eyebrow {
  font-family: var(--font-body); font-weight: 700; font-size: .78rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--g-700);
  margin: 0 0 .8rem;
}
.lede { font-size: 1.15rem; color: var(--ink-700); max-width: 68ch; }
.center { text-align: center; }
.center .lede { margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: .8rem 1.5rem; border-radius: var(--r-full); border: 1.5px solid transparent;
  cursor: pointer; transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--p-600); color: #fff; box-shadow: var(--shadow-2); }
.btn-primary:hover { background: var(--p-500); color: #fff; box-shadow: var(--shadow-3); }
.btn-gold { background: var(--g-600); color: var(--p-900); box-shadow: var(--shadow-2); }
.btn-gold:hover { background: var(--g-500); color: var(--p-900); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-outline { background: transparent; color: var(--p-600); border-color: var(--p-300); }
.btn-outline:hover { background: var(--p-50); color: var(--p-600); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251,249,244,.88); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--ink-100);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; font-family: var(--font-display); font-weight: 800; color: var(--p-800); font-size: 1.15rem; letter-spacing: -.01em; }
.brand:hover { color: var(--p-800); }
.brand .mark {
  flex: none; width: 42px; height: 42px; border-radius: var(--r-full); overflow: hidden;
  background: var(--paper); box-shadow: var(--shadow-2); border: 1px solid rgba(0,0,0,.06);
}
.brand .mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-links { display: flex; align-items: center; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-block; padding: .5rem .8rem; border-radius: var(--r-md);
  color: var(--ink-700); font-weight: 500; font-size: .93rem;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.nav-links a:hover { background: var(--p-50); color: var(--p-700); }
.nav-links a.active { color: var(--p-700); background: var(--p-100); }
.nav-cta { display: flex; align-items: center; gap: .6rem; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; color: var(--ink-800); }
/* The "OZ Members Only" CTA lives in the header on desktop and moves into the
   collapsible menu on mobile (see the 720px breakpoint), so it never crowds the
   hamburger. */
.nav-mobile-only { display: none; }

/* ---------- Page sections ---------- */
.page { display: none; }
.page.active { display: block; animation: fade var(--dur-2) var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section { padding-block: var(--section-y-md); }
.section-tight { padding-block: var(--section-y-sm); }
.section-alt { background: var(--p-50); }
.section-ink { background: var(--p-900); color: var(--ink-100); }
.section-ink h1, .section-ink h2, .section-ink h3 { color: #fff; }
.section-ink .lede { color: var(--p-200); }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(201,164,55,.25), transparent 60%),
    linear-gradient(160deg, var(--p-900) 0%, var(--p-700) 55%, var(--p-600) 100%);
}
.hero .container { position: relative; z-index: 2; padding-block: clamp(80px, 12vw, 150px); }
.hero .eyebrow { color: var(--g-400); }
.hero h1 { color: #fff; max-width: 16ch; }
.hero .lede { color: var(--p-100); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero-crest {
  position: absolute; right: -60px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-display); font-weight: 800; font-size: clamp(180px, 26vw, 380px);
  color: rgba(255,255,255,.05); line-height: 1; z-index: 1; pointer-events: none; user-select: none;
}

/* ---------- Cards ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--r-lg);
  padding: 1.6rem; box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); border-color: var(--p-200); }
.card h3 { margin-bottom: .35rem; }
.card p { color: var(--ink-600); font-size: .96rem; margin-bottom: .9rem; }
.card .card-link { font-weight: 600; font-size: .9rem; }
.card-media { aspect-ratio: 16/10; border-radius: var(--r-md); overflow: hidden; margin-bottom: 1.1rem; background: var(--p-100); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }

/* Cardinal-principle chips */
.principles { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }
.principle {
  display: inline-flex; align-items: center; gap: .55rem; padding: .55rem 1.1rem;
  border-radius: var(--r-full); background: rgba(255,255,255,.08); border: 1px solid rgba(229,203,130,.4);
  color: #fff; font-weight: 600; font-size: .95rem;
}
.principle .dot { width: 7px; height: 7px; border-radius: var(--r-full); background: var(--g-400); }

/* ---------- Prose (long-form pages) ---------- */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.6rem; color: var(--p-700); }
.prose p, .prose li { color: var(--ink-700); }
.prose blockquote {
  margin: 1.6rem 0; padding: 1rem 1.4rem; border-left: 4px solid var(--g-500);
  background: var(--g-50); border-radius: 0 var(--r-md) var(--r-md) 0; font-style: italic; color: var(--ink-700);
}
.roster { columns: 2; column-gap: 2.5rem; padding-left: 1.1rem; }
.roster li { break-inside: avoid; margin-bottom: .3rem; }

/* ---------- Lineage timeline ---------- */
.lineage { margin-top: 1.5rem; }
.lineage-decade { margin-bottom: 2.2rem; }
.decade-label {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--p-700);
}
.decade-label::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--g-500), transparent); border-radius: var(--r-full); }
.lineage-lines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .55rem; }
.lineage-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: .8rem;
  padding: .7rem .95rem; background: var(--paper); border: 1px solid var(--ink-100);
  border-left: 3px solid var(--p-300); border-radius: var(--r-md);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.lineage-line:hover { border-left-color: var(--g-500); box-shadow: var(--shadow-1); }
.lineage-line .name { font-weight: 600; color: var(--ink-800); font-size: .95rem; }
.lineage-line .season { flex: none; font-size: .78rem; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.lineage-line.charter { border-left-color: var(--g-600); background: var(--g-50); }
.lineage-line.has-roster { cursor: pointer; }
.lineage-line.has-roster .name::after { content: "›"; margin-left: .45rem; color: var(--ink-300); font-weight: 700; }
.lineage-line.has-roster[aria-expanded="true"] { border-left-color: var(--g-600); box-shadow: var(--shadow-1); }
.lineage-line.has-roster[aria-expanded="true"] .name::after { color: var(--g-600); }
#lineage-roster { margin: .5rem 0 2.2rem; max-width: 440px; }

/* ---------- Awards list ---------- */
.award-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.award-list li {
  display: flex; gap: .9rem; align-items: flex-start; padding: .9rem 1.1rem;
  background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--r-md);
}
.award-list li::before { content: "★"; color: var(--g-600); font-size: 1rem; line-height: 1.5; }

/* ---------- Anniversary mark ---------- */
.anniversary-mark {
  width: clamp(220px, 32vw, 300px); height: auto; margin: 0 auto 1.6rem;
  filter: drop-shadow(0 12px 28px rgba(30,8,67,.14));
}

/* ---------- Honors (individual achievements) ---------- */
.honor-group { margin-bottom: 2rem; }
.honor-group > h3 {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem;
  font-size: 1.2rem; color: var(--p-700);
}
.honor-group > h3::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--g-500), transparent); border-radius: var(--r-full); }
.honor-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.honor-list li {
  padding: .75rem 1rem; background: var(--paper); border: 1px solid var(--ink-100);
  border-left: 3px solid var(--p-300); border-radius: var(--r-md);
}
.honor-list .honor-name { font-weight: 600; color: var(--ink-900); display: block; font-size: .95rem; }
.honor-list .honor-people { color: var(--ink-600); font-size: .9rem; }
.honor-note { font-size: .82rem; color: var(--ink-500); margin-top: .6rem; }

/* Gallery styles live in the "Public/members galleries" section below (album
   cards -> detail -> lightbox). */

/* ---------- Contact / login forms ---------- */
.form-card { max-width: 460px; margin-inline: auto; background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--r-lg); padding: 2rem; box-shadow: var(--shadow-2); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; color: var(--ink-700); }
.field input, .field textarea {
  width: 100%; padding: .75rem .9rem; font: inherit; color: var(--ink-900);
  border: 1.5px solid var(--ink-200); border-radius: var(--r-md); background: var(--canvas);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--p-400); box-shadow: 0 0 0 3px var(--p-100); }
.note { font-size: .85rem; color: var(--ink-500); }

/* Members-only callout on the login page */
.gate-note {
  display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1.2rem; margin-top: 1.2rem;
  background: var(--p-50); border: 1px solid var(--p-200); border-radius: var(--r-md); font-size: .9rem; color: var(--ink-700);
}
.gate-note .badge { flex: none; width: 30px; height: 30px; border-radius: var(--r-full); overflow: hidden; background: var(--paper); border: 1px solid var(--ink-100); }
.gate-note .badge img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Sign-in error message */
.login-error {
  margin: -.2rem 0 1rem; padding: .7rem .9rem; font-size: .88rem; color: #8A1C1C;
  background: #FCF0F0; border: 1px solid #F0C9C9; border-radius: var(--r-md);
}

/* Signed-in members area */
.member-area { max-width: var(--container); margin-inline: auto; }
.member-welcome { text-align: left; max-width: none; }
.member-welcome .eyebrow { color: var(--p-500); }
.member-welcome h2 { margin: .2rem 0 .6rem; }
.member-welcome #member-name { color: var(--p-600); }
.member-welcome .btn { margin-top: 1.2rem; }

/* Tabs */
.member-tabs { display: flex; gap: .4rem; margin: 2rem 0 1.4rem; border-bottom: 2px solid var(--ink-100); }
.member-tab {
  appearance: none; background: none; border: none; cursor: pointer; font: inherit; font-weight: 600;
  color: var(--ink-500); padding: .7rem 1.1rem; margin-bottom: -2px;
  border-bottom: 2px solid transparent; transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.member-tab:hover { color: var(--ink-800); }
.member-tab.active { color: var(--p-600); border-bottom-color: var(--g-600); }

/* Profile form */
.profile-form fieldset { border: 1px solid var(--ink-100); border-radius: var(--r-lg); padding: 1.4rem 1.6rem 1.6rem; margin-bottom: 1.4rem; background: var(--paper); }
.profile-form legend { font-family: var(--font-body); font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--p-500); padding: 0 .5rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .2rem 1.2rem; }
.profile-form .field { margin-bottom: .9rem; }
.profile-form select {
  width: 100%; padding: .75rem .9rem; font: inherit; color: var(--ink-900);
  border: 1.5px solid var(--ink-200); border-radius: var(--r-md); background: var(--canvas);
}
.profile-form select:focus { outline: none; border-color: var(--p-400); box-shadow: 0 0 0 3px var(--p-100); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--ink-700); margin-top: .4rem; cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; margin-top: .15rem; flex: none; accent-color: var(--p-500); }
.profile-actions { display: flex; align-items: center; gap: 1rem; }
.profile-status { font-size: .9rem; color: var(--p-600); font-weight: 600; }
.profile-status.is-error { color: #8A1C1C; }

/* Directory */
.dir-search { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; }
.dir-search input { flex: 1 1 16rem; min-width: 12rem; padding: .6rem .9rem; border: 1.5px solid var(--ink-200); border-radius: var(--r-md); background: var(--canvas); font: inherit; }
.dir-search input:focus { outline: none; box-shadow: var(--focus-ring); border-color: var(--p-500); }
.dir-count { font-size: .8rem; color: var(--ink-500); white-space: nowrap; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; margin-top: 1rem; }
.dir-card { text-align: left; }
.dir-card h3 { margin-bottom: .1rem; }
.dir-cross { font-size: .85rem; color: var(--g-700); font-weight: 600; margin-bottom: .7rem; }
.dir-meta { font-size: .85rem; color: var(--ink-700); margin: .15rem 0; }
.dir-meta span { display: inline-block; min-width: 4rem; padding-right: .6rem; color: var(--ink-400); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; vertical-align: baseline; }
.dir-bio { font-size: .88rem; color: var(--ink-600); margin: .7rem 0 .4rem; }

/* ---------- Brotherhood maps (real jsVectorMap choropleths, purple + gold) ---------- */
.hm-block { margin-top: 2.75rem; }
.hm-block > h3 { margin-bottom: .3rem; }
.hm-toggle { display: inline-flex; gap: .3rem; background: var(--ink-100); border-radius: var(--r-full); padding: .25rem; margin: .9rem 0 1.2rem; }
.hm-tab { border: none; background: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--ink-600); padding: .4rem .95rem; border-radius: var(--r-full); cursor: pointer; }
.hm-tab.active { background: var(--paper); color: var(--p-800); box-shadow: var(--shadow-1); }
.hm-cap { margin-top: .85rem; font-size: .85rem; }

/* Map viewport — jsVectorMap fits its SVG into this sized, transparent box. */
.jvm-map { position: relative; width: 100%; margin: 0 auto; }
.jvm-map--us { max-width: 720px; height: 420px; }
.jvm-map--world { max-width: 900px; height: 460px; }
.jvm-map .jvm-container { background: transparent !important; }
.jvm-map .jvm-region { transition: fill var(--dur-1) var(--ease); }
.jvm-map .jvm-region[fill="#C9A437"] { stroke: var(--p-800); stroke-width: 0.9; } /* selected pops in gold */

/* Purple/gold tooltip to match the OZ identity (overrides the vendored default). */
.jvm-tooltip {
  background: var(--p-800); color: var(--g-200);
  border: 1px solid var(--g-600); border-radius: var(--r-sm);
  padding: .45rem .7rem; box-shadow: var(--shadow-2);
  font: 600 .82rem/1.3 var(--sans, inherit); max-width: 16rem;
}
.jvm-tt-name { display: block; font-weight: 800; color: #fff; }
.jvm-tt-n { display: block; font-size: .78em; font-weight: 700; color: var(--g-300); margin-top: .1rem; }

/* Zoom controls (world map — drill into small regions like the Caribbean). */
.jvm-map .jvm-zoom-btn {
  background: var(--p-700); color: var(--g-200);
  border-radius: var(--r-sm); width: 1.7rem; height: 1.7rem;
  line-height: 1.6rem; font-weight: 800; box-shadow: var(--shadow-1);
}
.jvm-map .jvm-zoom-btn:hover { background: var(--g-600); color: var(--p-900); }
.jvm-map .jvm-zoomin { top: .6rem; }
.jvm-map .jvm-zoomout { top: 2.6rem; }

/* Island points: the small islands the world map has no path to shade
   (Turks and Caicos, Barbados, St. Lucia...) are plotted as dots instead. */
.jvm-map .jvm-marker { transition: fill var(--dur-1) var(--ease); }

/* Members directory map (colocated above the search) */
.dir-map { margin: 1rem 0 .3rem; }
.dir-map .jvm-map { max-width: 620px; height: 380px; }
.dir-filters { margin-bottom: 1rem; }
.dir-statechip { border: 1px solid var(--p-300); background: var(--p-50); color: var(--p-700); font: inherit; font-size: .8rem; font-weight: 600; padding: .3rem .75rem; border-radius: var(--r-full); cursor: pointer; }
.dir-statechip:hover { background: var(--p-100); }
@media (max-width: 620px) {
  .jvm-map--us, .jvm-map--world { height: 300px; }
  .dir-map .jvm-map { height: 280px; }
}

/* Lines (roster card — shared by the OZ History lineage expand) */
.line-card { text-align: left; }
.line-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.line-head h3 { margin: 0; }
.line-term { flex: none; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-400); }
.line-roster { list-style: none; margin: 0; padding: 0; }
.line-roster li { display: flex; align-items: baseline; gap: .55rem; padding: .28rem 0; border-top: 1px solid var(--ink-100); }
.line-roster li:first-child { border-top: 0; }
.line-num { flex: none; width: 1.4rem; text-align: right; font-size: .8rem; font-weight: 700; color: var(--g-700); font-variant-numeric: tabular-nums; }
.line-name { flex: 1 1 auto; font-size: .9rem; color: var(--ink-800); }
.line-omega { font-size: .82rem; line-height: 1; }

/* ---------- Gallery sets ---------- */

/* ---------- Partner / donate band ---------- */
.band {
  background:
    radial-gradient(800px 400px at 20% 120%, rgba(201,164,55,.22), transparent 60%),
    linear-gradient(120deg, var(--p-800), var(--p-600));
  color: #fff; border-radius: var(--r-xl); padding: clamp(2rem, 5vw, 3.5rem); text-align: center; box-shadow: var(--shadow-4);
}
.band h2 { color: #fff; }
.band p { color: var(--p-100); max-width: 60ch; margin-inline: auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--p-900); color: var(--p-200); padding-block: 3rem 2rem; margin-top: var(--section-y-md); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .9rem; }
.site-footer a { color: var(--p-200); font-size: .92rem; display: block; padding: .2rem 0; }
.site-footer a:hover { color: var(--g-400); }
.footer-brand p { color: var(--p-300); font-size: .92rem; max-width: 38ch; }
.footer-brand .social { display: flex; gap: .6rem; margin-top: 1.2rem; }
.footer-brand .social a {
  width: 36px; height: 36px; padding: 0; border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,.16); color: var(--p-200);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.footer-brand .social a:hover { background: var(--g-600); border-color: var(--g-600); color: var(--p-900); }

/* Admin management */
.adm-list { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0 1.4rem; }
.adm-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .6rem .8rem; background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--r-md); }
.adm-id { display: flex; align-items: center; gap: .5rem; min-width: 9rem; }
.adm-cn { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-800); font-size: .9rem; }
.adm-badge { font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; padding: .12rem .45rem; border-radius: var(--r-full); background: var(--g-100); color: var(--g-800); }
.adm-badge.adm-you { background: var(--p-100); color: var(--p-700); }
.adm-name { flex: 1 1 8rem; min-width: 7rem; }
.adm-role { flex: none; }
.adm-remove { flex: none; padding: .35rem .75rem; font-size: .8rem; }
.adm-add { margin-top: 1rem; padding-top: 1.2rem; border-top: 1px solid var(--ink-100); }
.adm-add h4 { margin-bottom: .7rem; }
.adm-add-fields { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.adm-add-fields input { flex: 1 1 8rem; min-width: 7rem; }
.adm-status { margin-top: .7rem; color: var(--p-700); }

/* ---------- Admin: galleries ---------- */
.admin-section { margin-bottom: 2rem; }
.admin-section > h3 { margin-bottom: .8rem; }
.gal-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.gal-row { display: flex; align-items: center; justify-content: space-between; gap: .7rem; flex-wrap: wrap; padding: .6rem .8rem; background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--r-md); }
.gal-meta { display: flex; flex-direction: column; gap: .3rem; }
.gal-title { font-weight: 700; color: var(--ink-800); }
.gal-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.gal-badge { font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; padding: .12rem .45rem; border-radius: var(--r-full); background: var(--ink-100); color: var(--ink-600); }
.gal-badge.gal-pub { background: var(--g-100); color: var(--g-800); }
.gal-badge.gal-draft { background: var(--p-100); color: var(--p-700); }
.gal-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.gal-actions .btn { padding: .35rem .75rem; font-size: .8rem; }
.gal-form { margin-top: 1rem; padding: 1.2rem; background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--r-md); display: flex; flex-direction: column; gap: .7rem; }
.gal-form input, .gal-form textarea, .gal-form select { width: 100%; }
.gf-selects { display: flex; gap: 1rem; flex-wrap: wrap; }
.gf-selects label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; font-weight: 600; color: var(--ink-600); }
.gf-actions { display: flex; gap: .5rem; }
.gf-status { color: var(--p-700); }
/* Photo manager */
.gal-photos-mgr { margin-top: 1rem; padding: 1.2rem; background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--r-md); }
.gpm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.gpm-add { display: inline-flex; cursor: pointer; margin-bottom: 1rem; }
.gpm-progress { color: var(--p-700); margin-bottom: .8rem; }
.gpm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.gpm-item { margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.gpm-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r-md); background: var(--p-100); }
.gpm-caption { font-size: .82rem; }
.gpm-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.gpm-cover, .gpm-del { padding: .3rem .6rem; font-size: .78rem; }
.gpm-cover-flag { font-size: .7rem; font-weight: 700; color: var(--g-800); background: var(--g-100); padding: .28rem .6rem; border-radius: var(--r-full); letter-spacing: .04em; }

/* ---------- Public/members galleries: album cards -> detail -> lightbox ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.4rem; }
.gallery-card {
  position: relative; text-align: left; padding: 0; cursor: pointer;
  background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--r-lg);
  overflow: hidden; font: inherit; color: inherit;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.gallery-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -22px rgba(30,8,67,.32); border-color: var(--p-300); }
.gallery-card__cover { position: relative; aspect-ratio: 4/3; background: linear-gradient(135deg, var(--p-700), var(--p-900)); overflow: hidden; }
.gallery-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.gallery-card:hover .gallery-card__cover img { transform: scale(1.05); }
.gallery-card__cover-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: rgba(217,185,90,.6); font-family: var(--font-display); font-size: 3rem; font-weight: 800; letter-spacing: .05em; }
.gallery-card__count { position: absolute; bottom: 10px; right: 10px; background: rgba(15,13,20,.8); color: var(--g-400); padding: .25rem .6rem; border-radius: var(--r-full); font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.gallery-card__body { padding: 1rem 1.15rem 1.15rem; }
.gallery-card__title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--p-900); margin: 0 0 .2rem; line-height: 1.3; }
.gallery-card__date { font-size: .85rem; color: var(--ink-500); margin: 0; }

.gallery-detail__back { background: none; border: none; color: var(--p-700); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 1.1rem; transition: color var(--dur-1) var(--ease); }
.gallery-detail__back:hover { color: var(--p-900); }
.gallery-detail__head { margin-bottom: 1.6rem; }
.gallery-detail__head h2 { font-family: var(--font-display); color: var(--p-900); margin-bottom: .3rem; }
.gallery-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.gallery-photo { position: relative; aspect-ratio: 1/1; padding: 0; border: none; background: var(--canvas); border-radius: var(--r-md); overflow: hidden; cursor: zoom-in; transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.gallery-photo:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(30,8,67,.32); }
.gallery-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.gallery-photo:hover img { transform: scale(1.05); }

/* Full-screen photo lightbox */
.photo-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(15,13,20,.94); display: flex; align-items: center; justify-content: center; padding: 1.5rem; animation: photo-lb-fade 200ms var(--ease); }
.photo-lightbox[hidden] { display: none; }
@keyframes photo-lb-fade { from { opacity: 0; } to { opacity: 1; } }
.photo-lightbox__inner { width: 100%; max-width: 1200px; max-height: 90vh; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.photo-lightbox__inner img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: var(--r-sm); box-shadow: 0 30px 80px -20px rgba(0,0,0,.55); }
.photo-lightbox__caption { color: rgba(255,255,255,.85); font-size: .9rem; text-align: center; max-width: 720px; }
.photo-lightbox__close, .photo-lightbox__prev, .photo-lightbox__next { position: fixed; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; cursor: pointer; line-height: 1; z-index: 1001; display: flex; align-items: center; justify-content: center; transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease); }
.photo-lightbox__close:hover, .photo-lightbox__prev:hover, .photo-lightbox__next:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.5); }
.photo-lightbox__close { top: 18px; right: 22px; width: 44px; height: 44px; font-size: 1.75rem; }
.photo-lightbox__prev, .photo-lightbox__next { top: 50%; transform: translateY(-50%); width: 50px; height: 50px; font-size: 1.9rem; }
.photo-lightbox__prev { left: 22px; }
.photo-lightbox__next { right: 22px; }

/* Link tree (Connect page) */
.linktree { max-width: 460px; margin: 1.6rem auto 0; display: flex; flex-direction: column; gap: .9rem; }
.linktree-link {
  display: flex; align-items: center; gap: 1rem; text-align: left;
  padding: 1rem 1.2rem; background: var(--paper); border: 1px solid var(--ink-100);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.linktree-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--g-500); }
.lt-icon { flex: none; width: 44px; height: 44px; border-radius: var(--r-full); display: inline-flex; align-items: center; justify-content: center; background: var(--p-700); color: #fff; }
.lt-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: .1rem; }
.lt-title { font-weight: 700; color: var(--ink-800); font-size: 1rem; }
.lt-sub { font-size: .82rem; color: var(--ink-500); }
.lt-arrow { flex: none; color: var(--ink-300); font-size: 1.1rem; }
.linktree-link:hover .lt-arrow { color: var(--g-600); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.5rem; font-size: .82rem; color: var(--p-300); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

/* ---------- Breadcrumb ---------- */
.page-head { background: var(--p-50); border-bottom: 1px solid var(--ink-100); padding-block: 2.5rem; }
.breadcrumb { font-size: .82rem; color: var(--ink-500); margin-bottom: .4rem; }
.breadcrumb a { color: var(--p-600); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .roster { columns: 1; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-signin { display: none; }        /* header CTA button hides on mobile… */
  .nav-mobile-only { display: block; }  /* …and reappears inside the opened menu */
  .site-header.open .nav-links {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; left: 0; right: 0; top: 72px; background: var(--paper);
    border-bottom: 1px solid var(--ink-100); box-shadow: var(--shadow-2); padding: .5rem;
  }
  .site-header.open .nav-links a { padding: .8rem 1rem; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-crest { display: none; }
  .gallery-photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .photo-lightbox__prev, .photo-lightbox__next { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}

/* ---------- Admin: lineage ---------- */
.line-admin-new { padding: 1.2rem; margin-bottom: 1rem; background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--r-md); display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.line-admin-new h4 { flex: 1 0 100%; margin-bottom: .5rem; }
.line-admin-new .note { flex: 1 0 100%; margin: 0; }
.line-admin-new input, .line-admin-new select { flex: 1 1 8rem; min-width: 7rem; }
.line-admin { padding: .9rem 1rem; margin-bottom: .6rem; background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--r-md); }
/* A soft-deleted line is off the public page but not gone. Show it dimmed, not hidden. */
.line-admin.deleted { opacity: .6; border-style: dashed; }
.line-admin-head { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .6rem; }
.line-admin-head .l-name { flex: 2 1 12rem; font-weight: 700; }
.line-admin-head .l-year { flex: 0 0 6rem; }
.line-admin-head .l-term { flex: 1 1 9rem; }
.line-admin-head .note { margin: 0; }
.line-admin-members { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.line-admin-member, .line-admin-add { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.line-admin-member .m-num, .line-admin-add .a-num { flex: 0 0 4.5rem; }
.line-admin-member input:not(.m-num), .line-admin-add input:not(.a-num) { flex: 1 1 7rem; min-width: 6rem; }
.line-admin-member label, .line-admin-add label { display: flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--ink-600); white-space: nowrap; }
.line-admin button { padding: .3rem .7rem; font-size: .78rem; border-radius: var(--r-sm); border: 1px solid var(--ink-100); background: var(--ink-50); cursor: pointer; }
.line-admin button:hover { background: var(--ink-100); }
.line-admin .m-del, .line-admin .l-del { color: var(--p-700); }
.line-admin-add { padding-top: .5rem; border-top: 1px dashed var(--ink-100); }
.line-admin button[disabled] { opacity: .65; cursor: default; }

/* Saving re-renders the whole panel from the server, which looks identical to doing nothing.
   Say what was saved, and ring the row it happened to. */
.lines-status { margin: 0 0 .8rem; padding: .55rem .8rem; font-size: .85rem; font-weight: 600; color: var(--p-700); background: var(--p-50); border: 1px solid var(--p-100); border-radius: var(--r-sm); }
.lines-status.err { color: var(--err-700); background: var(--err-50); border-color: var(--err-100); }

/* The ring is a static box-shadow and the animation only fades it. Reduced motion kills the
   animation (see the * rule above), which must leave the ring visible, not erase the signal. */
.just-saved { box-shadow: 0 0 0 3px var(--g-400); border-radius: var(--r-sm); animation: line-saved 1.8s ease-out forwards; }
@keyframes line-saved {
  0%, 45% { box-shadow: 0 0 0 3px var(--g-400); }
  100%    { box-shadow: 0 0 0 3px rgba(229, 203, 130, 0); }
}

/* Legend for the lineage: the crown is meaningless to anyone who hasn't hovered it, and
   nothing else signals that a pill opens. Sits outside .lineage, which app.js rewrites. */
.lineage-legend { margin: 0 0 1rem; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
