/* ============================================================
   MIOS SITE — GLOBAL STYLESHEET
   Shared design tokens, nav, footer, text-size control,
   form elements, and utility classes used across all pages.
   Page-specific styles live in css/page-*.css
   ============================================================ */

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  --navy:       #0d1f35;
  --navy-mid:   #162d4a;
  --navy-light: #1e3d63;
  --accent:     #c0392b;
  --accent-lt:  #e74c3c;
  --gold:       #c9973a;
  --text:       #f0ece4;
  --text-muted: #cec9c0;
  --text-dim:   #9e9890;
  --border:     rgba(240,236,228,0.12);
  --border-md:  rgba(240,236,228,0.22);
  --card-bg:    rgba(22,45,74,0.55);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; scroll-behavior: smooth; }

body {
  background: var(--navy);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  overflow-x: hidden;
}

/* ── SKIP LINK (WCAG) ───────────────────────────────────────── */
.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--accent); color: #fff;
  padding: .5rem 1rem; font-size: .9rem; font-weight: 600;
  z-index: 9999; border-radius: 0 0 4px 4px;
  text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 0; outline: 3px solid #fff; outline-offset: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

/* ── NAV ────────────────────────────────────────────────────── */
.top-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,31,53,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.top-nav-inner {
  padding: 0 4rem;
  display: flex; align-items: center;
  justify-content: space-between;
  overflow-x: auto; scrollbar-width: none;
}
.top-nav-inner::-webkit-scrollbar { display: none; }

.nav-left { display: flex; align-items: center; flex: 1; overflow: hidden; }

.nav-logo {
  font-family: var(--font-mono); font-size: .8rem; font-weight: 600;
  color: var(--accent); letter-spacing: .1em;
  padding: .65rem 1.5rem .65rem 0; margin-right: 1rem;
  border-right: 1px solid var(--border);
  white-space: nowrap; text-decoration: none;
  display: flex; align-items: center;
  transition: opacity .2s;
}
.nav-logo:hover { opacity: .8; }
.nav-logo-img { height: 28px; width: auto; display: block; }

.nav-links { display: flex; list-style: none; }
.nav-links a {
  display: block; padding: 1rem 1rem;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none;
  white-space: nowrap; transition: color .2s var(--ease);
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active,
.nav-links a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ── HAMBURGER ──────────────────────────────────────────────── */
.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: .75rem; margin-left: .5rem; flex-shrink: 0;
  color: var(--text-muted);
}
.hamburger:hover { color: var(--text); }
.hamburger:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.hamburger-bars { display: flex; flex-direction: column; gap: 5px; width: 22px; }
.hamburger-bars span {
  display: block; width: 100%; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.hamburger[aria-expanded="true"] .hamburger-bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] .hamburger-bars span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger[aria-expanded="true"] .hamburger-bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE MENU ────────────────────────────────────────────── */
.mobile-menu {
  display: none; position: fixed; inset: 0; top: 0; z-index: 190;
  background: rgba(6,15,28,.97); backdrop-filter: blur(16px);
  padding: 6rem 2rem 2rem; flex-direction: column; gap: .25rem; overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  display: block; padding: 1rem 1.25rem;
  font-family: var(--font-mono); font-size: .9rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none;
  border-left: 3px solid transparent; border-radius: 0 4px 4px 0;
  transition: color .15s, border-color .15s, background .15s;
}
.mobile-menu a:hover,
.mobile-menu a.active { color: var(--text); border-left-color: var(--accent); background: rgba(192,57,43,.08); }
.mobile-menu-close {
  position: absolute; top: 1.25rem; right: 1.25rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.5rem; line-height: 1; padding: .5rem;
}
.mobile-menu-close:hover { color: var(--text); }

