:root {
  --bg: #0e1116;
  --panel: #151a21;
  --text: #e6eef8;
  --muted: #9fb2c8;
  --accent: #19b3b3;
  --accent-2: #0aa0a0;
  --border: #263241;
  --code: #0b0f14;

  /* Brand color (DARK) -> match ticc-dash.py */
  --brand: #8be1dd;
  --brand-font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Arial;
  --brand-weight: 800;
}

:root[data-theme="light"], html[data-theme="light"] {
  --bg: #ffffff;
  --panel: #f6f8fb;
  --text: #0f1720;
  --muted: #526476;
  --accent: #0ea5a5;
  --accent-2: #087e7e;
  --border: #d8e0ea;
  --code: #f3f6fb;

  /* Brand color (LIGHT) -> match ticc-dash.py */
  --brand: #2c7a7b;
  --brand-weight: 900;
}

/* Base */
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial;
}

/* Sticky footer via CSS Grid: header | main | footer */
html, body { height: 100%; }
body {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
}
.nav-left { display: flex; align-items: center; gap: .6rem; }
.logo { width: 40px; height: auto; object-fit: contain; }
.brand {
  color: var(--brand);
  font-family: var(--brand-font);
  font-weight: var(--brand-weight);
  font-size: 1.3rem;
  letter-spacing: .3px;
  text-decoration: none;
  /* subtle glow similar to the Flask UI title */
  text-shadow: 0 0 22px rgba(0, 190, 190, .28), 0 2px 4px rgba(0, 0, 0, .12);
}
.nav-links { display: flex; align-items: center; gap: 1rem; white-space: normal; } /* avoid literal \n rendering */
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav-links a.active, .nav-links a:hover { color: var(--text); }
#theme-toggle {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: .35rem .55rem; border-radius: 10px; cursor: pointer;
}

/* Layout helpers */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; }
.container.wide { max-width: 1600px; }                 /* wider content for big screenshots */
.grid { display: grid; gap: 1.25rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); }
.mt { margin-top: 1rem; }
/* utility used on Uninstall page for extra spacing */
.mt-3lines { margin-top: 3rem; }
@supports (margin-top: 1lh) { .mt-3lines { margin-top: 3lh; } }

/* Hero */
.hero { padding: 3rem 1rem 2rem; }
.hero.no-haze { background: none; }
.hero-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; gap: 2rem; grid-template-columns: 1.15fr .85fr; align-items: center;
}
.hero-copy h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 .4rem; }
.subtitle { color: var(--muted); margin-bottom: 1rem; }
.hero-actions { display: flex; gap: .8rem; }
.btn {
  display: inline-block; padding: .7rem 1rem; border-radius: 12px;
  font-weight: 700; text-decoration: none; border: 1px solid var(--border);
}
.btn-primary { background: var(--accent); color: #001312; border-color: color-mix(in oklab, var(--accent-2) 60%, var(--accent) 40%); }
.btn-primary:hover { background: var(--accent-2); color: #001312; }
.btn-secondary { background: transparent; color: var(--text); }
.hero-logo { width: 100%; max-width: 420px; filter: drop-shadow(0 0 50px color-mix(in oklab, var(--accent) 30%, transparent)); }

.stack-note { margin-top: .6rem; color: var(--muted); font-size: .9rem; }

/* Features */
.features h2 { text-align: center; margin-bottom: .5rem; }
.features-grid {
  list-style: none; padding: 0; margin: 1rem auto 0;
  display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
  max-width: 1000px;
}
.features-grid li {
  background: var(--panel); border: 1px solid var(--border);
  padding: 1rem; border-radius: 16px; display: flex; gap: .6rem; align-items: start;
}
.features-grid li span { font-size: 1.2rem; }

/* Cards and code blocks */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 1rem; }
.codeblock { background: var(--code); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem; overflow-x: auto; }
.copy-wrap { position: relative; }
.copy-btn {
  position: absolute; top: 6px; right: 6px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 10px; padding: .25rem .55rem; cursor: pointer;
}
.copy-btn.copied { background: var(--accent); color: #001312; border-color: var(--accent-2); }
.small { font-size: .9rem; }
.muted { color: var(--muted); }

/* Gallery – show full image, no cropping */
.gallery .shot { margin: 0; }
.gallery .shot img {
  width: 100%;
  height: auto;                 /* keep aspect ratio */
  object-fit: contain;          /* no cropping */
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);        /* neutral backdrop for transparent PNGs */
}

/* Default gallery layout: big tiles (2 cols on desktop, 1 on small) */
.gallery {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  align-items: start;
}

/* Screenshots page (stacked, larger, one per row) + clear separation */
.gallery.stacked {
  grid-template-columns: 1fr;      /* single column */
  gap: 2.2rem;
}
.gallery.stacked .shot {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
}

/* Caption ABOVE the image (top label) */
.gallery .shot .cap-top {
  margin: .25rem .25rem .9rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

/* Optional bottom caption style (if ever used) */
.gallery .shot figcaption {
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
  margin-top: .4rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.25rem;
  color: var(--muted);
}
footer a:link, footer a:visited {
  color: var(--muted);
  text-decoration: none;
}
footer a:hover {
  color: var(--text);
  text-decoration: underline;
}
