/* =========================================================
   Altair Lab — main.css
   Static site stylesheet. No frameworks, no external assets.
   ---------------------------------------------------------
   1.  Design tokens
   2.  Base & reset
   3.  Layout primitives
   4.  Buttons & form controls
   5.  Header / navigation
   6.  Hero & monitor panel
   7.  Cards & grids
   8.  Infrastructure diagram
   9.  Notes
   10. Status components
   11. Timeline & about
   12. Contact
   13. 404
   14. Footer
   15. Motion & reveal
   16. Responsive
   ========================================================= */

/* ---------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------- */
:root {
  --bg: #0b0f17;
  --bg-secondary: #111827;
  --card: #182231;
  --card-2: #1c2738;
  --border: #223047;
  --border-soft: #1a2536;
  --text: #e8eef8;
  --text-secondary: #98a6bd;
  --text-muted: #6d7c94;
  --accent: #5b9dff;
  --accent-strong: #7db4ff;
  --accent-2: #8b7cf6;
  --success: #3ecf8e;
  --warning: #e2b34a;
  --danger: #f0736a;

  --accent-soft: rgba(91, 157, 255, 0.12);
  --accent-line: rgba(91, 157, 255, 0.35);
  --success-soft: rgba(62, 207, 142, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 30px -14px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.85);
  --glow: 0 0 0 1px rgba(91, 157, 255, 0.18), 0 18px 45px -22px rgba(91, 157, 255, 0.5);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --header-h: 68px;
  --container: 1180px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section-y: clamp(3.5rem, 8vw, 6.5rem);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", "Noto Sans", Arial, "Liberation Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "DejaVu Sans Mono", "Liberation Mono", monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --speed: 220ms;

  --grid-line: rgba(255, 255, 255, 0.035);
  --panel-glass: rgba(17, 24, 39, 0.72);
}

[data-theme="light"] {
  --bg: #f5f8fc;
  --bg-secondary: #eef3f9;
  --card: #ffffff;
  --card-2: #f7fafd;
  --border: #dde5ef;
  --border-soft: #e7edf5;
  --text: #0d1521;
  --text-secondary: #4f5d73;
  --text-muted: #6f7d92;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-2: #6d55e0;
  --success: #0f9d63;
  --warning: #b57d17;
  --danger: #cf4b40;

  --accent-soft: rgba(37, 99, 235, 0.09);
  --accent-line: rgba(37, 99, 235, 0.3);
  --success-soft: rgba(15, 157, 99, 0.12);

  --shadow-sm: 0 1px 2px rgba(15, 30, 60, 0.08);
  --shadow-md: 0 14px 30px -18px rgba(15, 30, 60, 0.3);
  --shadow-lg: 0 30px 60px -34px rgba(15, 30, 60, 0.35);
  --glow: 0 0 0 1px rgba(37, 99, 235, 0.14), 0 18px 45px -26px rgba(37, 99, 235, 0.45);

  --grid-line: rgba(13, 21, 33, 0.05);
  --panel-glass: rgba(255, 255, 255, 0.78);
}

/* ---------------------------------------------------------
   2. Base & reset
   --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 82% -8%, rgba(91, 157, 255, 0.14), transparent 62%),
    radial-gradient(760px 480px at 6% 4%, rgba(139, 124, 246, 0.1), transparent 60%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, auto, 64px 64px, 64px 64px;
  background-attachment: fixed, fixed, scroll, scroll;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.nav-open {
  overflow: hidden;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 650;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}
h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
}
h3 {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

p {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  text-wrap: pretty;
}

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

a:hover {
  color: var(--accent-strong);
}

ul,
ol {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

p code,
li code {
  padding: 0.1em 0.4em;
  color: var(--text);
  background: color-mix(in srgb, var(--bg-secondary) 85%, transparent);
  border: 1px solid var(--border);
  border-radius: 5px;
  white-space: nowrap;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 200;
  padding: 0.7rem 1.1rem;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: top var(--speed) var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* ---------------------------------------------------------
   3. Layout primitives
   --------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-narrow {
  max-width: 820px;
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section-alt {
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--bg-secondary) 70%, transparent) 12%,
    color-mix(in srgb, var(--bg-secondary) 70%, transparent) 88%,
    transparent
  );
}

.section-head {
  max-width: 660px;
  margin-bottom: clamp(1.8rem, 4vw, 2.8rem);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head p {
  margin-bottom: 0;
  font-size: 1.02rem;
}

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.6rem, 4vw, 2.4rem);
}

.section-head-row .section-head {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  padding: 0.32rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
}

.lead {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: var(--text-secondary);
  max-width: 62ch;
}

.grid {
  display: grid;
  gap: clamp(1rem, 2.2vw, 1.35rem);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 232px), 1fr));
}

/* wider tiles — two per row on desktop */
.grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