/* ── FOOTER ─────────────────────────────────────────────────── */
footer {
  background: #081420;
  border-top: 1px solid var(--border);
  padding: 2rem 4rem;
}
.footer-inner {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: center; gap: 1rem;
}
.footer-top {
  width: 100%; display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: center; gap: 1rem;
  padding-bottom: 1rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.footer-brand {
  font-family: var(--font-mono); font-size: .72rem;
  font-weight: 600; color: var(--accent); letter-spacing: .12em;
}
.footer-note {
  font-family: var(--font-mono); font-size: .65rem;
  color: var(--text-muted); letter-spacing: .06em;
}
.footer-legal-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.footer-legal-links a {
  font-family: var(--font-mono); font-size: .65rem;
  color: var(--text-muted); text-decoration: none;
  letter-spacing: .06em; transition: color .15s;
}
.footer-legal-links a:hover { color: var(--text); }
.footer-legal-links span { color: var(--text-dim); }
.footer-secondary-links {
  width: 100%; padding-bottom: .85rem; margin-bottom: .1rem;
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .05em;
}
.footer-secondary-links a {
  color: var(--text-dim); text-decoration: none; transition: color .15s;
}
.footer-secondary-links a:hover { color: var(--text-muted); }
.footer-secondary-links span { color: var(--text-dim); opacity: .5; }

/* ── TEXT SIZE CONTROL (WCAG 1.4.4) ─────────────────────────── */
.text-size-control {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9000;
  display: flex; align-items: center; gap: .35rem;
  background: rgba(13,31,53,.97);
  border: 1px solid rgba(240,236,228,.22);
  border-radius: 3rem; padding: .45rem .75rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0,0,0,.45);
}
.text-size-label {
  font-family: var(--font-mono); font-size: .6rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(240,236,228,.45);
  padding-right: .35rem; border-right: 1px solid rgba(240,236,228,.12);
  margin-right: .1rem; white-space: nowrap;
}
.text-size-btn {
  background: none; border: none; cursor: pointer;
  border-radius: 2rem; padding: .35rem .65rem;
  font-family: var(--font-mono); font-weight: 600; letter-spacing: .05em;
  color: rgba(240,236,228,.55);
  transition: background .15s, color .15s;
  line-height: 1; white-space: nowrap;
}
.text-size-btn:hover { background: rgba(240,236,228,.08); color: #f0ece4; }
.text-size-btn.active { background: var(--accent); color: #fff; }
.text-size-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

html.text-normal  { font-size: 18px; }
html.text-large   { font-size: 22px; }
html.text-xlarge  { font-size: 26px; }

/* ── SHARED FORM ELEMENTS ───────────────────────────────────── */
.contact-section {
  background: linear-gradient(135deg, var(--navy-mid) 0%, #0d2038 100%);
  border: 1px solid var(--border-md);
  border-radius: 4px;
  padding: 3.5rem 3rem;
  margin-top: 5rem;
}
.contact-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 900; color: var(--text);
  margin-bottom: .75rem; line-height: 1.2;
}
.contact-section > p {
  font-size: 1rem; color: var(--text-muted);
  margin-bottom: 2.5rem; max-width: 38rem; line-height: 1.7;
}
.contact-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label {
  font-family: var(--font-mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted);
}
.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(13,31,53,.7);
  border: 1px solid var(--border-md); border-radius: 3px;
  padding: .75rem 1rem;
  font-family: var(--font-body); font-size: .95rem; color: var(--text);
  outline: none;
  transition: border-color .2s var(--ease), background .2s;
  width: 100%;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); }
.form-group select option { background: var(--navy-mid); color: var(--text); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--gold); background: rgba(13,31,53,.9); }
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.form-group textarea { resize: vertical; min-height: 7rem; line-height: 1.6; }
.form-submit-row {
  grid-column: 1 / -1; display: flex; align-items: center;
  gap: 1.5rem; margin-top: .5rem;
}
.btn-submit {
  font-family: var(--font-mono); font-size: .75rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: #fff; background: var(--accent);
  border: none; border-radius: 3px; padding: .85rem 2rem;
  cursor: pointer; transition: background .2s var(--ease), transform .1s;
}
.btn-submit:hover { background: var(--accent-lt); }
.btn-submit:active { transform: scale(.98); }
.btn-submit:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.form-privacy {
  font-family: var(--font-mono); font-size: .68rem;
  color: var(--text-dim); letter-spacing: .04em; line-height: 1.5;
}
.form-error-banner {
  display: none; grid-column: 1 / -1;
  background: rgba(192,57,43,.15);
  border: 1px solid rgba(192,57,43,.5); border-radius: 3px;
  padding: .85rem 1rem;
  font-family: var(--font-mono); font-size: .75rem; color: #f5a99f;
  letter-spacing: .04em; line-height: 1.5;
}
.form-error-banner.visible { display: block; }

