/* RDTE Public Site — mobile-first, high contrast */
:root {
  --bg: #0b1220;
  --bg-elevated: #111b2e;
  --bg-card: #152238;
  --border: #24324a;
  --text: #e8edf5;
  --muted: #9aa8bc;
  --gold: #c9a227;
  --gold-soft: #e4c56a;
  --accent: #3b82f6;
  --accent-soft: #60a5fa;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --nav-h: 64px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: var(--gold); }
button, input, select, textarea { font: inherit; }
.container { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--gold); color: #111; padding: .5rem 1rem; z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Top bar */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand {
  display: flex; align-items: center; gap: .65rem; color: var(--text); font-weight: 700; letter-spacing: .04em;
}
.brand-logo {
  width: 40px; height: 40px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--gold); background: var(--bg-elevated);
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(145deg, #1a2740, #0f172a);
  border: 1px solid var(--gold);
  display: grid; place-items: center;
  font-size: .7rem; color: var(--gold); font-weight: 800;
}
.brand span { font-size: 1.05rem; }
.brand small { display: block; font-size: .65rem; color: var(--muted); font-weight: 500; letter-spacing: .02em; }

.nav-desktop { display: none; align-items: center; gap: .15rem; }
.nav-desktop a {
  color: var(--muted); font-size: .9rem; font-weight: 500;
  padding: .5rem .7rem; border-radius: 8px;
}
.nav-desktop a:hover, .nav-desktop a.active { color: var(--text); background: rgba(255,255,255,.05); }
.header-cta { display: none; }

.nav-toggle {
  width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-elevated); color: var(--text); cursor: pointer;
  display: grid; place-items: center; font-size: 1.1rem;
}
.nav-toggle[aria-expanded="true"] { border-color: var(--gold); color: var(--gold); }

/* Mobile drawer */
.nav-mobile {
  display: none; position: fixed; inset: var(--nav-h) 0 0 0; z-index: 99;
  background: rgba(11,18,32,.96); padding: 1rem; overflow-y: auto;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block; padding: .95rem 1rem; border-radius: 12px;
  color: var(--text); font-weight: 600; border: 1px solid transparent;
  margin-bottom: .35rem;
}
.nav-mobile a:hover { background: var(--bg-card); border-color: var(--border); color: var(--gold-soft); }
.nav-mobile .social-row { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border-radius: 12px; border: 1px solid transparent; padding: .75rem 1.15rem;
  font-weight: 600; font-size: .92rem; cursor: pointer; transition: .15s ease;
  text-align: center; white-space: nowrap;
}
.btn-primary { background: var(--gold); color: #111; border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-soft); color: #111; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--text); border-color: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-block { width: 100%; }
.btn-sm { padding: .5rem .8rem; font-size: .82rem; border-radius: 10px; }

/* Page hero with photo background */
.page-hero {
  position: relative;
  min-height: 220px;
  padding: 3.5rem 0 2.75rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  isolation: isolate;
}
.page-hero::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(105deg, rgba(11,18,32,.92) 0%, rgba(11,18,32,.72) 48%, rgba(11,18,32,.45) 100%);
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 {
  margin: 0 0 .5rem;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  letter-spacing: -.02em;
}
.page-hero p { margin: 0; color: var(--muted); max-width: 36rem; font-size: 1.02rem; }
.page-hero .eyebrow {
  color: var(--gold); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .45rem;
}

/* Hero (home) */
.hero {
  position: relative; padding: 3rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  background-size: cover;
  background-position: center 30%;
  isolation: isolate;
  min-height: 520px;
  display: flex; align-items: center;
}
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(115deg, rgba(11,18,32,.94) 0%, rgba(11,18,32,.78) 42%, rgba(11,18,32,.4) 100%),
    radial-gradient(ellipse 80% 60% at 70% 0%, rgba(201,162,39,.18), transparent 55%);
}
.hero > .container { position: relative; z-index: 1; width: 100%; }
.hero-grid {
  display: grid; gap: 2rem;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); background: rgba(201,162,39,.1); border: 1px solid rgba(201,162,39,.35);
  padding: .35rem .7rem; border-radius: 999px; margin-bottom: 1rem;
}
.hero h1 {
  margin: 0 0 1rem; font-size: clamp(1.85rem, 5vw, 3rem); line-height: 1.15; letter-spacing: -.02em;
}
.hero h1 em { font-style: normal; color: var(--gold-soft); }
.hero-lead { color: var(--muted); font-size: 1.05rem; max-width: 38rem; margin: 0 0 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-bottom: 1.25rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; color: var(--muted); font-size: .85rem; }
.hero-meta strong { color: var(--text); }

