/* =========================================================================
   The Rehab Lab — Dota 2 "patch notes" style redesign
   Dark (default) + Light themes, mobile-first responsive.
   ========================================================================= */

:root {
  --accent: #c0392b;          /* Dota crimson */
  --accent-2: #e07b53;        /* warm highlight */
  --accent-fg: #ffffff;       /* text on accent surfaces */
  --link: #6fb1c9;            /* teal link */
  --link-hover: #9ad4e8;
  --radius: 4px;
  --maxw: 940px;
  --font: "Noto Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Cinzel", "Trajan Pro", "Times New Roman", Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* dark theme (default) */
  --bg: #10151a;
  --bg-grad-1: #141b22;
  --bg-grad-2: #0c1116;
  --panel: #1a222b;
  --panel-2: #212c37;
  --panel-border: #2b3946;
  --text: #c6ccd2;
  --text-dim: #8a97a3;
  --heading: #eef2f5;
  --rule: #2b3846;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  --tag-bg: #2a3742;
  --tag-text: #d7b48a;
}

[data-theme="light"] {
  --bg: #e9e6df;
  --bg-grad-1: #efece5;
  --bg-grad-2: #e2ded5;
  --panel: #faf8f3;
  --panel-2: #f2efe8;
  --panel-border: #d8d2c6;
  --text: #33383d;
  --text-dim: #565c62;
  --heading: #1d2226;
  --rule: #d8d2c6;
  --shadow: 0 2px 6px rgba(60, 50, 40, 0.12);
  --tag-bg: #e6ddcf;
  --tag-text: #6e481f;
  --accent-2: #a5431c;
  --link: #155e78;
  --link-hover: #10485c;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background:
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2)) fixed;
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* Dota 2 style display typography — serif Roman caps for titles */
.brand,
.patch-title,
.page-head h1,
.section-header h2,
.cta h2,
.card h3,
.prose h2,
footer h4 {
  font-family: var(--display);
  font-weight: 700;
}
.patch-title,
.page-head h1,
.cta h2 { letter-spacing: 1px; }
.section-header h2,
footer h4,
.brand { letter-spacing: 2px; }

img { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--accent-fg); padding: 10px 16px; border-radius: var(--radius);
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Top bar / nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--panel);
  border-bottom: 2px solid var(--accent);
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: 0.5px; color: var(--heading);
  text-transform: uppercase; font-size: 1.05rem; white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--heading); }
.brand .mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-fg); font-weight: 900; font-size: 0.95rem;
}

.nav { margin-left: auto; }
.nav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.nav li { position: relative; }
.nav > ul > li > a,
.nav > ul > li > .navtop {
  display: block; padding: 8px 12px; color: var(--text);
  font-size: 0.9rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; border-radius: var(--radius); cursor: pointer;
  background: none; border: none; font-family: inherit;
}
.nav > ul > li > a:hover,
.nav > ul > li > .navtop:hover,
.nav li:hover > a,
.nav li:hover > .navtop { background: var(--panel-2); color: var(--heading); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent-2); }

.nav .submenu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 210px;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-top: 2px solid var(--accent); border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow); padding: 6px; z-index: 120;
}
.nav li:hover > .submenu, .nav li:focus-within > .submenu { display: block; }
.nav .submenu li a {
  display: block; padding: 8px 12px; font-size: 0.85rem; color: var(--text);
  text-transform: none; letter-spacing: 0; border-radius: var(--radius);
}
.nav .submenu li a:hover { background: var(--panel-2); color: var(--heading); text-decoration: none; }

.actions { display: flex; align-items: center; gap: 8px; }
.btn {
  display: inline-block; padding: 9px 16px; border-radius: var(--radius);
  font-weight: 700; font-size: 0.85rem; text-transform: uppercase;
  letter-spacing: 0.5px; cursor: pointer; border: 1px solid transparent;
  font-family: inherit; line-height: 1.2;
}
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: #d9503d; color: var(--accent-fg); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--panel-border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--heading); text-decoration: none; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: var(--radius);
  background: var(--panel-2); border: 1px solid var(--panel-border);
  color: var(--text); cursor: pointer; font-size: 1.1rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--heading); }