/* project catalogue — three per row on desktop */
.grid-projects {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.grid > * {
  min-width: 0;
}

.page-header {
  padding-top: calc(var(--header-h) + clamp(2.5rem, 6vw, 4.5rem));
  padding-bottom: clamp(2rem, 5vw, 3rem);
  position: relative;
}

.page-header::after {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

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

.breadcrumb a:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------
   4. Buttons & form controls
   --------------------------------------------------------- */
.btn {
  --btn-bg: var(--card);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.25rem;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--speed) var(--ease), background var(--speed) var(--ease),
    border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
    color var(--speed) var(--ease);
}

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

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

.btn-primary {
  --btn-fg: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  color: #fff;
  filter: brightness(1.06);
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover {
  background: var(--accent-soft);
}

.btn-sm {
  padding: 0.48rem 0.85rem;
  font-size: 0.84rem;
}

.btn-block {
  width: 100%;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

.link-arrow svg {
  width: 15px;
  height: 15px;
  transition: transform var(--speed) var(--ease);
}

.link-arrow:hover svg,
a:hover .link-arrow svg {
  transform: translateX(3px);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.field label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.field .hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.72rem 0.85rem;
  font: inherit;
  font-size: 0.94rem;
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
    background var(--speed) var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  min-height: 160px;
  resize: vertical;
}

/* Filter chips */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
}

.chip {
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--speed) var(--ease);
}

.chip:hover {
  color: var(--text);
  border-color: var(--accent-line);
}

.chip[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

[data-theme="light"] .chip[aria-pressed="true"] {
  color: #fff;
}

.result-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--card) 45%, transparent);
}

.empty-state[hidden] {
  display: none;
}

/* ---------------------------------------------------------
   5. Header / navigation
   --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease), backdrop-filter var(--speed) var(--ease);
}

.site-header.is-scrolled,
.site-header.nav-expanded {
  background: var(--panel-glass);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--text);
  flex: none;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--border);
  transition: border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.brand:hover .brand-mark {
  border-color: var(--accent-line);
  transform: rotate(-6deg);
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand-text .accent {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-link {
  position: relative;
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 550;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--speed) var(--ease), background var(--speed) var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.nav-link.is-active {
  color: var(--text);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
}

.status-pill:hover {
  color: var(--text);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--speed) var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-sun {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: block;
}

[data-theme="light"] .icon-moon {
  display: none;
}

.burger {
  display: none;
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.burger span {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform var(--speed) var(--ease), opacity var(--speed) var(--ease),
    top var(--speed) var(--ease);
}

.burger span:nth-child(1) {
  top: 13px;
}
.burger span:nth-child(2) {
  top: 18px;
}
.burger span:nth-child(3) {
  top: 23px;
}

.burger[aria-expanded="true"] span:nth-child(1) {
  top: 18px;
  transform: rotate(45deg);
}
.burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.burger[aria-expanded="true"] span:nth-child(3) {
  top: 18px;
  transform: rotate(-45deg);
}

.nav-backdrop {
  display: none;
}

/* ---------------------------------------------------------
   6. Hero & monitor panel
   --------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(2.5rem, 7vw, 5rem));
  padding-bottom: clamp(3rem, 8vw, 5.5rem);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: clamp(2.2rem, 5vw, 3.5rem);
  align-items: center;
}

.hero h1 {
  margin-bottom: 1rem;
}

.hero h1 .accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  margin-bottom: 1.8rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.84rem;
  color: var(--text-muted);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* Monitor panel */
.panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--card), var(--bg-secondary));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at 80% -10%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.panel-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

.panel-dots {
  display: flex;
  gap: 0.35rem;
}

.panel-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
}

.panel-dots i:nth-child(1) {
  background: color-mix(in srgb, var(--danger) 60%, var(--border));
}
.panel-dots i:nth-child(2) {
  background: color-mix(in srgb, var(--warning) 60%, var(--border));
}
.panel-dots i:nth-child(3) {
  background: color-mix(in srgb, var(--success) 60%, var(--border));
}

.panel-title {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--success);
  background: var(--success-soft);
  border-radius: var(--radius-pill);
}

.panel-body {
  position: relative;
  padding: 0.5rem 0.75rem 0.9rem;
}

.node-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 0.75rem;
  border-radius: var(--radius);
  transition: background var(--speed) var(--ease);
}

