/* Klef Labs — design tokens and shared layout.
   Palette: cool graphite ground, warm amber signal accent —
   the machine and its indicator light. */

:root {
  --bg: #0b0e13;
  --bg-elevated: #12151c;
  --text: #e9e7e2;
  --text-muted: #8a8f99;
  --text-faint: #565b64;
  --accent: #e0913f;
  --accent-soft: rgba(224, 145, 63, 0.14);
  --border: rgba(255, 255, 255, 0.09);
  --node-dot: rgba(224, 145, 63, 0.4);
  --node-line: rgba(138, 143, 153, 0.16);

  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f5f0;
    --bg-elevated: #ffffff;
    --text: #181a1f;
    --text-muted: #6b6f76;
    --text-faint: #9a9ea5;
    --accent: #b5661e;
    --accent-soft: rgba(181, 102, 30, 0.1);
    --border: rgba(0, 0, 0, 0.09);
    --node-dot: rgba(181, 102, 30, 0.32);
    --node-line: rgba(60, 64, 70, 0.14);
    color-scheme: light;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0e13;
  --bg-elevated: #12151c;
  --text: #e9e7e2;
  --text-muted: #8a8f99;
  --text-faint: #565b64;
  --accent: #e0913f;
  --accent-soft: rgba(224, 145, 63, 0.14);
  --border: rgba(255, 255, 255, 0.09);
  --node-dot: rgba(224, 145, 63, 0.4);
  --node-line: rgba(138, 143, 153, 0.16);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f5f0;
  --bg-elevated: #ffffff;
  --text: #181a1f;
  --text-muted: #6b6f76;
  --text-faint: #9a9ea5;
  --accent: #b5661e;
  --accent-soft: rgba(181, 102, 30, 0.1);
  --border: rgba(0, 0, 0, 0.09);
  --node-dot: rgba(181, 102, 30, 0.32);
  --node-line: rgba(60, 64, 70, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

#node-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-header,
.site-main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem clamp(1.25rem, 4vw, 3rem);
}

.wordmark {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
}

.wordmark span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 1.75rem);
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem) 2rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.theme-toggle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--text-muted);
  border-color: var(--text-faint);
}

/* Landing hero */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem clamp(1.25rem, 4vw, 3rem);
  max-width: 46rem;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: pulse 2.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .status-dot {
    animation: none;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.hero p {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 34ch;
  margin: 0 0 2.25rem;
}

.contact-line {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  flex-wrap: wrap;
}

.contact-line a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.contact-line a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.contact-line .label {
  color: var(--text-faint);
}

/* Updates page */

.updates-main {
  flex: 1;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 3rem clamp(1.25rem, 4vw, 3rem) 4rem;
}

.updates-main h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

.updates-intro {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 2.5rem;
  max-width: 46ch;
}

.update-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.update-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.update-item time {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-bottom: 0.4rem;
}

.update-item h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.update-item p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

.empty-state {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}