.nav-toggle {
  display: none; width: 38px; height: 38px; border-radius: var(--radius);
  background: var(--panel-2); border: 1px solid var(--panel-border);
  color: var(--text); cursor: pointer; font-size: 1.3rem; line-height: 1;
  align-items: center; justify-content: center;
}

/* ---------- Patch banner ---------- */
.patch-banner {
  border-bottom: 1px solid var(--rule);
  padding-top: 44px; padding-bottom: 40px;
  background:
    radial-gradient(1200px 300px at 50% -80px, rgba(192, 57, 43, 0.20), transparent 70%);
}
.patch-eyebrow {
  display: inline-block; font-family: var(--mono); font-weight: 700;
  font-size: 0.8rem; letter-spacing: 2px; color: var(--accent-fg); background: var(--accent);
  padding: 4px 12px; border-radius: var(--radius); text-transform: uppercase;
}
.patch-title {
  font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.05; margin: 16px 0 6px;
  color: var(--heading); font-weight: 800; letter-spacing: -0.5px;
}
.patch-sub { font-size: clamp(1rem, 2.5vw, 1.3rem); color: var(--text-dim); margin: 0 0 8px; }
.patch-motto { font-family: var(--mono); color: var(--accent-2); font-size: 0.95rem; margin: 12px 0 0; }
.pillars { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.pillars li {
  font-family: var(--mono); font-size: 0.85rem; font-weight: 700; letter-spacing: 1px;
  color: var(--heading); background: var(--panel); border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent); padding: 8px 14px; border-radius: var(--radius);
}
.banner-cta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Page header (interior pages) ---------- */
.page-head { padding: 36px 0 10px; border-bottom: 1px solid var(--rule); }
.page-head .kicker {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent-2); font-weight: 700;
}
.page-head h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem); color: var(--heading);
  margin: 8px 0 4px; font-weight: 800; letter-spacing: -0.4px;
}
.page-head .lede { color: var(--text-dim); font-size: 1.05rem; margin: 0; }

/* ---------- Patch section (the core "release note" block) ---------- */
main { padding: 10px 0 60px; }

.section { margin: 34px 0; }
.section-header {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--accent);
}
.section-header h2 {
  margin: 0; font-size: 1.25rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--heading); font-weight: 800;
}
.section-header .count {
  margin-left: auto; font-family: var(--mono); font-size: 0.8rem;
  color: var(--text-dim);
}

/* generic panel */
.panel {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.panel-lead { color: var(--text); margin-top: 0; }

/* "hero/item entry" — used for services and structured lists */
.entry {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.entry-title {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 0 0 4px;
}
.entry-title .name {
  font-size: 1.15rem; font-weight: 800; color: var(--heading); letter-spacing: 0.2px;
}
.entry-title .name a { color: var(--heading); }
.entry-title .name a:hover { color: var(--accent-2); }
.entry-sub { color: var(--text-dim); font-style: italic; margin: 0 0 10px; }
.entry-sub.plain { font-style: normal; }

/* patch-style change list */
.changes { list-style: none; margin: 8px 0 0; padding: 0; }
.changes li {
  position: relative; padding: 3px 0 3px 22px; color: var(--text);
}
.changes li::before {
  content: ""; position: absolute; left: 4px; top: 12px;
  width: 7px; height: 7px; background: var(--accent);
  transform: rotate(45deg); border-radius: 1px;
}
.changes.sub li { padding-left: 38px; color: var(--text); }
.changes.sub li::before { left: 20px; background: var(--text-dim); }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--tag-text);
  background: var(--tag-bg); padding: 3px 8px; border-radius: var(--radius);
}

/* grids */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.card h3 { margin: 0; font-size: 1.05rem; color: var(--heading); }
.card .role { color: var(--accent-2); font-size: 0.85rem; font-family: var(--mono); }
.card .quote { color: var(--text-dim); font-style: italic; margin: 0; }
.card .quote.plain { font-style: normal; }
.card .more { margin-top: auto; padding-top: 8px; font-size: 0.85rem; }

