/* ========== Design tokens (refined for modern feel) ========== */
:root{
  /* User-adjustable variables */
  --font-scale: 1;
  --line-height: 1.625;
  --letter-spacing: -0.01em;

  /* Color Palette - Modern Dark (Oklch preferred for perception) */
  --bg: #090b10;
  --bg-gradient: radial-gradient(circle at 0% 0%, #111827 0%, #090b10 100%);
  --bg2: #0d1117;
  --card: #151b23;
  --text: #f0f6ff;
  --muted: #8b949e;
  --border: #30363d;
  --link: #f59e0b;
  --link-hover: #fbbf24;
  --link-visited: #d97706;
  --focus: #f2cc60;
  --primary: #f59e0b;
  --primary-glow: rgba(245, 158, 11, 0.15);
  --accent: #fbbf24;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.4);

  /* Layout */
  --maxw: 1200px;
  --radius: 12px;
  --radius-lg: 24px;
  --pad: 20px;
  --pad-lg: 40px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.2s;
}

/* Visual modes */
html[data-visual-mode="light"]{
  --bg: #f8fafc;
  --bg-gradient: none;
  --bg2: #ffffff;
  --card: #ffffff;
  --text: #1a202c;
  --muted: #64748b;
  --border: #e2e8f0;
  --link: #d97706;
  --link-hover: #b45309;
  --link-visited: #92400e;
  --focus: #f59e0b;
  --primary: #d97706;
  --primary-glow: rgba(217, 119, 6, 0.1);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

html[data-visual-mode="high-contrast"]{
  --bg: #000000;
  --bg-gradient: none;
  --bg2: #000000;
  --card: #000000;
  --text: #ffffff;
  --muted: #ffffff;
  --border: #ffffff;
  --link: #00ffff;
  --link-hover: #00ffff;
  --link-visited: #ff00ff;
  --focus: #ffff00;
  --primary: #00ffff;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
}
html[data-visual-mode="high-contrast"] .card{
  border-color: var(--border);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  html[data-reduce-motion="auto"] *{
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
html[data-reduce-motion="on"] *{
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* Base typography */
html{
  font-size: calc(100% * var(--font-scale));
  color-scheme: dark;
}
html[data-visual-mode="light"]{ color-scheme: light; }
html[data-visual-mode="high-contrast"]{ color-scheme: dark; }

body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: var(--line-height);
  letter-spacing: var(--letter-spacing);
  background-color: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(245, 158, 11, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(251, 191, 36, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Focus styles - clear but more modern */
:focus-visible{
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

/* Links */
a{
  color: var(--link);
  text-decoration: none;
  transition: color var(--duration) var(--ease), text-decoration-color var(--duration) var(--ease);
}
a:visited{ color: var(--link-visited); }
a:hover{ color: var(--link-hover); text-decoration: underline; }
html[data-link-style="underline"] a{ text-decoration: none; } /* User can still override via settings if we keep that logic, or we change it to show that we respect the user preference but default is plain */
html[data-link-style="underline"] a:hover { text-decoration: underline; }
html[data-link-style="plain"] a{ text-decoration: none; }

.skip-link{
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--primary);
  padding: 12px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  font-weight: 700;
  transition: top 0.2s ease;
}
.skip-link:focus{
  left: 12px;
  outline: none;
}

/* Layout helpers */
.wrap{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
}
main{ padding-bottom: 80px; }
section{ padding: 80px 0; }
.section-title{
  font-size: clamp(1.75rem, 8vw, 3rem);
  font-weight: 800;
  margin: 0 0 16px 0;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
@media (max-width: 768px) {
  .section-title { text-align: center; }
}
.section-intro{
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 800px;
  margin-bottom: 48px;
}
@media (max-width: 600px) {
  .section-intro { font-size: 1rem; margin-bottom: 32px; }
}

/* Header */
header{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration);
}
.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}
@media (max-width: 768px){
  .topbar nav{ display: none; }
  .topbar .brand-sub{ display: none; }
}
@media (max-width: 480px){
  .topbar { gap: 8px; }
  .topbar .brand-title { font-size: 1.1rem; }
  .topbar .logo { width: 32px; height: 32px; }
  .topbar .btn { padding: 8px 12px; font-size: 0.85rem; }
  .topbar .actions { gap: 6px; }
  .hide-mobile { display: none; }
}
.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-title{
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  font-size: 1.25rem;
  line-height: 1;
  white-space: nowrap;
}
.brand-sub{
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

nav{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
nav a{
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--duration) var(--ease);
}
nav a:hover, nav a:focus-visible{
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
nav a:visited {
  color: var(--muted);
}
nav a:hover:visited {
  color: var(--text);
}

.actions{
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--duration) var(--ease);
}
.btn:hover{
  background: #1c2128;
  border-color: #8b949e;
}
.btn.primary{
  background: var(--primary);
  border-color: var(--primary);
  color: #000000;
}
.btn.primary:hover{
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--primary-glow);
}

/* Hero */
.hero{
  padding: 100px 0;
  overflow: hidden;
}
.hero-grid{
  display: grid;
  gap: 48px;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
}
@media (max-width: 960px){
  .hero-grid{
    grid-template-columns: 1fr;
    text-align: center;
    gap: 32px;
  }
  .hero{ padding: 40px 0; }
  .hero p{ margin: 0 auto 32px auto; }
  .pill-row{ justify-content: center; }
  .section-intro{ margin-left: auto; margin-right: auto; text-align: center; }
}
.hero h1{
  font-size: clamp(2.25rem, 10vw, 4.5rem);
  font-weight: 800;
  margin: 0 0 24px 0;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--text);
}
.hero p{
  margin: 0 0 40px 0;
  color: var(--muted);
  max-width: 60ch;
  font-size: 1.15rem;
  line-height: 1.625;
}
@media (max-width: 600px) {
  .hero p { font-size: 1.05rem; }
}
.pill-row{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.pill{
  display: inline-flex;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--duration) var(--ease);
}
.pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
}
.hero-card{
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--pad-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.hero-card h2{
  margin: 0 0 16px 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero-card p{
  margin: 0 0 24px 0;
  color: var(--muted);
  font-size: 1rem;
}
.hero-card .btn{
  width: 100%;
}

/* Cards grid */
.grid-3{
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
@media (max-width: 480px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}
.card{
  background: var(--card);
  border: 2px solid transparent;
  padding: var(--pad-lg);
  border-radius: var(--radius-lg);
  transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
  position: relative;
}
@media (max-width: 768px) {
  .card { padding: 32px; }
}
.card:hover{
  border-color: var(--primary);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
@media (prefers-reduced-motion: reduce) {
  .card:hover {
    transform: none !important;
  }
}
html[data-reduce-motion="on"] .card:hover {
  transform: none !important;
}
.card h3{
  margin: 0 0 16px 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
@media (max-width: 600px) {
  .card h3 { font-size: 1.3rem; }
}
.card p{
  color: var(--muted);
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.6;
}
@media (max-width: 600px) {
  .card p { font-size: 1rem; }
}
.icon-box {
  width: 56px;
  height: 56px;
  background: var(--primary-glow);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--primary);
  transition: transform 0.3s ease;
}
.card:hover .icon-box {
  transform: scale(1.1) rotate(5deg);
}
.quote{
  margin: 14px 0 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--focus);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg2) 60%, transparent);
  color: var(--text);
  font-style: italic;
}

/* Logic / Roles */
.role-tag{
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 12px;
}
.perk{
  margin: 24px 0 !important;
  color: var(--text) !important;
  font-size: 0.95rem !important;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.card .btn{ margin-top: auto; }

/* FAQ */
details{
  border: none;
  background: transparent;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0;
}
details + details{ margin-top: 0; }
summary{
  padding: 32px 0;
  font-weight: 700;
  font-size: 1.25rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s ease;
}
@media (max-width: 768px) {
  summary {
    padding: 20px 0;
    font-size: 1.1rem;
  }
}
summary:hover {
  color: var(--primary);
}
summary::after {
  content: "+";
  font-size: 1.75rem;
  color: var(--muted);
  transition: transform 0.3s var(--ease);
}
details[open] summary::after {
  transform: rotate(45deg);
  color: var(--primary);
}
details p{
  padding: 0 0 32px 0;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.6;
}

/* Graphics */
.visual-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 400px;
}
@media (max-width: 600px) {
  .visual-container { min-height: 280px; }
}
.wave-graphic {
  width: 100%;
  max-width: 500px;
  height: auto;
  opacity: 0.9;
  filter: drop-shadow(0 0 20px var(--primary-glow));
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}
.animate-pulse {
  animation: pulse 4s ease-in-out infinite;
}

.logo{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: all var(--duration) var(--ease);
}
.brand:hover .logo {
  box-shadow: 0 0 15px var(--primary-glow);
}
.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-title.small {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.hero-graphics {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-actions {
  text-align: center;
}

.hero-actions .hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.btn.large {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.footer-sections {
  display: grid;
  gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
@media (max-width: 768px) {
  .footer-sections {
    text-align: center;
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Footer */
footer{
  padding: 60px 0 100px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Accessibility modal */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2000;
}
.modal-backdrop[aria-hidden="false"]{ display:flex; }

.modal{
  width: min(700px, 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
}
@media (max-width: 600px) {
  .modal { padding: 20px; }
  .modal-header h2 { font-size: 1.25rem; }
}
.modal-header{
  display:flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2{
  margin:0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--muted);
}
.modal-body{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 600px){
  .modal-body{ grid-template-columns: 1fr; }
}
.control{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.control label{
  display:block;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
}
.control .hint{
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}
select{
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
input[type="range"]{
  width: 100%;
  accent-color: var(--primary);
}
.row{
  display:flex;
  align-items:baseline;
  justify-content: space-between;
  gap: 10px;
}
.value{
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
}
.modal-footer{
  display:flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Visually hidden */
.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;
}