/* ── SHARED BUTTONS ─────────────────────────────────────────── */
.btn-primary {
  font-family: var(--font-mono); font-size: .75rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: #fff; background: var(--accent);
  border: none; border-radius: 3px;
  padding: 1rem 2.25rem; cursor: pointer;
  text-decoration: none; display: inline-block;
  transition: background .2s var(--ease);
}
.btn-primary:hover { background: var(--accent-lt); }
.btn-secondary {
  font-family: var(--font-mono); font-size: .75rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted); border: 1px solid var(--border-md);
  border-radius: 3px; padding: 1rem 2.25rem; cursor: pointer;
  text-decoration: none; display: inline-block; background: transparent;
  transition: color .2s, border-color .2s;
}
.btn-secondary:hover { color: var(--text); border-color: var(--text-muted); }

/* ── SHARED CALLOUT ─────────────────────────────────────────── */
.callout {
  position: relative; margin: 2.5rem 0; padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(192,57,43,.08) 0%, rgba(22,45,74,.6) 100%);
  border-left: 4px solid var(--accent); border-radius: 0 4px 4px 0;
}
.callout p {
  font-family: var(--font-display); font-size: 1.15rem; font-style: italic;
  color: var(--text) !important; margin: 0 !important; line-height: 1.6;
}

/* ── SHARED NOTE BOX ────────────────────────────────────────── */
.note-box {
  position: relative; margin: 2rem 0; padding: 1.25rem 1.75rem;
  background: rgba(201,151,58,.06);
  border-left: 3px solid var(--gold); border-radius: 0 4px 4px 0;
}
.note-box p {
  font-size: .92rem !important; color: var(--text-muted) !important;
  margin: 0 !important; line-height: 1.7;
}
.note-box strong { color: var(--gold) !important; }

/* ── SHARED EYEBROW ─────────────────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: .75rem;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent-lt); margin-bottom: 1.5rem;
}
.eyebrow::before {
  content: ''; display: block; width: 2.5rem; height: 2px;
  background: var(--accent);
}

/* ── PAGE LAYOUT ────────────────────────────────────────────── */
.page-layout {
  max-width: 100%; margin: 0 auto; padding: 4rem 4rem;
}
main { min-width: 0; }

/* ── SECTION HEADER ─────────────────────────────────────────── */
.content-section { margin-bottom: 5rem; scroll-margin-top: 5rem; }
.section-header {
  display: flex; align-items: baseline; gap: 1rem;
  margin-bottom: 1.75rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-md);
}
.section-num {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  color: var(--accent); letter-spacing: .1em; flex-shrink: 0;
}
h2.section-title {
  font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700; color: var(--text); line-height: 1.2;
}
h3.subsection-title {
  font-family: var(--font-display); font-size: 1.2rem;
  font-weight: 700; font-style: italic; color: var(--gold);
  margin: 2.5rem 0 .85rem;
}

/* ── CONTENT TYPOGRAPHY ─────────────────────────────────────── */
.content-section p {
  font-size: 1rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 1.2rem;
}
.content-section p strong { color: var(--text); font-weight: 600; }

.content-list {
  list-style: none; display: flex; flex-direction: column;
  gap: .75rem; margin: 1.25rem 0 1.5rem;
}
.content-list li {
  display: flex; gap: 1rem; font-size: 1rem;
  color: var(--text-muted); line-height: 1.7;
}
.content-list li::before {
  content: '—'; color: var(--accent); font-family: var(--font-mono);
  flex-shrink: 0; padding-top: .05em;
}
.content-list li strong { color: var(--text); font-weight: 600; }

/* ── SR ONLY ────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 820px) {
  .nav-links { display: none !important; }
  .hamburger { display: flex !important; }
  .top-nav-inner { padding: 0 1.25rem !important; }
}
@media (max-width: 640px) {
  html { font-size: 16px; }
  .page-layout { padding: 2.5rem 1.25rem; }
  footer { padding: 1.5rem 1.25rem; }
  .contact-section { padding: 2rem 1.25rem; }
  .contact-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
