/* philtulip.com — a workshop on an orbital station.
   Hull white, deep space, cyan instrument light, signal orange. */

:root {
  --bg: #060911;
  --bg-2: #0b1019;
  --panel: #0f1622;
  --line: #1d2738;
  --line-2: #2c3a52;
  --ink: #e7eef8;
  --ink-2: #a5b3c8;
  --ink-3: #6f7f98;
  --accent: #5fd0ff;
  --accent-dim: #2a7fa6;
  --signal: #ff8a3d;
  --term: #7ff5c8;
  --grow: #e3a3ff;
  --hazard: #ffb340;

  --font-display: "Chakra Petch", "Eurostile", "Arial Narrow", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-read: "Source Serif 4", Georgia, serif;

  --gutter: clamp(16px, 4vw, 40px);
  --radius: 4px;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100dvh;
}

/* Faint stars behind every page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 68% 9%, #cfe6ff 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 42%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 71%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 52% 33%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 83%, #cfe6ff 50%, transparent 51%),
    radial-gradient(1px 1px at 7% 92%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 44% 96%, #fff 50%, transparent 51%);
  background-size: 420px 420px;
}

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #9fe3ff; }

:focus-visible {
  outline: 2px solid var(--hazard);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--hazard);
  color: #111;
  font-weight: 600;
}
.skip-link:focus { top: 8px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Shared bits ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 0.95;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hazard-rule {
  height: 6px;
  border: 0;
  margin: 0;
  background: repeating-linear-gradient(-45deg, var(--signal) 0 10px, #0b1019 10px 20px);
  opacity: 0.85;
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- Inner pages: top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar__home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}
.topbar__home .display { font-size: 22px; }
.topbar__home:hover { color: var(--accent); }

.topbar nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.topbar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topbar nav a:hover,
.topbar nav a[aria-current="page"] { color: var(--accent); }
.topbar nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }

@media (max-width: 520px) {
  .topbar__home .display { font-size: 18px; }
  .topbar nav a { padding: 0 7px; font-size: 12px; letter-spacing: 0.04em; }
}

/* ---------- Inner pages: layout ---------- */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) var(--gutter) 80px;
}

.page-head { margin-bottom: 36px; }
.page-head h1 {
  margin: 8px 0 14px;
  font-size: clamp(48px, 11vw, 104px);
}
.page-head .lede {
  max-width: 60ch;
  color: var(--ink-2);
  margin: 0;
}
.level-mark { color: var(--accent); }

.footer {
  border-top: 1px solid var(--line);
  padding: 22px var(--gutter) 40px;
  color: var(--ink-3);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}
.footer a { color: var(--ink-2); }

/* ---------- Cards (lab + garden lists) ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 18px 18px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms, transform 160ms;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); color: var(--ink); }
.card h2, .card h3 {
  margin: 0;
  font-family: var(--font-read);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.2;
}
.card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.card__meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-3);
}
.card::after {
  /* Rivet in the corner. */
  content: "";
  position: absolute;
  top: 8px; right: 8px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--line-2);
}

.empty-state {
  margin: 0;
  padding: 28px 22px;
  max-width: 560px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--ink-2);
}

/* ---------- Garden ---------- */

.stage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--term);
}
.stage svg { width: 14px; height: 14px; flex: none; }
.stage--budding { color: #c6d86f; }
.stage--evergreen { color: #5fbf8f; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}
.filters legend { padding: 0; margin-bottom: 8px; }
.filters label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
}
.filters input { position: absolute; opacity: 0; pointer-events: none; }
.filters input:checked + span { color: var(--ink); }
.filters label:has(input:checked) { border-color: var(--accent); background: #0d2433; }
.filters label:has(input:focus-visible) { outline: 2px solid var(--hazard); outline-offset: 2px; }

.note {
  max-width: 70ch;
  margin: 0 auto;
}
.note-head h1 {
  font-family: var(--font-read);
  font-weight: 600;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.08;
  margin: 12px 0 16px;
}
.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 12px;
  color: var(--ink-3);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.prose {
  font-family: var(--font-read);
  font-size: 19px;
  line-height: 1.65;
  color: #d6e0ee;
}
.prose h2, .prose h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2.2em 0 0.6em;
}
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1.05em; }
.prose blockquote {
  margin-left: 0;
  padding-left: 18px;
  border-left: 3px solid var(--signal);
  color: var(--ink-2);
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 3px;
}
.prose pre {
  overflow-x: auto;
  padding: 14px;
  background: #04070d;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
}
.prose pre code { background: none; border: 0; padding: 0; color: var(--term); }
.prose img { max-width: 100%; height: auto; }
.prose a.wikilink {
  color: var(--ink);
  text-decoration-color: var(--term);
  text-decoration-style: dotted;
  text-decoration-thickness: 2px;
}
.prose a.wikilink:hover { color: var(--term); }
.prose a.wikilink--missing { color: var(--ink-3); text-decoration: line-through; pointer-events: none; }

.backlinks {
  margin-top: 56px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.backlinks h2 { margin: 0 0 12px; }
.backlinks ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.backlinks a { font-family: var(--font-read); font-size: 18px; }
.backlinks p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }

/* ---------- Comms ---------- */

.channels { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.channel {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  min-height: 84px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}
.channel:hover { border-color: var(--accent-dim); color: var(--ink); }
.channel__icon {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--accent);
}
.channel__icon svg { width: 22px; height: 22px; }
.channel strong { display: block; font-size: 16px; }
.channel span { color: var(--ink-3); font-size: 13px; }
.channel .arrow { color: var(--ink-3); }

.signal {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  margin: 26px 0 0;
}
.signal i {
  display: block;
  width: 4px;
  background: var(--term);
  opacity: 0.8;
  animation: sig 1.6s ease-in-out infinite;
}
@keyframes sig { 0%, 100% { height: 20%; } 50% { height: 100%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
