/* Fad noir theme — matches MechanismColors in the iOS app */
:root {
  --temple-black: #070707;
  --ink-stone: #111318;
  --deep-charcoal: #191d24;
  --jade-flame: #20e0b1;
  --ghost-jade: #a9ffe6;
  --molten-amber: #ff9f2e;
  --bronze: #b77a35;
  --crimson-seal: #d64045;
  --moon-white: #f4f0e8;
  --muted-ash: #9b9a95;
  --panel-border: #2d323b;
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius-panel: 14px;
  --radius-seal: 6px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", serif;
  --shadow-glow: 0 0 24px rgba(32, 224, 177, 0.18);
  --transition: 0.22s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--moon-white);
  background: var(--temple-black);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(32, 224, 177, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(183, 122, 53, 0.06), transparent);
}

a {
  color: var(--jade-flame);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--ghost-jade);
}

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

/* Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--ink-stone);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateX(0);
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--panel-border);
}

.brand-emblem {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--bronze);
  display: block;
  object-fit: cover;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-glow);
  background: var(--deep-charcoal);
}

.hero-logo {
  width: 120px;
  height: 120px;
  border-radius: 22px;
  border: 2px solid var(--bronze);
  object-fit: cover;
  margin: 0 auto 1.25rem;
  display: block;
  box-shadow: var(--shadow-glow);
}

.page-logo {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  border: 2px solid var(--bronze);
  object-fit: cover;
  margin: 0 auto 1.5rem;
  display: block;
  box-shadow: var(--shadow-glow);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--moon-white);
  margin: 0 0 0.25rem;
  letter-spacing: 0.04em;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--muted-ash);
  margin: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-ash);
  padding: 0.5rem 0.75rem 0.35rem;
  margin: 0.5rem 0 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  color: var(--muted-ash);
  font-size: 0.92rem;
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover {
  background: rgba(32, 224, 177, 0.08);
  color: var(--moon-white);
}

.nav-link.active {
  background: rgba(32, 224, 177, 0.12);
  color: var(--jade-flame);
  border: 1px solid rgba(32, 224, 177, 0.25);
}

.nav-icon {
  width: 1.25rem;
  text-align: center;
  opacity: 0.85;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--panel-border);
  font-size: 0.72rem;
  color: var(--muted-ash);
}

.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--ink-stone);
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--moon-white);
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
}

main {
  flex: 1;
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem) 3rem;
  max-width: 960px;
}

.page-footer {
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem);
  border-top: 1px solid var(--panel-border);
  font-size: 0.8rem;
  color: var(--muted-ash);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
}

/* Hero */
.hero {
  position: relative;
  padding: 2.5rem 2rem;
  border-radius: var(--radius-panel);
  background: linear-gradient(135deg, var(--ink-stone) 0%, var(--deep-charcoal) 100%);
  border: 1px solid rgba(183, 122, 53, 0.5);
  box-shadow: inset 0 0 0 1px rgba(183, 122, 53, 0.15), var(--shadow-glow);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  border: 2px solid var(--bronze);
  opacity: 0.4;
  pointer-events: none;
}

.hero::before {
  top: 12px;
  left: 12px;
  border-right: none;
  border-bottom: none;
}

.hero::after {
  bottom: 12px;
  right: 12px;
  border-left: none;
  border-top: none;
}

.hero-badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--moon-white);
  background: var(--crimson-seal);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-seal);
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 0 0 0.75rem;
  line-height: 1.25;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--muted-ash);
  max-width: 36em;
  margin: 0 0 1.5rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-primary {
  background: linear-gradient(180deg, var(--jade-flame), #18b88f);
  color: var(--temple-black);
  box-shadow: 0 4px 16px rgba(32, 224, 177, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(32, 224, 177, 0.45);
  color: var(--temple-black);
}

.btn-ghost {
  background: transparent;
  color: var(--moon-white);
  border: 1px solid var(--panel-border);
}

.btn-ghost:hover {
  border-color: var(--bronze);
  color: var(--moon-white);
}

/* Sections */
.section-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "◆";
  font-size: 0.55rem;
  color: var(--jade-flame);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.card {
  background: var(--ink-stone);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-panel);
  padding: 1.35rem;
  position: relative;
}

.card-glyph {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--bronze);
  margin-bottom: 0.5rem;
}

.card h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--moon-white);
}

.card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted-ash);
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-pill {
  flex: 1;
  min-width: 140px;
  padding: 1rem 1.25rem;
  background: var(--deep-charcoal);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-panel);
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--jade-flame);
  display: block;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--muted-ash);
}

/* Legal / content pages */
.legal-banner {
  text-align: center;
  margin-bottom: 2rem;
}

.legal-emblem {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--bronze);
  display: block;
  object-fit: cover;
  margin: 0 auto 1rem;
  box-shadow: var(--shadow-glow);
  background: var(--deep-charcoal);
}

.legal-notice {
  background: rgba(32, 224, 177, 0.08);
  border-left: 3px solid var(--jade-flame);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--ghost-jade);
  margin-bottom: 2rem;
  border-radius: 0 8px 8px 0;
}

.legal-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--panel-border);
}

.legal-section:last-child {
  border-bottom: none;
}

.legal-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.seal-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--crimson-seal);
  color: var(--crimson-seal);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.legal-body {
  margin: 0;
  color: var(--muted-ash);
  font-size: 0.92rem;
}

.content-panel {
  background: var(--deep-charcoal);
  border: 2px solid rgba(183, 122, 53, 0.45);
  border-radius: var(--radius-panel);
  padding: 1.75rem 2rem;
}

h1.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.5rem;
}

.page-subtitle {
  color: var(--muted-ash);
  margin: 0 0 2rem;
  font-size: 0.95rem;
}

/* Support */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-list li:last-child {
  border-bottom: none;
}

.contact-label {
  color: var(--muted-ash);
  font-size: 0.85rem;
}

/* Overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .main-wrap {
    margin-left: 0;
  }

  .top-bar {
    display: flex;
  }

  main {
    padding-top: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
