:root {
  --bg: #f4f6f8;
  --paper: #ffffff;
  --ink: #1f2937;
  --muted: #5b6472;
  --line: #e3e8ef;
  --brand: #2563eb;
  --brand-2: #0f766e;
  --brand-soft: #e0e7ff;
  --ok: #166534;
  --warn: #b45309;
  --radius: 16px;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body[data-theme="dark"] {
  --bg: #0b1220;
  --paper: #111a2c;
  --ink: #e6edf7;
  --muted: #a8b4c8;
  --line: #27344a;
  --brand: #3b82f6;
  --brand-2: #14b8a6;
  --brand-soft: #1e293b;
  --ok: #34d399;
  --warn: #f59e0b;
  --shadow: 0 16px 32px rgba(2, 6, 23, 0.45);
  color-scheme: dark;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background:
    radial-gradient(circle at 95% -5%, #dbeafe 0, transparent 35%),
    radial-gradient(circle at 0% 110%, #dcfce7 0, transparent 34%),
    var(--bg);
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at 95% -5%, #1d3557 0, transparent 35%),
    radial-gradient(circle at 0% 110%, #1f4d4c 0, transparent 34%),
    var(--bg);
}

a { color: inherit; }

.container {
  width: min(1140px, 92%);
  margin: 0 auto;
}

header.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 246, 248, 0.94);
  backdrop-filter: blur(8px);
}

body[data-theme="dark"] header.site-header {
  background: rgba(11, 18, 32, 0.86);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.brand {
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1.25rem;
}

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

.top-links a {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
}

.top-links a.active-link {
  border-color: #c2410c;
  color: #9a3412;
}

body[data-theme="dark"] .top-links a {
  background: rgba(17, 26, 44, 0.95);
}

body[data-theme="dark"] .top-links a.active-link {
  border-color: #60a5fa;
  color: #bfdbfe;
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}

main { padding: 34px 0 56px; }

.hero {
  background: linear-gradient(135deg, #f9fbff, #f5fffb);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
}

body[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #0f172a, #102233);
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.25;
  font-family: inherit;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.85rem, 3.7vw, 3rem); font-weight: 750; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.95rem); margin-bottom: 12px; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }

.home-title {
  color: #1e3a8a;
}

body[data-theme="dark"] .home-title {
  color: #93c5fd;
}

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

.grid {
  display: grid;
  gap: 14px;
}

.grid.cards {
  margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid.cards-four {
  margin-top: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cards-four .card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cards-four .card p {
  margin: 8px 0 14px;
}

.cards-four .card .button {
  margin-top: auto;
  align-self: flex-start;
}

.module-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.module-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  color: #1d4ed8;
  flex-shrink: 0;
}

body[data-theme="dark"] .module-icon {
  background: #1a2a44;
  border: 1px solid #2a426d;
  color: #93c5fd;
}

.module-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-card {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.module-card.in-view {
  opacity: 1;
  transform: translateY(0);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card p { margin: 8px 0 0; }

.panel {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 20px;
}

body[data-theme="dark"] .panel {
  background: var(--paper);
}

.challenge {
  margin-top: 16px;
  border-left: 4px solid #93c5fd;
  padding: 12px 14px;
  background: #eff6ff;
  border-radius: 10px;
}

.challenge strong { color: #1d4ed8; }

body[data-theme="dark"] .challenge {
  border-left: 4px solid #60a5fa;
  background: #15233b;
}

body[data-theme="dark"] .challenge strong {
  color: #93c5fd;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--brand-soft);
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: 0.01em;
}

body[data-theme="dark"] .badge {
  color: #bfdbfe;
}

.task-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

button, .button {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 11px;
  padding: 9px 13px;
  font-weight: 650;
  cursor: pointer;
  transition: all 140ms ease;
  text-decoration: none;
  display: inline-block;
}

body[data-theme="dark"] button,
body[data-theme="dark"] .button {
  background: #1a2439;
  color: var(--ink);
}

button.primary, .button.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

button:hover, .button:hover {
  transform: translateY(-1px);
}

button:disabled, .button:disabled {
  background: #e5e7eb;
  color: #64748b;
  border-color: #cbd5e1;
  cursor: not-allowed;
  opacity: 1;
}

body[data-theme="dark"] button:disabled,
body[data-theme="dark"] .button:disabled {
  background: #334155;
  color: #cbd5e1;
  border-color: #475569;
}

input, select {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}

input::placeholder {
  color: #6b7280;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select {
  border: 1px solid #32435d;
  background: #0f172a;
}

body[data-theme="dark"] input::placeholder {
  color: #7f8ea6;
}

code {
  color: #0f172a;
}

body[data-theme="dark"] code {
  color: #e2e8f0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

.status {
  margin-top: 10px;
  font-weight: 650;
  color: var(--brand-2);
}

.status.warn { color: var(--warn); }
.status.ok { color: var(--ok); }

footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

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

.box {
  border: 1px dashed #9ca3af;
  border-radius: 12px;
  padding: 14px;
  background: #f8fafc;
}

body[data-theme="dark"] .box {
  border: 1px dashed #475569;
  background: #0b1629;
}

.floating-reset {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  border: 1px solid #bfdbfe;
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.26);
}

.hidden { display: none; }

/* Global corporate dark presentation */
body {
  background: #0a1630;
  color: #f8fbff;
}

header.site-header {
  border-bottom-color: #1e355d;
  background: rgba(10, 22, 48, 0.92);
}

.brand {
  color: #f8fbff;
}

.top-links a {
  background: #102346;
  border-color: #28426d;
  color: #d7e2f2;
}

.top-links a.active-link {
  border-color: #74b4ff;
  color: #ffffff;
}

.home-hero {
  text-align: center;
  padding: 72px 28px;
  border-color: #1f355e;
  background: #0f2245;
}

.home-title {
  color: #ffffff;
  max-width: 860px;
  margin: 0 auto;
}

.home-subtitle {
  margin: 18px auto 0;
  max-width: 760px;
  font-size: 1.18rem;
  color: #b7c6de;
}

.home-cta {
  margin-top: 28px;
  font-size: 1rem;
  padding: 12px 20px;
  background: #4f8dff;
  border-color: #6aa4ff;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(79, 141, 255, 0.35);
}

.hero {
  border-color: #1f355e;
  background: #0f2245;
}

.panel,
.card {
  background: #0f2245;
  border-color: #1f355e;
  box-shadow: 0 14px 28px rgba(2, 12, 30, 0.35);
}

.cards-four .card .button.primary {
  background: #4f8dff;
  border-color: #6aa4ff;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(79, 141, 255, 0.3);
}

.cards-four .card .button.primary:hover,
.home-cta:hover {
  background: #6aa4ff;
  border-color: #8ab9ff;
}

h1, h2, h3 {
  color: #f3f7ff;
}

p {
  color: #b7c6de;
}

.module-icon {
  background: #102d58;
  border-color: #284b7c;
  color: #8ebeff;
}

button, .button {
  background: #1a2439;
}

input, select {
  border-color: #32435d;
  background: #0f172a;
}

input::placeholder {
  color: #7f8ea6;
}

code {
  color: #e2e8f0;
}

.box {
  border: 1px dashed #475569;
  background: #0b1629;
}

footer {
  border-top-color: #1f355e;
  color: #9fb2cf;
}

@media (max-width: 720px) {
  .nav-wrap { align-items: flex-start; flex-direction: column; }
  .top-links { max-height: 140px; overflow: auto; }
  .hero { padding: 22px; }
  .floating-reset { right: 12px; bottom: 12px; padding: 9px 12px; }
  .theme-toggle { align-self: flex-start; }
  .home-hero { padding: 52px 20px; }
  .home-subtitle { font-size: 1.03rem; }
}

@media (max-width: 1024px) {
  .grid.cards-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid.cards-four { grid-template-columns: 1fr; }
}
