/* Shared design system and layout used by the static site template pages */
:root {
  color-scheme: dark;
  --c-bg:          #08111b;
  --c-surface:     #0d1826;
  --c-surface-alt: #122033;
  --c-border:      #18283a;
  --c-border-alt:  #29425f;
  --c-rule:        #132131;
  --c-muted:       #203247;
  --c-dim:         #4d6784;
  --c-subtle:      #7e96b0;
  --c-body:        #cfdae7;
  --c-heading:     #f2f7fb;
  --c-accent:      #60a5fa;
  --c-warning:     #f59e0b;
  --c-danger:      #ef4444;
  --c-grid-line:   rgba(125, 160, 196, .06);
  --c-vignette:    var(--c-bg);
  --c-scan-line:   rgba(96, 165, 250, .16);
  --c-panel-start: rgba(18, 32, 51, .94);
  --c-panel-end:   rgba(11, 23, 37, .94);
  --c-toggle-track:#102031;
  --c-toggle-knob: #dbeafe;
  --c-icon-surface:#102031;
  --c-icon-border: var(--c-muted);
  --c-local:       #cbd5e1;
  --c-local-glow:  rgba(203, 213, 225, .35);

  --ff-sans:  'DM Sans', sans-serif;
  --ff-mono:  'JetBrains Mono', monospace;

  --fs-2xs:   10px;
  --fs-xs:    11px;
  --fs-sm:    13px;
  --fs-xl:    32px;

  --radius:   6px;
  --ease:     .15s ease;
  --stagger:  50ms;
}

:root[data-theme="light"] {
  color-scheme: light;
  --c-bg:          #f4f8fc;
  --c-surface:     #ffffff;
  --c-surface-alt: #edf4fb;
  --c-border:      #d8e4f0;
  --c-border-alt:  #b9cadc;
  --c-rule:        #d8e4f0;
  --c-muted:       #dbe7f2;
  --c-dim:         #6b8198;
  --c-subtle:      #486178;
  --c-body:        #203244;
  --c-heading:     #0d1a27;
  --c-accent:      #2563eb;
  --c-warning:     #b7791f;
  --c-danger:      #dc2626;
  --c-grid-line:   rgba(78, 111, 145, .08);
  --c-vignette:    #dde9f5;
  --c-scan-line:   rgba(37, 99, 235, .16);
  --c-panel-start: rgba(255, 255, 255, .96);
  --c-panel-end:   rgba(237, 244, 251, .96);
  --c-toggle-track:#d7e6f7;
  --c-toggle-knob: #2563eb;
  --c-icon-surface:#eef5fc;
  --c-icon-border: #c5d8eb;
  --c-local:       #64748b;
  --c-local-glow:  rgba(100, 116, 139, .35);
}

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

body {
  background: var(--c-bg);
  color: var(--c-body);
  font-family: var(--ff-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  transition: background-color var(--ease), color var(--ease);
}

a,
a:visited {
  color: var(--c-dim);
  text-decoration: none;
}

a:hover,
a:active {
  color: var(--c-subtle);
}

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--c-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 38%, var(--c-vignette) 100%);
  pointer-events: none;
}

.scan-line {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--c-scan-line);
  animation: scan 8s linear infinite;
  pointer-events: none;
}

@keyframes scan {
  0%   { top: 0;      opacity: 1; }
  95%  { top: 100vh;  opacity: .2; }
  100% { top: 100vh;  opacity: 0; }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1;  box-shadow: 0 0 6px var(--c-accent); }
  50%      { opacity: .6; box-shadow: 0 0 12px var(--c-accent); }
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1000px;
  padding: 48px 32px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

.header,
.status-bar,
.footer,
.site-footer {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--c-subtle);
}

.header,
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

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

.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 6px var(--c-accent);
  animation: pulse-glow 3s ease-in-out infinite;
  flex-shrink: 0;
}

.hero {
  margin-bottom: 40px;
  border-left: 1px solid var(--c-muted);
  padding-left: 16px;
}

.label {
  font-family: var(--ff-mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-dim);
}

.hero .label {
  margin-bottom: 8px;
}

.hero-title {
  font-size: var(--fs-xl);
  font-weight: 300;
  color: var(--c-heading);
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--c-subtle);
  line-height: 1.7;
}

.hero-subtitle .highlight {
  color: var(--c-accent);
}

.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.content-stack {
  display: grid;
  gap: 16px;
}

.content-panel {
  border: 1px solid var(--c-border);
  background:
    linear-gradient(180deg, var(--c-panel-start) 0%, var(--c-panel-end) 100%);
  border-radius: var(--radius);
  padding: 18px 20px;
  animation: card-enter .28s ease both;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  color: var(--c-body);
  cursor: pointer;
  user-select: none;
  transition: color var(--ease);
}

.theme-toggle-label,
.theme-toggle-value {
  font-family: var(--ff-mono);
  font-size: var(--fs-2xs);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.theme-toggle-label {
  color: var(--c-dim);
}

.theme-toggle-value {
  min-width: 38px;
  color: var(--c-subtle);
}

.theme-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-toggle-slider {
  position: relative;
  width: 38px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--c-border-alt);
  background: var(--c-toggle-track);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: background-color var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.theme-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c-toggle-knob);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  transition: transform var(--ease), background-color var(--ease), box-shadow var(--ease);
}

.theme-toggle-input:checked + .theme-toggle-slider .theme-toggle-knob {
  transform: translateX(18px);
}

.theme-toggle-input:focus-visible + .theme-toggle-slider {
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .16);
}

.content-title {
  font-size: 18px;
  font-weight: 400;
  color: var(--c-heading);
  letter-spacing: -.02em;
  margin-bottom: 10px;
}

.content-copy {
  color: var(--c-body);
  line-height: 1.75;
}

.content-copy strong {
  color: var(--c-heading);
  font-weight: 500;
}

.content-list {
  list-style: none;
  display: grid;
  gap: 10px;
  color: var(--c-body);
  line-height: 1.7;
}

.content-list li {
  position: relative;
  padding-left: 16px;
}

.content-list li::before {
  content: '';
  position: absolute;
  top: .72em;
  left: 0;
  width: 6px;
  height: 1px;
  background: var(--c-accent);
  box-shadow: 0 0 6px rgba(74, 222, 128, .5);
}

.content a,
.content a:visited {
  color: var(--c-heading);
}

.content a:hover,
.content a:active {
  color: var(--c-accent);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-rule);
}

.footer,
.site-footer {
  padding-top: 20px;
  border-top: 1px solid var(--c-rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.footer a,
.site-footer a {
  color: inherit;
  text-decoration: none;
  transition: color var(--ease);
}

.footer a:hover,
.site-footer a:hover {
  color: var(--c-body);
}

@media (max-width: 540px) {
  .container { padding: 32px 20px; }

  .header,
  .status-bar,
  .footer,
  .site-footer {
    margin-bottom: 28px;
    font-size: var(--fs-2xs);
    gap: 8px;
  }

  .status-meta {
    gap: 8px;
  }

  .theme-toggle {
    margin-left: 0;
  }

  .hero { margin-bottom: 28px; }
  .hero-title { font-size: 24px; }
  .hero-subtitle { font-size: var(--fs-2xs); }
  .content { margin-bottom: 28px; }
  .content-grid { grid-template-columns: 1fr; }
  .content-panel { padding: 16px; }

  .footer,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (min-width: 541px) and (max-width: 680px) {
  .container { padding: 40px 24px; }
}