/* TDiwan — shared styles. WCAG 2.1 AA targeted. */
:root {
  --bg: #0a0a0f;
  --bg2: #12121c;
  --panel: #15151f;
  --fg: #f4f4f8;
  --muted: #b8b8cc;          /* lightened from #9a9ab0 for AA on --bg */
  --muted-soft: #9a9ab0;
  --accent: #8f80ff;          /* lightened for AA-large contrast */
  --accent2: #2fe3d5;
  --line: rgba(255, 255, 255, .08);
  --focus: #ffd166;
  --maxw: 1040px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: radial-gradient(1200px 800px at 70% -10%, #1b1636 0%, var(--bg) 55%),
              radial-gradient(900px 700px at 0% 110%, #10202a 0%, transparent 60%),
              var(--bg);
  background-attachment: fixed;
  color: var(--fg);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ---- Accessibility primitives ---- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1000;
  background: var(--fg);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(10, 10, 15, .72);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.03em;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}
.brand .brand-td { color: var(--accent2); }
.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
}
.nav-links a:hover { color: var(--fg); background: rgba(255,255,255,.05); }
.nav-links a[aria-current="page"] { color: var(--fg); background: rgba(143,128,255,.16); }

/* ---- Layout ---- */
main { flex: 1; width: 100%; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12vh 24px 10vh;
  max-width: 860px;
  margin: 0 auto;
}
.badge {
  font-size: 13px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent2);
  border: 1px solid rgba(47, 227, 213, .35);
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 34px;
}
h1.logo {
  font-size: clamp(52px, 12vw, 132px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: .95;
  background: linear-gradient(120deg, #fff 20%, var(--accent) 60%, var(--accent2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--fg); /* fallback if clip unsupported */
}
.tagline {
  margin-top: 26px;
  font-size: clamp(20px, 3.2vw, 30px);
  font-weight: 500;
  color: var(--fg);
  max-width: 660px;
}
.mission {
  margin-top: 22px;
  font-size: clamp(15px, 2.1vw, 18px);
  color: var(--muted);
  max-width: 600px;
}
.accent-word { color: var(--accent2); font-weight: 600; }

.cta-row { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #0a0a0f; }
.btn-primary:hover { background: #a99dff; }
.btn-ghost { border-color: var(--line); color: var(--fg); }
.btn-ghost:hover { background: rgba(255,255,255,.05); }

/* ---- Content pages ---- */
.page { padding: 8vh 0 10vh; }
.page h1 {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin-bottom: 8px;
}
.page .lede {
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--muted);
  max-width: 720px;
  margin-bottom: 48px;
}
.page h2 {
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 48px 0 16px;
}
.page h3 { font-size: 20px; font-weight: 700; margin: 28px 0 10px; }
.page p { color: var(--muted); max-width: 760px; margin-bottom: 16px; }
.page p strong, .page li strong { color: var(--fg); font-weight: 700; }
.page a { color: var(--accent2); text-decoration: underline; text-underline-offset: 3px; }
.page a:hover { color: var(--fg); }
.page ul, .page ol { color: var(--muted); max-width: 760px; margin: 0 0 20px 22px; }
.page li { margin-bottom: 10px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 32px 0;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
}
.card h3 { margin-top: 0; color: var(--fg); }
.card p { margin-bottom: 0; }
.card .icon { font-size: 30px; margin-bottom: 12px; display: block; }

.meta-note {
  margin-top: 40px;
  padding: 18px 22px;
  background: rgba(143,128,255,.08);
  border: 1px solid rgba(143,128,255,.25);
  border-radius: 12px;
  font-size: 15px;
  color: var(--muted);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: center;
  justify-content: space-between;
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: var(--fg); text-decoration: underline; }
.copyright { color: var(--muted-soft); font-size: 14px; }

/* ---- Decorative glows ---- */
.glow {
  position: fixed;
  width: 60vw; height: 60vw;
  max-width: 700px; max-height: 700px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .22;
  z-index: -1;
  pointer-events: none;
}
.glow.a { background: var(--accent); top: -10%; right: -10%; }
.glow.b { background: var(--accent2); bottom: -15%; left: -12%; }

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

@media (max-width: 640px) {
  .nav { padding: 12px 18px; }
  .nav-links a { padding: 7px 9px; font-size: 14px; }
  .container { padding: 0 18px; }
}
