/* Theme tokens */
:root {
  --bg: #0b1020;
  --panel: #121a33;
  --panel2: #0f1730;
  --text: #e8ecff;
  --muted: #b9c1ff;
  --line: rgba(255, 255, 255, 0.12);
  --brand: #7c5cff;
  --brand2: #25d0ab;
  --danger: #ff4d6d;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --fontBody: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    "Noto Sans", "Liberation Sans", sans-serif;
  --fontHeading: "Playfair Display", ui-serif, Georgia, "Times New Roman", Times, serif;
}

html[data-theme="light"] {
  --bg: #f6f7ff;
  --panel: #ffffff;
  --panel2: #f2f4ff;
  --text: #101428;
  --muted: #3e4a7a;
  --line: rgba(16, 20, 40, 0.14);
  --shadow: 0 12px 28px rgba(16, 20, 40, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--fontBody);
  background: radial-gradient(1200px 800px at 10% 10%, rgba(124, 92, 255, 0.22), transparent 55%),
    radial-gradient(1000px 700px at 90% 20%, rgba(37, 208, 171, 0.18), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
}

/* Landing page: full-page background image + dark overlay */
body.landing {
  position: relative;
}

body.landing::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 16, 32, 0.45), rgba(11, 16, 32, 0.65)),
    url("https://images.unsplash.com/photo-1519389950473-47ba0277781c?auto=format&fit=crop&w=2000&q=70")
      center / cover no-repeat;
}

h1,
h2,
h3 {
  font-family: var(--fontHeading);
  letter-spacing: 0.2px;
}

a {
  color: color-mix(in srgb, var(--brand) 80%, var(--text));
  text-decoration: none;
}

a:hover {
  color: var(--text);
}

/* Link states (order matters) */
a:link {
  color: color-mix(in srgb, var(--brand) 80%, var(--text));
}
a:visited {
  color: color-mix(in srgb, var(--brand2) 65%, var(--text));
}
a:hover {
  color: var(--text);
}
a:active {
  color: color-mix(in srgb, var(--danger) 70%, var(--text));
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.stack > * + * {
  margin-top: 14px;
}

.siteHeader {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--line);
}

.siteHeaderInner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: var(--text);
}

.pill {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 25%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent);
  font-size: 12px;
  color: var(--muted);
}

/* Hamburger-only navigation */
.nav {
  display: none;
}

.navToggle {
  display: inline-flex;
  width: 42px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  color: var(--text);
  cursor: pointer;
}

.navToggleLines {
  width: 18px;
  height: 12px;
  position: relative;
}

.navToggleLines::before,
.navToggleLines::after,
.navToggleLines span {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--text) 85%, transparent);
}

.navToggleLines::before {
  top: 0;
}

.navToggleLines span {
  top: 5px;
}

.navToggleLines::after {
  bottom: 0;
}

.navOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  z-index: 20;
}

.navDrawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: min(320px, 86vw);
  transform: translateX(-100%);
  transition: transform 180ms ease;
  background: color-mix(in srgb, var(--bg) 85%, #000);
  border-right: 1px solid var(--line);
  z-index: 21;
  padding: 14px;
}

.navDrawerHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.navDrawerLinks {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.navDrawerLinks a,
.navDrawerLinks button {
  text-align: left;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Small inline icon */
.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
}

body.navOpen .navOverlay {
  display: block;
}

body.navOpen .navDrawer {
  transform: translateX(0);
}

.nav a,
.nav button {
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nav a:hover,
.nav button:hover {
  border-color: var(--line);
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.btnPrimary {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--brand) 60%, #000),
    color-mix(in srgb, var(--brand2) 45%, #000)
  );
}

.card {
  border: 1px solid var(--line);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--panel) 88%, transparent),
    color-mix(in srgb, var(--panel2) 92%, transparent)
  );
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

/* Glassmorphism card (best on image backgrounds) */
.glass {
  background: rgba(18, 26, 51, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

html[data-theme="light"] .glass {
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(16, 20, 40, 0.14);
  box-shadow: 0 18px 45px rgba(16, 20, 40, 0.16);
}

/* Apply glass to all landing-page cards */
body.landing .card {
  background: rgba(18, 26, 51, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

html[data-theme="light"] body.landing .card {
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(16, 20, 40, 0.14);
  box-shadow: 0 18px 45px rgba(16, 20, 40, 0.16);
}

/* Glass footer bar on landing page */
body.landing .footer {
  background: rgba(18, 26, 51, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

html[data-theme="light"] body.landing .footer {
  background: rgba(255, 255, 255, 0.22);
}

.hero {
  padding: 22px 0 14px;
}

.landingHero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--panel) 88%, transparent),
    color-mix(in srgb, var(--panel2) 92%, transparent)
  );
}

html[data-theme="light"] .landingHero {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--panel) 94%, transparent),
    color-mix(in srgb, var(--panel2) 96%, transparent)
  );
}

/* Ensure the landing hero matches glass cards */
body.landing .landingHero {
  background: rgba(18, 26, 51, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

html[data-theme="light"] body.landing .landingHero {
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(16, 20, 40, 0.14);
  box-shadow: 0 18px 45px rgba(16, 20, 40, 0.16);
}

.landingHeroInner {
  padding: 22px;
}

.heroNote {
  display: inline-block;
  width: fit-content;
  max-width: 70ch;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  color: #101428;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

@media (max-width: 520px) {
  .landingHeroInner {
    padding: 16px;
  }
  .heroNote {
    max-width: 100%;
  }
}

.heroGrid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .heroGrid {
    grid-template-columns: 1fr;
  }
}

.deviceGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Tablet layout */
@media (min-width: 700px) {
  .deviceGrid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Laptop/desktop layout */
@media (min-width: 1024px) {
  .deviceGrid {
    grid-template-columns: 1.25fr 0.75fr;
  }
}

/* Drawer width for larger screens */
@media (min-width: 900px) {
  .navDrawer {
    width: 360px;
  }
}

.muted {
  color: var(--muted);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 900px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

.tagRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 75%, transparent);
  color: var(--muted);
  font-size: 12px;
}

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

/* Tablet */
@media (max-width: 1000px) {
  .postList {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 650px) {
  .postList {
    grid-template-columns: 1fr;
  }
}

/* Tablet spacing tweaks */
@media (max-width: 900px) {
  .container {
    width: min(980px, calc(100% - 24px));
  }
  .card {
    padding: 14px;
  }
}

/* Mobile spacing + typography */
@media (max-width: 520px) {
  .container {
    width: min(980px, calc(100% - 18px));
  }
  .siteHeaderInner {
    padding: 12px 0;
  }
  h1 {
    font-size: 26px;
  }
  .btn {
    width: 100%;
  }
  .searchRow {
    gap: 12px;
  }
}

.postCard h3 {
  margin: 0 0 6px;
}

.postMeta {
  font-size: 13px;
  color: var(--muted);
}

.searchRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  color: var(--text);
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.inlineOptions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
}

.tableWrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}

caption {
  caption-side: top;
  padding: 10px;
  font-weight: 800;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

thead th {
  background: color-mix(in srgb, var(--brand) 15%, var(--panel));
}

.mediaRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 900px) {
  .mediaRow {
    grid-template-columns: 1fr;
  }
}

.mediaRow img,
.mediaRow iframe,
.mediaRow video {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #000;
}

/* Element-specific class selector example */
a.lyx {
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent);
}

/* Generic class selector example */
.bling {
  font-weight: 900;
  letter-spacing: 0.2px;
  color: color-mix(in srgb, var(--brand2) 75%, var(--text));
}

.footer {
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