.node-row + .node-row {
  border-top: 1px solid var(--border-soft);
}

.node-row:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.node-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.node-icon svg {
  width: 17px;
  height: 17px;
}

.node-info {
  flex: 1 1 auto;
  min-width: 0;
}

.node-info strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.node-info small {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.node-state {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: 6.5rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--success);
  white-space: nowrap;
}

.spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
  flex: none;
}

.spark i {
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.75;
  animation: sparkPulse 2.6s var(--ease) infinite;
}

@keyframes sparkPulse {
  0%,
  100% {
    transform: scaleY(0.55);
  }
  50% {
    transform: scaleY(1);
  }
}

.panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.7rem 1.15rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.panel-foot .sep {
  color: var(--border);
}

/* Status dot */
.dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--success);
}

.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: pulseRing 2.4s var(--ease) infinite;
}

.dot-accent {
  background: var(--accent);
}
.dot-warning {
  background: var(--warning);
}
.dot-muted {
  background: var(--text-muted);
}
.dot-muted::after {
  display: none;
}

@keyframes pulseRing {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70% {
    transform: scale(2.6);
    opacity: 0;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* ---------------------------------------------------------
   7. Cards & grids
   --------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 2.4vw, 1.6rem);
  background: linear-gradient(165deg, var(--card), color-mix(in srgb, var(--card) 55%, var(--bg)));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, var(--accent-line), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--speed) var(--ease);
  pointer-events: none;
}

.card-hover:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
}

.card-hover:hover::after,
.card-hover:focus-within::after {
  opacity: 1;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 1rem;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.card-icon svg {
  width: 20px;
  height: 20px;
}

.card-foot {
  margin-top: auto;
  padding-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.tag {
  padding: 0.22rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-secondary) 70%, transparent);
}

.badge-active {
  color: var(--success);
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 25%, transparent);
}

.badge-stable {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.badge-experimental {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  border-color: color-mix(in srgb, var(--warning) 28%, transparent);
}

.card .card-meta,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin-bottom: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Metric tiles */
.metric {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1.05rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  transition: border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.metric:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.metric svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}

.metric strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
}

.metric span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  padding: 1.2rem 1.15rem;
  background: var(--bg-secondary);
}

.stat strong {
  display: block;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------------------------------------------------------
   8. Infrastructure diagram
   --------------------------------------------------------- */
.infra-grid {
  display: grid;
  gap: clamp(1.6rem, 4vw, 2.6rem);
  align-items: center;
}

.flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: clamp(1.25rem, 3vw, 1.9rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--card) 40%, var(--bg)));
  box-shadow: var(--shadow-md);
}

.flow-node {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-secondary) 75%, transparent);
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}

.flow-node:hover {
  border-color: var(--accent-line);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.flow-node .node-icon {
  width: 32px;
  height: 32px;
}

.flow-node strong {
  font-size: 0.92rem;
}

.flow-node small {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.flow-node .badge {
  margin-left: auto;
}

.flow-link {
  position: relative;
  width: 2px;
  height: 34px;
  margin-inline: auto;
  background: var(--border);
  overflow: hidden;
}

.flow-link::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 60%;
  top: -60%;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  animation: flowPulse 2.6s linear infinite;
}

.flow-link:nth-of-type(2)::after {
  animation-delay: 0.6s;
}
.flow-link:nth-of-type(3)::after {
  animation-delay: 1.2s;
}

@keyframes flowPulse {
  0% {
    top: -60%;
  }
  100% {
    top: 100%;
  }
}

.flow-caption {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* ---------------------------------------------------------
   9. Notes
   --------------------------------------------------------- */
.note-list {
  display: grid;
  gap: 1rem;
}

.note {
  padding: clamp(1.1rem, 2.4vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(165deg, var(--card), color-mix(in srgb, var(--card) 50%, var(--bg)));
  transition: border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.note:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.note[hidden] {
  display: none;
}

.note-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin-bottom: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.note h3 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.02rem, 2vw, 1.15rem);
}

.note p {
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
}

.note-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
}

.note-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--speed) var(--ease);
}

.note-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.note-detail {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.note-detail[hidden] {
  display: none;
}

.note-detail ul {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.note-detail li {
  position: relative;
  padding-left: 1.1rem;
}

.note-detail li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.note-compact {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 65%, transparent);
  transition: all var(--speed) var(--ease);
}

.note-compact:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.note-compact h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.note-compact p {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

/* ---------------------------------------------------------
   10. Status components
   --------------------------------------------------------- */
.status-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: clamp(1.2rem, 3vw, 1.7rem);
  border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border));
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--success-soft), transparent 65%), var(--card);
  box-shadow: var(--shadow-md);
}

