/* Cosmic Hardware: /journal and /journal-thanks. Standalone; tokens and base copied from deck.css. */
:root {
  --bg: #040404;
  --head: #E8E8EC;
  --body: #B9BEC6;
  --label: #787C82;
  --accent: #5FE3D0;
  --edge: rgba(185, 190, 198, 0.3);
  --glow-accent: rgba(95, 227, 208, 0.28);
  --glow-accent-strong: rgba(95, 227, 208, 0.5);
  --control-height: 48px;
  --strip-height: 24px;
  --frame-inset: 18px;
  --content-max: 560px;
  --gutter: 28px;
  --duration-fast: 150ms;
  --panel: rgba(4, 4, 4, 0.82);
  --panel-bleed: 8px;
  --bracket: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 56px 0;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M60 0H0V60' fill='none' stroke='rgba(185,190,198,0.05)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 60px 60px;
  color: var(--body);
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

/* Frame and strips */
.frame { position: fixed; inset: var(--frame-inset); border: 1px solid var(--edge); pointer-events: none; z-index: 1; }
.frame i { position: absolute; width: 12px; height: 12px; border: 0 solid var(--body); }
.frame i:nth-child(1) { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.frame i:nth-child(2) { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.frame i:nth-child(3) { bottom: -1px; left: -1px; border-bottom-width: 1px; border-left-width: 1px; }
.frame i:nth-child(4) { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

.strip {
  position: fixed; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: space-between; gap: 12px;
  height: var(--strip-height);
  padding: 0 calc(var(--frame-inset) + 8px);
  background: var(--bg);
  color: var(--label);
  font-size: 10px; line-height: var(--strip-height);
  letter-spacing: 0.3em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden;
}
.strip-top { top: 0; }
.strip-bottom { bottom: 0; }

/* Layout */
main {
  position: relative; z-index: 0;
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
section {
  margin: 0 calc(var(--panel-bleed) * -1);
  padding: 40px var(--panel-bleed);
  border-top: 1px solid var(--label);
  background: var(--panel);
}
section:first-child { border-top: 0; padding-top: 24px; }

h1, h2, h3 {
  margin: 0; color: var(--head); font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em; overflow-wrap: anywhere;
}
h1 { font-size: clamp(24px, 7.2vw, 44px); line-height: 1.15; }
h2 { font-size: 14px; color: var(--label); font-weight: 500; letter-spacing: 0.3em; }
h3 { font-size: 14px; }

.label {
  margin: 0; color: var(--label); font-size: 10px; font-weight: 500;
  letter-spacing: 0.3em; text-transform: uppercase;
}
.eyebrow { margin-bottom: 16px; }
.sub { margin: 16px 0 16px; color: var(--body); font-size: 15px; }
.specs { margin: 0 0 24px; line-height: 1.8; }
.price {
  margin: 0 0 16px; color: var(--head); font-weight: 800; letter-spacing: 0.06em;
  font-size: clamp(20px, 3vw, 28px); line-height: 1.2; text-transform: uppercase;
}
.micro { margin: 12px 0 0; color: var(--label); font-size: 11px; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Buttons (anchors) */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--control-height); padding: 0 24px;
  border: 1px solid var(--edge); border-radius: 2px;
  background: transparent; color: var(--head);
  font: inherit; font-size: 13px; font-weight: 800;
  letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; text-align: center;
  cursor: pointer;
  transition: color var(--duration-fast), border-color var(--duration-fast), background-color var(--duration-fast), box-shadow var(--duration-fast);
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); box-shadow: 0 0 14px var(--glow-accent); }
.btn-primary:hover { color: var(--bg); border-color: var(--head); box-shadow: 0 0 24px var(--glow-accent-strong); }
.btn-outline { border-color: var(--accent); color: var(--accent); }
.btn-outline:hover { color: var(--head); border-color: var(--head); }
.btn:focus-visible, a:focus-visible, .previews:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
@media (max-width: 479px) { .actions .btn { width: 100%; } }

/* Hero */
.hero { display: grid; gap: 32px; }
.hero-cover { margin: 0; justify-self: center; width: 100%; max-width: 320px; }
.cover-frame { position: relative; padding: 8px; border: 1px solid var(--edge); background: var(--bg); }
.cover-frame img { display: block; width: 100%; height: auto; }
.cover-frame::before, .cover-frame::after {
  content: ""; position: absolute; width: var(--bracket); height: var(--bracket);
  border: 0 solid var(--accent);
}
.cover-frame::before { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.cover-frame::after { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

/* Preview strip */
.previews {
  display: flex; gap: 12px; margin: 16px 0 0; padding: 0 0 12px; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory;
}
.previews li { flex: 0 0 160px; scroll-snap-align: start; }
.previews figure { margin: 0; }
.previews img { display: block; width: 160px; height: auto; border: 1px solid var(--edge); background: var(--head); }
.previews figcaption { margin-top: 8px; color: var(--label); font-size: 10px; letter-spacing: 0.3em; }

/* Numbered rows */
.rows { margin: 16px 0 0; padding: 0; list-style: none; }
.rows li {
  display: grid; grid-template-columns: 40px 1fr; column-gap: 8px;
  padding: 16px 0; border-top: 1px solid var(--edge);
}
.rows li:first-child { border-top: 0; }
.rows .num { color: var(--accent); font-weight: 500; }
.rows p { grid-column: 2; margin: 4px 0 0; }
.rows .src { color: var(--label); font-size: 12px; }
.rows .also .num { color: var(--label); font-size: 10px; letter-spacing: 0.2em; line-height: 2.4; }

.editions { margin: 16px 0 0; display: grid; gap: 16px; }
.edition { padding: 16px; border: 1px solid var(--edge); background: var(--bg); }
.edition p { margin: 8px 0 0; }

/* Thanks page */
.downloads { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.downloads li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.status { margin: 16px 0 0; color: var(--head); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.tips { margin-top: 24px; }
.tips p { margin: 8px 0 0; }
.retry { margin-top: 12px; }
[hidden] { display: none !important; }

/* Footer and links */
.site-footer {
  position: relative;
  width: min(calc(var(--content-max) + 2 * var(--panel-bleed)), calc(100% - 2 * (var(--gutter) - var(--panel-bleed))));
  margin: 0 auto; padding: 24px var(--panel-bleed);
  border-top: 1px solid var(--label); background: var(--panel);
  color: var(--label); font-size: 10px; line-height: 1.7;
}
.site-footer p { margin: 0 0 12px; }
a { color: var(--body); text-decoration: underline; text-underline-offset: 3px; transition: color var(--duration-fast); }
a:hover { color: var(--head); }

/* fx layer (fx.js). Selectors never match with JS off. */
.fx-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 300ms; }
.fx-bg-on .fx-bg { opacity: 1; }
.fx-bg-on body { background-color: transparent; }
.fx-cursor-dot, .fx-cursor-ring { position: fixed; top: 0; left: 0; z-index: 9; pointer-events: none; border-radius: 2px; will-change: transform; }
.fx-cursor-dot { width: 6px; height: 6px; background: var(--head); }
.fx-cursor-ring { width: 32px; height: 32px; border: 1px solid var(--label); transition: border-color var(--duration-fast); }
.fx-cursor-ring.is-link { border-color: var(--accent); }
.fx-cursor-dot.is-hidden, .fx-cursor-ring.is-hidden { opacity: 0; }
.fx-cursor-on, .fx-cursor-on a, .fx-cursor-on button { cursor: none; }

@media (max-width: 479px) {
  .strip { letter-spacing: 0.12em; padding: 0 26px; }
  .strip-tail { display: none; }
}
@media (max-width: 359px) {
  .strip { padding: 0 22px; letter-spacing: 0.1em; font-size: 9px; }
}
@media (min-width: 768px) {
  .editions { grid-template-columns: 1fr 1fr; }
  .previews li { flex-basis: 200px; }
  .previews img { width: 200px; }
}
@media (min-width: 1024px) {
  :root { --content-max: 1040px; }
  section { padding: 48px 24px; }
  .hero { grid-template-columns: 6fr 5fr; grid-template-areas: "cover copy"; align-items: center; gap: 56px; }
  .hero-copy { grid-area: copy; }
  .hero-cover { grid-area: cover; max-width: 400px; }
  .previews { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; overflow: visible; }
  .previews li { flex: none; }
  .previews img { width: 100%; }
  .rows li { grid-template-columns: 56px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, .btn, a, .fx-bg, .fx-cursor-ring { transition: none; scroll-behavior: auto; }
}