.hero-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  padding: 1.25rem; box-shadow: var(--shadow);
}
.hero-card h3 { margin: 0 0 .75rem; font-size: 1rem; }
.quick-links { display: grid; gap: .5rem; }
.quick-links a {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; border-radius: 12px; background: var(--bg-card);
  border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: .9rem;
}
.quick-links a:hover { border-color: var(--gold); color: var(--gold-soft); }
.quick-links a span { color: var(--muted); font-size: .8rem; font-weight: 500; }

/* Sections */
.section { padding: 3.5rem 0; border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 1.75rem; max-width: 40rem; }
.section-head .eyebrow {
  color: var(--gold); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .4rem;
}
.section-head h2 { margin: 0 0 .5rem; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; }
.section-head p { margin: 0; color: var(--muted); }

.grid-2 { display: grid; gap: 1rem; }
.grid-3 { display: grid; gap: 1rem; }
.grid-4 { display: grid; gap: 1rem; }

.card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; height: 100%;
  display: flex; flex-direction: column; gap: .65rem;
  transition: border-color .15s, transform .15s;
  overflow: hidden;
}
.card:hover { border-color: rgba(201,162,39,.45); }
.card-photo { padding: 0; }
.card-media {
  height: 160px; background-size: cover; background-position: center;
  border-bottom: 1px solid var(--border);
}
.card-body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card h3 { margin: 0; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.card .price { color: var(--gold-soft); font-weight: 700; font-size: 1.05rem; }
.card .tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag {
  font-size: .72rem; font-weight: 600; color: var(--muted);
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  padding: .2rem .5rem; border-radius: 999px;
}
.card-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .35rem; }

/* Image navigation tiles */
.img-tiles {
  display: grid; gap: .75rem;
  grid-template-columns: 1fr 1fr;
}
.img-tile {
  position: relative; min-height: 140px; border-radius: var(--radius); overflow: hidden;
  background-size: cover; background-position: center;
  border: 1px solid var(--border);
  display: block; color: #fff !important;
  isolation: isolate;
}
.img-tile::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(11,18,32,.15) 0%, rgba(11,18,32,.88) 100%);
  transition: background .2s;
}
.img-tile:hover::before {
  background: linear-gradient(180deg, rgba(11,18,32,.05) 0%, rgba(11,18,32,.75) 100%);
}
.img-tile-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: .9rem 1rem; display: flex; flex-direction: column; gap: .15rem;
}
.img-tile-overlay strong { font-size: .95rem; color: #fff; }
.img-tile-overlay span { font-size: .8rem; color: #cbd5e1; }

/* Dedicated gallery page */
.gallery-grid {
  display: grid; gap: .65rem;
  grid-template-columns: repeat(2, 1fr);
}
.gallery-item {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border); border-radius: 14px; padding: 0; cursor: pointer;
  background-size: cover; background-position: center;
  transition: transform .2s, border-color .2s, filter .2s, box-shadow .2s;
  filter: saturate(1.05) contrast(1.02);
  width: 100%;
}
.gallery-item:hover {
  transform: scale(1.02); border-color: var(--gold); z-index: 1;
  filter: saturate(1.15) brightness(1.05);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}

.modal-photo {
  height: 180px; border-radius: 12px; background-size: cover; background-position: center;
  margin-bottom: 1rem; border: 1px solid #cbd5e1;
}

.event-photo {
  position: relative; overflow: hidden;
  background:
    linear-gradient(90deg, rgba(17,27,46,.97) 0%, rgba(17,27,46,.92) 55%, rgba(17,27,46,.55) 100%),
    var(--ev-img) center/cover no-repeat;
}

.icon-badge {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(201,162,39,.12); color: var(--gold); border: 1px solid rgba(201,162,39,.3);
  font-size: 1.1rem;
}

/* Ethos strip */
.ethos {
  display: grid; gap: .75rem;
  grid-template-columns: 1fr 1fr;
}
.ethos div {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: .9rem 1rem; font-weight: 600; font-size: .88rem;
}
.ethos div i { color: var(--gold); margin-right: .4rem; }

/* Events */
.event-list { display: grid; gap: .75rem; }
.event-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.event-date {
  min-width: 64px; text-align: center; background: var(--bg-card); border-radius: 12px; padding: .55rem .4rem;
  border: 1px solid var(--border);
}
.event-date .mo { display: block; font-size: .7rem; font-weight: 700; color: var(--gold); text-transform: uppercase; }
.event-date .day { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.event-item h3 { margin: 0 0 .2rem; font-size: 1rem; }
.event-item p { margin: 0; color: var(--muted); font-size: .85rem; }

/* Schedule */
.schedule-layout { display: grid; gap: 1.25rem; }
.schedule-panel {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem;
}
.schedule-panel h3 { margin: 0 0 .35rem; }
.schedule-panel > p { margin: 0 0 1rem; color: var(--muted); font-size: .9rem; }
.form-grid { display: grid; gap: .75rem; }
.form-row { display: grid; gap: .75rem; }
label.field { display: grid; gap: .35rem; font-size: .82rem; font-weight: 600; color: var(--muted); }
label.field input, label.field select, label.field textarea {
  width: 100%; padding: .7rem .85rem; border-radius: 10px;
  border: 1px solid #64748b; background: #0f172a; color: var(--text);
}
label.field input:focus, label.field select:focus, label.field textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.2);
}
.form-note { font-size: .8rem; color: var(--muted); margin-top: .75rem; }
.calendly-box {
  min-height: 420px; border-radius: 12px; border: 1px dashed var(--border);
  background: var(--bg-card); display: grid; place-items: center; padding: 1.5rem; text-align: center;
}
.calendly-box p { color: var(--muted); margin: 0 0 1rem; max-width: 28rem; }