.status-banner .status-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
}

.status-banner .status-icon svg {
  width: 22px;
  height: 22px;
}

.status-banner h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
}

.status-banner p {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}

.status-banner .banner-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

.status-list {
  display: grid;
  gap: 0.9rem;
}

.status-item {
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 72%, transparent);
  transition: border-color var(--speed) var(--ease);
}

.status-item:hover {
  border-color: var(--accent-line);
}

.status-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin-bottom: 0.85rem;
}

.status-item-head h3 {
  margin: 0;
  font-size: 0.98rem;
}

.status-item-head .state {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--success);
}

.status-item-head .desc {
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.uptime-bars {
  display: flex;
  gap: 3px;
  height: 34px;
  margin-bottom: 0.6rem;
}

.uptime-bars i {
  flex: 1 1 auto;
  min-width: 3px;
  border-radius: 3px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--success) 85%, transparent),
    color-mix(in srgb, var(--success) 45%, transparent)
  );
  transition: transform 150ms var(--ease), filter 150ms var(--ease);
}

.uptime-bars i:hover {
  transform: scaleY(1.08);
  filter: brightness(1.3);
}

.uptime-legend {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.uptime-legend .pct {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Compact home widget */
.status-widget {
  padding: clamp(1.1rem, 2.6vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--card), color-mix(in srgb, var(--card) 45%, var(--bg)));
  box-shadow: var(--shadow-md);
}

.status-widget-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-soft);
}

.status-widget-head h3 {
  margin: 0;
  font-size: 1rem;
}

.status-widget-head .badge {
  margin-left: auto;
}

.status-rows {
  display: grid;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0.25rem;
  font-size: 0.9rem;
}

.status-row + .status-row {
  border-top: 1px solid var(--border-soft);
}

.status-row .name {
  color: var(--text);
  font-weight: 550;
}

.status-row .value {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--success);
}

.status-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.notice {
  display: flex;
  gap: 0.8rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.notice svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}

.notice-success {
  border-left-color: var(--success);
}

.notice-success svg {
  color: var(--success);
}

/* ---------------------------------------------------------
   11. Timeline & about
   --------------------------------------------------------- */
.timeline {
  position: relative;
  display: grid;
  gap: 1.35rem;
  max-width: 780px;
  padding-left: 1.9rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
  opacity: 0.55;
}

.timeline-item {
  position: relative;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 68%, transparent);
  transition: border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.timeline-item:hover {
  border-color: var(--accent-line);
  transform: translateX(3px);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.9rem;
  top: 1.35rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.timeline-item .year {
  display: inline-block;
  margin-bottom: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.timeline-item h3 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.timeline-item p {
  margin: 0;
  font-size: 0.9rem;
}

.principle {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 68%, transparent);
  transition: all var(--speed) var(--ease);
}

.principle:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.principle .num {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent);
}

.principle h3 {
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
}

.principle p {
  margin: 0;
  font-size: 0.88rem;
}

.prose > * {
  max-width: 74ch;
}

.prose > * + * {
  margin-top: 1rem;
}

.prose h2 {
  margin-top: 2.4rem;
}

.prose ul {
  display: grid;
  gap: 0.55rem;
}

.prose ul li {
  position: relative;
  padding-left: 1.3rem;
  color: var(--text-secondary);
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---------------------------------------------------------
   12. Contact
   --------------------------------------------------------- */
.contact-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
}

.contact-card {
  display: flex;
  gap: 0.9rem;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  transition: all var(--speed) var(--ease);
}

.contact-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.contact-card .node-icon {
  width: 38px;
  height: 38px;
}

.contact-card strong {
  display: block;
  font-size: 0.92rem;
}

.contact-card a {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  word-break: break-word;
}

.contact-card p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.form-card {
  padding: clamp(1.3rem, 3vw, 1.9rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--card), color-mix(in srgb, var(--card) 45%, var(--bg)));
  box-shadow: var(--shadow-md);
}

.form-row {
  display: grid;
  gap: 0 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.form-message {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--accent-soft);
  font-size: 0.9rem;
  color: var(--text);
  animation: fadeUp 320ms var(--ease) both;
}

.form-message[hidden] {
  display: none;
}

.form-message svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}

/* ---------------------------------------------------------
   13. 404
   --------------------------------------------------------- */
.error-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-h) - 220px);
  padding-block: clamp(3rem, 10vw, 6rem);
  text-align: center;
}

