/* ==========================================================================
   Wybthon demo template stylesheet.

   The Python components in app/ reference these classes via `class_=` props.
   Design tokens live on :root; restyle the whole site by editing them.
   ========================================================================== */

/* ----- Reset + tokens ----------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-0: #0b0f1a;
  --bg-1: #0e1424;
  --surface: #101625;
  --surface-2: #151d31;
  --border-1: #1f2a44;
  --border-2: #2c3a5e;

  --text-1: #e8edf7;
  --text-2: #aeb9d4;
  --text-3: #66708c;

  --accent: #16aee3;      /* Wybthon logo blue */
  --accent-2: #f8de4e;    /* Wybthon logo yellow */
  --accent-soft: rgba(22, 174, 227, 0.14);
  --good: #3ddc97;
  --error: #ff5d7a;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 18px 48px rgba(0, 0, 0, 0.45);

  --font-sans: "Inter", "InterVariable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular,
    "SF Mono", Menlo, Consolas, monospace;

  --max-w: 1080px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-1);
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(22, 174, 227, 0.18), transparent 60%),
    radial-gradient(700px 420px at 0% 0%, rgba(248, 222, 78, 0.07), transparent 55%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 60%, var(--bg-0));
  background-attachment: fixed;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 0.12em 0.4em;
  color: var(--accent-2);
}

.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* ----- Loading overlay ----------------------------------------------------- */

#loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  background: var(--bg-0);
  transition: opacity 0.4s ease;
}

#loading.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-logo {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft), 0 0 42px rgba(22, 174, 227, 0.25);
}

.loading-label {
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--text-2);
}

.loading-progress {
  width: min(320px, 70vw);
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  overflow: hidden;
}

#loading-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}

.loading-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-3);
  min-height: 1.4em;
}

/* ----- No-JavaScript wall --------------------------------------------------- */

.noscript-wall {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
  background: var(--bg-0);
}

.noscript-card {
  max-width: 46ch;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 2rem;
}

.noscript-card h1 {
  margin-bottom: 0.6rem;
  font-size: 1.3rem;
}

.noscript-card p {
  color: var(--text-2);
}

/* ----- Header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 26, 0.8);
  border-bottom: 1px solid var(--border-1);
}

.site-header .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--text-1);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
}

.brand .tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-3);
  border-left: 1px solid var(--border-2);
  padding-left: 0.6rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-links a {
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
}

.nav-links a:hover {
  color: var(--text-1);
  background: var(--surface-2);
  text-decoration: none;
}

.nav-links a.cta {
  color: #06121f;
  background: var(--accent);
  font-weight: 700;
}

.nav-links a.cta:hover {
  background: #3cc0ef;
}

/* ----- Hero ------------------------------------------------------------------ */

.hero {
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(1.5rem, 4vw, 2.5rem);
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(22, 174, 227, 0.35);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 21ch;
}

.hero h1 .grad {
  background: linear-gradient(92deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin-top: 1rem;
  max-width: 62ch;
  font-size: 1.06rem;
  color: var(--text-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.6rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
  font-size: 0.85rem;
  color: var(--text-3);
}

/* ----- Buttons + pills --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #06121f;
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #3cc0ef;
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1.1rem;
}

.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
}

.pill.good {
  color: var(--good);
  border-color: rgba(61, 220, 151, 0.4);
}

/* ----- Cards / demo panels ------------------------------------------------------ */

.section-block {
  padding-block: clamp(1.25rem, 3vw, 2rem);
}

.section-title {
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}

.section-sub {
  color: var(--text-3);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  max-width: 68ch;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.card-sub {
  color: var(--text-3);
  font-size: 0.88rem;
  margin-bottom: 1.1rem;
}

.control-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-block: 0.75rem;
}

.reactive-line {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-3);
  line-height: 2;
}

.value {
  display: inline-block;
  min-width: 1.5ch;
  text-align: center;
  color: var(--accent-2);
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 0.05em 0.45em;
  margin-inline: 0.15em;
}

.value.blue {
  color: var(--accent);
}

.value.green {
  color: var(--good);
}

input[type="text"] {
  font: inherit;
  width: 100%;
  color: var(--text-1);
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

/* ----- "How it works" steps -------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  counter-reset: step;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(22, 174, 227, 0.35);
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.step h3 {
  font-size: 0.98rem;
  margin-bottom: 0.3rem;
}

.step p {
  font-size: 0.86rem;
  color: var(--text-3);
}

/* ----- File list ("make it yours") --------------------------------------------------- */

.file-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.file-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  color: var(--text-2);
}

.file-list code {
  background: var(--surface-2);
}

/* ----- Footer -------------------------------------------------------------------------- */

.site-footer {
  margin-top: clamp(2rem, 6vw, 4rem);
  border-top: 1px solid var(--border-1);
  padding-block: 1.75rem 2.25rem;
}

.site-footer .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-3);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ----- Accessibility + small screens ------------------------------------------------------ */

.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;
}

@media (max-width: 560px) {
  .brand .tag {
    display: none;
  }

  .nav-links a {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }

  .card {
    padding: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  #loading,
  #loading-bar,
  .btn {
    transition: none;
  }
}