/* rate table */
.rates { width: 100%; border-collapse: collapse; }
.rates td { padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.rates td:last-child { text-align: right; font-family: var(--mono); color: var(--heading); font-weight: 700; white-space: nowrap; }
.rates tr:last-child td { border-bottom: none; }

/* faq */
.faq details {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); margin-bottom: 8px; box-shadow: var(--shadow);
}
.faq summary {
  cursor: pointer; padding: 14px 18px; font-weight: 700; color: var(--heading);
  list-style: none; position: relative; padding-right: 42px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 1.3rem; font-weight: 700;
}
.faq details[open] summary::after { content: "\2212"; } /* minus */

/* form fields (contact page) */
.field {
  width: 100%; padding: 10px; border-radius: var(--radius);
  border: 1px solid var(--panel-border); background: var(--panel-2);
  color: var(--text); font-family: inherit; font-size: 1rem;
}
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cta .banner-cta { justify-content: center; }
.faq .answer { padding: 0 18px 16px; color: var(--text-dim); }

/* pills / chips list */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips li {
  background: var(--panel-2); border: 1px solid var(--panel-border);
  border-radius: 20px; padding: 5px 13px; font-size: 0.85rem; color: var(--text);
}

/* callout / testimonial */
.quote-block {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent-2); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.quote-block p { margin: 0 0 8px; font-style: italic; color: var(--text); }
.quote-block .who { color: var(--heading); font-weight: 700; font-style: normal; }
.quote-block .who small { color: var(--text-dim); font-weight: 400; }

/* prose (blog) */
.prose h2 { color: var(--heading); font-size: 1.3rem; margin: 28px 0 10px; border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.prose p { margin: 0 0 14px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }

/* CTA strip */
.cta {
  margin: 40px 0 0; text-align: center;
  background:
    radial-gradient(800px 200px at 50% 0, rgba(192, 57, 43, 0.16), transparent 70%);
  border: 1px solid var(--panel-border); border-top: 2px solid var(--accent);
  border-radius: var(--radius); padding: 34px 24px;
}
.cta h2 { margin: 0 0 8px; color: var(--heading); font-size: 1.6rem; }
.cta p { color: var(--text-dim); margin: 0 0 18px; }

/* meta line (blog) */
.post-meta { font-family: var(--mono); font-size: 0.82rem; color: var(--text-dim); margin: 6px 0 0; }
.post-meta span + span::before { content: "·"; margin: 0 8px; color: var(--rule); }

/* back link */
.back-link { display: inline-block; margin-bottom: 12px; font-family: var(--mono); font-size: 0.85rem; }

/* ---------- Footer ---------- */
footer {
  border-top: 2px solid var(--accent); background: var(--panel);
  margin-top: 50px; padding: 34px 0 20px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px; }
footer h4 {
  color: var(--heading); text-transform: uppercase; letter-spacing: 1px;
  font-size: 0.85rem; margin: 0 0 12px;
}
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin: 5px 0; color: var(--text-dim); font-size: 0.9rem; }
footer a { color: var(--text-dim); }
footer a:hover { color: var(--link-hover); }
.footer-accolades li { position: relative; padding-left: 16px; }
.footer-accolades li::before { content: "\2605"; position: absolute; left: 0; color: var(--accent-2); }
.footer-bottom {
  border-top: 1px solid var(--rule); margin-top: 26px; padding-top: 16px;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;
  color: var(--text-dim); font-size: 0.82rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; inset: 0 0 0 auto; width: min(80%, 320px);
    background: var(--panel); border-left: 2px solid var(--accent);
    transform: translateX(100%); transition: transform 0.22s ease;
    padding: 70px 14px 20px; overflow-y: auto; z-index: 130; margin-left: 0;
  }
  body.nav-open .nav { transform: translateX(0); }
  body.nav-open .nav-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 125;
  }
  .nav ul { flex-direction: column; gap: 0; }
  .nav > ul > li > a,
  .nav > ul > li > .navtop { width: 100%; padding: 12px 10px; border-radius: var(--radius); }
  .nav .submenu {
    display: block; position: static; box-shadow: none; border: none;
    border-top: none; background: transparent; padding: 0 0 6px 12px; min-width: 0;
  }
  .nav .submenu li a { padding: 8px 10px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .actions .label-hide { display: none; }
}

/* backdrop hidden by default at all widths; only shown when the mobile nav is open */
.nav-backdrop { display: none; }

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