.error-code {
  font-family: var(--font-mono);
  font-size: clamp(4.5rem, 18vw, 9rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.4rem;
}

.error-page .btn-row {
  justify-content: center;
  margin-top: 1.6rem;
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.4rem;
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.88rem;
}

/* ---------------------------------------------------------
   14. Footer
   --------------------------------------------------------- */
.site-footer {
  margin-top: var(--section-y);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-secondary) 60%, transparent);
}

.footer-grid {
  display: grid;
  gap: 2rem;
  padding-block: clamp(2.5rem, 6vw, 3.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.footer-brand {
  max-width: 320px;
}

.footer-brand p {
  margin-top: 0.9rem;
  font-size: 0.88rem;
}

.footer-col h4 {
  margin-bottom: 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.footer-col ul {
  display: grid;
  gap: 0.55rem;
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-bottom p {
  margin: 0;
  color: var(--text-muted);
}

.footer-bottom .meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

/* ---------------------------------------------------------
   15. Motion & reveal
   --------------------------------------------------------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  will-change: opacity, transform;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.js .reveal[data-delay="1"] {
  transition-delay: 70ms;
}
.js .reveal[data-delay="2"] {
  transition-delay: 140ms;
}
.js .reveal[data-delay="3"] {
  transition-delay: 210ms;
}
.js .reveal[data-delay="4"] {
  transition-delay: 280ms;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------
   16. Responsive
   --------------------------------------------------------- */
@media (min-width: 720px) {
  .hero-meta {
    gap: 0.5rem 2rem;
  }
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }

  .infra-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }

  .contact-grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }

  .home-status-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
  }
}

/* Mobile navigation */
@media (max-width: 959px) {
  .burger {
    display: block;
  }

  .header-tools {
    margin-left: auto;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 99;
    display: block;
    margin: 0;
    padding: 1rem var(--gutter) 1.6rem;
    background: var(--bg-secondary);
    background-image: linear-gradient(180deg, var(--accent-soft), transparent 55%);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 240ms var(--ease), transform 240ms var(--ease),
      visibility 240ms var(--ease);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-list {
    display: grid;
    gap: 0.15rem;
  }

  .nav-list li {
    opacity: 0;
    transform: translateY(-6px);
  }

  .nav.is-open .nav-list li {
    animation: fadeUp 300ms var(--ease) forwards;
  }

  .nav.is-open .nav-list li:nth-child(1) {
    animation-delay: 40ms;
  }
  .nav.is-open .nav-list li:nth-child(2) {
    animation-delay: 80ms;
  }
  .nav.is-open .nav-list li:nth-child(3) {
    animation-delay: 120ms;
  }
  .nav.is-open .nav-list li:nth-child(4) {
    animation-delay: 160ms;
  }
  .nav.is-open .nav-list li:nth-child(5) {
    animation-delay: 200ms;
  }
  .nav.is-open .nav-list li:nth-child(6) {
    animation-delay: 240ms;
  }

  .nav-link {
    padding: 0.8rem 0.75rem 0.8rem 1.15rem;
    font-size: 1rem;
    border: 1px solid transparent;
  }

  .nav-link.is-active {
    background: var(--accent-soft);
    border-color: var(--border);
  }

  .nav-link.is-active::after {
    left: 0.5rem;
    right: auto;
    top: 50%;
    bottom: auto;
    width: 3px;
    height: 18px;
    transform: translateY(-50%);
  }

  .nav-actions {
    margin-top: 1rem;
    padding: 1rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--border-soft);
  }

  .nav-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 98;
    background: rgba(3, 6, 12, 0.68);
    opacity: 0;
    visibility: hidden;
    transition: opacity 240ms var(--ease), visibility 240ms var(--ease);
  }

  .nav-backdrop.is-open {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 599px) {
  :root {
    --header-h: 62px;
  }

  body {
    font-size: 15.5px;
  }

  .brand-text {
    font-size: 0.98rem;
  }

  .btn-row .btn {
    flex: 1 1 auto;
  }

  .status-banner .banner-meta {
    margin-left: 0;
    text-align: left;
    width: 100%;
  }

  .panel-foot {
    font-size: 0.68rem;
  }

  .uptime-bars {
    height: 28px;
    gap: 2px;
  }

  .section-head-row {
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .tags {
    gap: 0.3rem;
  }

  .tag {
    font-size: 0.68rem;
  }

  .node-row {
    gap: 0.6rem;
    padding: 0.75rem 0.5rem;
  }

  .spark {
    display: none;
  }
}

/* Print */
@media print {
  .site-header,
  .site-footer,
  .nav-backdrop,
  .btn-row {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
