/* ===========================================================
   Nordkern — design tokens
   Display: Fraunces (idiosyncratic serif, used sparingly)
   Body:    Inter (neutral workhorse)
   Utility: IBM Plex Mono (labels, data, timestamps — ties to
            the actual subject: terminals, configs, logs)
   =========================================================== */

:root {
  --paper:      #f1efe8;
  --paper-raised: #ffffff;
  --ink:        #1c201e;
  --ink-soft:   #585f5a;
  --ink-faint:  #8b918c;
  --line:       #dbd7cc;
  --brass:      #9c6b2e;
  --brass-dim:  #b3854c;
  --teal:       #23474f;
  --radius:     2px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- type ---------- */

.font-display {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
}

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

h1, h2, h3 { font-weight: 400; margin: 0; }

a { color: inherit; }

/* ---------- layout shell ---------- */

.shell { max-width: 920px; margin: 0 auto; padding: 0 6vw; }

header.site {
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
}
header.site .shell {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wordmark {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 19px;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.wordmark em { font-style: normal; color: var(--brass); }

nav.primary a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  text-decoration: none;
  color: var(--ink-soft);
  margin-left: 30px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
nav.primary a:hover,
nav.primary a.active {
  color: var(--ink);
  border-color: var(--brass);
}

/* ---------- hero ---------- */

.hero { padding: 76px 0 12px; }

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--brass);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--brass);
  display: inline-block;
}

h1.hero-head {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 460;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 15ch;
  margin-bottom: 26px;
}

.hero-sub {
  color: var(--ink-soft);
  font-size: 16.5px;
  max-width: 52ch;
  margin-bottom: 40px;
}

/* ---------- signal line (signature element) ---------- */

.signal-wrap { margin: 0 0 8px; }
.signal-line { width: 100%; height: auto; display: block; overflow: visible; }
.signal-line path.route {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
}
.signal-line path.pulse {
  fill: none;
  stroke: var(--brass);
  stroke-width: 1.5;
  stroke-dasharray: 6 220;
  animation: travel 5.5s linear infinite;
}
@keyframes travel {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -820; }
}
.signal-line circle.node {
  fill: var(--paper);
  stroke: var(--ink-faint);
  stroke-width: 1.2;
}
.signal-line circle.ping {
  fill: var(--brass);
  opacity: 0;
  animation: ping 5.5s linear infinite;
}
.signal-line circle.ping:nth-of-type(1) { animation-delay: 0s; }
.signal-line circle.ping:nth-of-type(2) { animation-delay: 0.9s; }
.signal-line circle.ping:nth-of-type(3) { animation-delay: 1.9s; }
.signal-line circle.ping:nth-of-type(4) { animation-delay: 3.0s; }
.signal-line circle.ping:nth-of-type(5) { animation-delay: 4.1s; }
@keyframes ping {
  0%   { opacity: 0; }
  4%   { opacity: 1; }
  14%  { opacity: 0; }
  100% { opacity: 0; }
}

/* ---------- uptime ticker ---------- */

.ticker {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: var(--paper-raised);
  padding: 10px 16px;
  margin-bottom: 64px;
}
.ticker .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4a7c59;
  box-shadow: 0 0 0 3px rgba(74,124,89,0.15);
  flex-shrink: 0;
}
.ticker .val { color: var(--ink); font-weight: 500; }

/* ---------- sections ---------- */

section.block {
  padding: 46px 0;
  border-top: 1px solid var(--line);
}

h2.label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 28px;
}

.prose { max-width: 62ch; }
.prose p { color: var(--ink-soft); margin: 0 0 16px; }
.prose p:last-child { margin-bottom: 0; }

blockquote.pull {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink);
  border-left: 2px solid var(--brass);
  padding-left: 22px;
  margin: 28px 0;
  max-width: 44ch;
}

.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px 40px;
}
.work-item .tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--brass);
  display: inline-block;
  border: 1px solid var(--brass-dim);
  padding: 2px 8px;
  margin-bottom: 12px;
}
.work-item h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  margin-bottom: 6px;
}
.work-item p {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0;
}

.contact-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.contact-row a {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px;
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
}
.contact-note {
  color: var(--ink-faint);
  font-size: 13.5px;
  margin-top: 12px;
}

footer.site {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--ink-faint);
  padding: 30px 0 50px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}

@media (max-width: 640px) {
  header.site .shell { flex-direction: column; align-items: flex-start; gap: 12px; }
  nav.primary a { margin-left: 0; margin-right: 22px; }
  .work-grid { grid-template-columns: 1fr; }
}

/* ---------- dashboard-specific ---------- */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  padding: 24px 26px;
}
.panel.wide { grid-column: 1 / -1; }
.panel h2.label { margin-bottom: 18px; }
.weather-temp {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 44px;
  margin: 0;
  line-height: 1;
}
.weather-desc { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--ink-soft); margin: 8px 0 0; }
.weather-meta { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); margin-top: 16px; }
.fx-row {
  display: flex; justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13.5px; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.fx-row:last-child { border-bottom: none; }
.fx-code { color: var(--ink-soft); }
.fx-val { color: var(--ink); font-weight: 500; }
.news-item { margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.news-item:last-child { margin: 0; padding-bottom: 0; border-bottom: none; }
.news-item a { text-decoration: none; font-size: 14.5px; }
.news-item a:hover { color: var(--brass); }
.news-meta { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--ink-faint); margin-top: 4px; }
.state-loading, .state-error { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--ink-faint); }
.state-error { color: #a14a3f; }

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