/* Social */
.social-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem;
}
.social-btn {
  display: flex; align-items: center; gap: .65rem;
  padding: .85rem 1rem; border-radius: 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text); font-weight: 600; font-size: .9rem;
}
.social-btn:hover { border-color: var(--gold); color: var(--gold-soft); }
.social-btn i { width: 1.25rem; text-align: center; font-size: 1.15rem; }
.social-btn.facebook i { color: #1877f2; }
.social-btn.instagram i { color: #e1306c; }
.social-btn.youtube i { color: #ff0000; }
.social-btn.linkedin i { color: #0a66c2; }
.social-btn.patreon i { color: #ff424d; }
.social-btn.tiktok i { color: #69c9d0; }

/* Contact */
.contact-grid { display: grid; gap: 1.25rem; }
.contact-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem;
}
.contact-card h3 { margin: 0 0 .75rem; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.contact-list li { color: var(--muted); font-size: .92rem; }
.contact-list strong { display: block; color: var(--text); margin-bottom: .15rem; }

/* Footer */
.site-footer {
  padding: 2.5rem 0 6.5rem;
  background: #080e18; border-top: 1px solid var(--border);
}
.footer-grid { display: grid; gap: 1.5rem; }
.footer-brand { font-weight: 800; letter-spacing: .04em; margin-bottom: .35rem; }
.footer-brand span { color: var(--gold); }
.site-footer p { color: var(--muted); font-size: .88rem; margin: 0 0 .75rem; max-width: 28rem; }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1rem; }
.footer-links a { color: var(--muted); font-size: .88rem; }
.footer-links a:hover { color: var(--gold-soft); }
.footer-bottom {
  margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .78rem; display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: space-between;
}

/* Mobile bottom bar */
.mobile-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(11,18,32,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
}
.mobile-dock a {
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  color: var(--muted); font-size: .65rem; font-weight: 600; padding: .4rem .2rem;
}
.mobile-dock a i { font-size: 1.05rem; }
.mobile-dock a.active, .mobile-dock a:hover { color: var(--gold-soft); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.65);
  display: none; align-items: flex-end; justify-content: center; padding: 0;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(560px, 100%); max-height: min(90vh, 720px); overflow: auto;
  background: #f8fafc; color: #0f172a;
  border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
}
.modal-header {
  position: sticky; top: 0; background: #f1f5f9; border-bottom: 1px solid #cbd5e1;
  padding: 1rem 1.15rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.modal-header h3 { margin: 0; font-size: 1.05rem; color: #0f172a; }
.modal-close {
  width: 36px; height: 36px; border: none; border-radius: 10px; cursor: pointer;
  background: #e2e8f0; color: #0f172a; font-size: 1.2rem;
}
.modal-body { padding: 1.15rem; color: #1e293b; font-size: .95rem; }
.modal-body h4 { margin: 1rem 0 .4rem; color: #0f172a; }
.modal-body ul { margin: .35rem 0 0; padding-left: 1.15rem; color: #334155; }
.modal-body li { margin: .25rem 0; }
.modal-footer {
  position: sticky; bottom: 0; background: #f1f5f9; border-top: 1px solid #cbd5e1;
  padding: .9rem 1.15rem; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end;
}
.modal-footer .btn-primary { background: #0f172a; color: #fff; border-color: #0f172a; }
.modal-footer .btn-secondary { color: #0f172a; border-color: #64748b; background: #fff; }

/* A2HS / install banner */
.a2hs-banner {
  display: none;
  position: fixed; left: .75rem; right: .75rem; bottom: calc(4.25rem + env(safe-area-inset-bottom));
  z-index: 95; background: #f8fafc; color: #0f172a;
  border: 1px solid #cbd5e1; border-radius: 16px; box-shadow: var(--shadow);
  padding: .9rem 1rem; gap: .75rem;
}
.a2hs-banner.show { display: flex; align-items: flex-start; }
.a2hs-banner strong { display: block; margin-bottom: .2rem; }
.a2hs-banner p { margin: 0; font-size: .82rem; color: #475569; }
.a2hs-actions { display: flex; flex-direction: column; gap: .35rem; margin-left: auto; }
.a2hs-actions button {
  border: none; border-radius: 10px; padding: .45rem .7rem; font-weight: 600; cursor: pointer; font-size: .8rem;
}
.a2hs-actions .yes { background: #0f172a; color: #fff; }
.a2hs-actions .no { background: #e2e8f0; color: #0f172a; }

/* Install instructions modal content */
.ios-steps { counter-reset: step; list-style: none; padding: 0; margin: .75rem 0 0; }
.ios-steps li {
  counter-increment: step; position: relative; padding: .75rem .75rem .75rem 3rem;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 12px; margin-bottom: .5rem; color: #1e293b;
}
.ios-steps li::before {
  content: counter(step); position: absolute; left: .75rem; top: .75rem;
  width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #0f172a; color: #fff;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
}

/* Toast */
.toast-wrap { position: fixed; top: calc(var(--nav-h) + .75rem); right: .75rem; z-index: 300; display: grid; gap: .5rem; }
.toast {
  background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; padding: .7rem 1rem;
  border-radius: 12px; font-size: .88rem; font-weight: 600; box-shadow: var(--shadow);
  max-width: 320px;
}
.toast.error { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }

/* Utilities */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media (min-width: 768px) {
  .nav-desktop { display: flex; }
  .header-cta { display: inline-flex; }
  .nav-toggle { display: none; }
  .mobile-dock { display: none; }
  .site-footer { padding-bottom: 2.5rem; }
  .hero { padding: 4.5rem 0 5rem; min-height: 580px; }
  .hero-grid { grid-template-columns: 1.25fr .85fr; align-items: center; }
  .page-hero { min-height: 280px; padding: 4.5rem 0 3.25rem; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .ethos { grid-template-columns: repeat(4, 1fr); }
  .schedule-layout { grid-template-columns: 1fr 1fr; }
  .form-row.two { grid-template-columns: 1fr 1fr; }
  .social-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr 1.2fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .modal-backdrop { align-items: center; padding: 1rem; }
  .modal { border-radius: 18px; }
  .a2hs-banner { bottom: 1.25rem; left: auto; right: 1.25rem; max-width: 380px; }
  .event-item { grid-template-columns: auto 1fr auto; }
  .img-tiles { grid-template-columns: repeat(3, 1fr); }
  .img-tile { min-height: 180px; }
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: .85rem;
  }
  .card-media { height: 180px; }
}

@media (min-width: 1100px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3.courses { grid-template-columns: repeat(3, 1fr); }
  .img-tiles { grid-template-columns: repeat(3, 1fr); }
}
