@font-face { font-family: 'Gloock'; src: url(/assets/fonts/gloock.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Schibsted Grotesk'; src: url(/assets/fonts/schibsted-grotesk.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Martian Mono'; src: url(/assets/fonts/martian-mono.woff2) format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --ink: #0f0c0a;
  --wood: #1a1310;
  --wood-2: #231a15;
  --brass: #c9a25b;
  --brass-hi: #ecd29a;
  --brass-lo: #7d6233;
  --cream: #efe6d4;
  --paper: #e9dfca;
  --muted: #a39682;
  --oxblood: #6b2321;
  --line: rgba(201, 162, 91, 0.22);
  --display: 'Gloock', 'Times New Roman', serif;
  --body: 'Schibsted Grotesk', 'Helvetica Neue', sans-serif;
  --mono: 'Martian Mono', ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font: 400 17px/1.6 var(--body);
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 50;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.9 0 0 0 0 0.75 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--brass-hi); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--cream); }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-weight: 400; margin: 0; }
p { margin: 0; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--brass); color: var(--ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---- Bar ------------------------------------------------------------------ */
.bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font: 400 22px/1 var(--display); letter-spacing: 0.01em; }
.brand-mark { width: 20px; height: 25px; fill: none; stroke: var(--brass); stroke-width: 2.4; }
.brand-mark .slot { fill: var(--brass); stroke: none; }
.bar nav { display: flex; gap: clamp(12px, 2.4vw, 30px); font-size: 14px; letter-spacing: 0.04em; }
.bar nav a { color: var(--muted); text-decoration: none; }
.bar nav a:hover { color: var(--cream); }
.bar nav .gh { color: var(--brass-hi); }
@media (max-width: 720px) { .bar nav a:not(.gh) { display: none; } }

/* ---- The door --------------------------------------------------------------- */
.door {
  position: relative; isolation: isolate;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 120px var(--gutter) 72px;
  text-align: center;
  overflow: hidden;
}
.panel {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(201, 162, 91, 0.13), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 120%, rgba(107, 35, 33, 0.35), transparent 60%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0) 0 46px, rgba(0, 0, 0, 0.18) 46px 47px, rgba(255, 220, 160, 0.025) 47px 48px),
    linear-gradient(180deg, var(--wood-2), var(--wood) 60%, var(--ink));
}
.panel::before, .panel::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  width: min(880px, calc(100% - 2 * var(--gutter)));
  border: 1px solid var(--line);
  border-radius: 2px;
}
.panel::before { top: 88px; bottom: 40px; }
.panel::after { top: 100px; bottom: 52px; width: min(856px, calc(100% - 2 * var(--gutter) - 24px)); border-color: rgba(201, 162, 91, 0.1); }

.peep { margin-bottom: clamp(36px, 6vh, 64px); }
.peep-frame {
  position: relative;
  width: min(520px, calc(100vw - 2 * var(--gutter) - 40px));
  height: 58px;
  margin: 0 auto;
  padding: 7px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass) 45%, var(--brass-lo));
  box-shadow: 0 1px 0 rgba(255, 240, 200, 0.35) inset, 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.peep-frame::before, .peep-frame::after {
  content: ''; position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--brass-hi), var(--brass-lo));
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}
.peep-frame::before { left: -14px; }
.peep-frame::after { right: -14px; }
.peep-view {
  position: relative; height: 100%; overflow: hidden; border-radius: 3px;
  background: #050403;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.9) inset;
  display: flex; align-items: center;
}
.cipher {
  display: block; white-space: nowrap;
  font: 400 13px/1 var(--mono); letter-spacing: 0.08em;
  color: var(--brass);
  text-shadow: 0 0 8px rgba(201, 162, 91, 0.45);
  padding-left: 100%;
  animation: drift 26s linear infinite;
}
@keyframes drift { to { transform: translateX(-100%); } }
.peep-cover {
  position: absolute; inset: 0; border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #8f7140, #b58f4f 40%, #6e5429);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5) inset;
  animation: slide 1.4s cubic-bezier(0.7, 0, 0.2, 1) 0.5s forwards;
}
@keyframes slide { to { transform: translateX(calc(100% - 16px)); } }
.peep-note {
  margin-top: 14px;
  font: 400 11px/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--brass-lo);
  opacity: 0; animation: rise 0.8s ease 1.7s forwards;
}

.door h1 {
  max-width: 17ch;
  font: 400 clamp(2.5rem, 6.2vw, 5.6rem)/1.02 var(--display);
  letter-spacing: -0.012em;
  color: var(--cream);
  text-wrap: balance;
  opacity: 0; animation: rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.9s forwards;
}
.lede {
  max-width: 46ch; margin-top: 26px;
  font-size: clamp(16px, 1.6vw, 19px); color: var(--muted);
  opacity: 0; animation: rise 1s ease 1.15s forwards;
}
.ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 36px; opacity: 0; animation: rise 1s ease 1.3s forwards; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 28px;
  font: 600 15px/1 var(--body); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  border-radius: 2px;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn.brass { color: var(--ink); background: linear-gradient(180deg, var(--brass-hi), var(--brass) 55%, #a8843f); box-shadow: 0 10px 26px rgba(201, 162, 91, 0.22); }
.btn.brass:hover { transform: translateY(-1px); color: var(--ink); }
.btn.line { color: var(--cream); border: 1px solid var(--line); }
.btn.line:hover { border-color: var(--brass); color: var(--brass-hi); }
.specs {
  list-style: none; padding: 0; margin: 56px 0 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px;
  font: 400 12px/1.4 var(--mono); letter-spacing: 0.06em; color: var(--cream);
  opacity: 0; animation: rise 1s ease 1.5s forwards;
}
.specs span { color: var(--brass-lo); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- Sections ----------------------------------------------------------------- */
main > section:not(.door) { width: min(var(--max), 100%); margin: 0 auto; padding: clamp(72px, 11vw, 140px) var(--gutter); }
.kicker { font: 400 clamp(1.05rem, 1.8vw, 1.35rem)/1.3 var(--display); font-style: italic; color: var(--brass); margin-bottom: 10px; }
main h2 { font: 400 clamp(2.2rem, 5vw, 3.8rem)/1.05 var(--display); letter-spacing: -0.01em; }
.sub { margin-top: 18px; max-width: 54ch; color: var(--muted); }

.rule { display: flex; align-items: center; justify-content: center; padding: 0 var(--gutter); }
.rule::before, .rule::after { content: ''; flex: 1; max-width: 420px; height: 1px; background: linear-gradient(90deg, transparent, var(--line)); }
.rule::after { background: linear-gradient(90deg, var(--line), transparent); }
.rule span { width: 9px; height: 9px; margin: 0 16px; transform: rotate(45deg); border: 1px solid var(--brass); }

/* Features */
.grid {
  list-style: none; padding: 0; margin: 56px 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.grid li { position: relative; padding: 34px 32px 40px 0; border-bottom: 1px solid var(--line); }
.grid li + li { }
.grid li:not(:nth-child(3n + 1)) { padding-left: 32px; border-left: 1px solid var(--line); }
.num { display: block; font: 400 15px/1 var(--display); color: var(--brass); letter-spacing: 0.12em; margin-bottom: 22px; }
.grid h3 { display: flex; align-items: center; gap: 10px; font: 400 26px/1.15 var(--display); margin-bottom: 12px; }
.grid p { color: var(--muted); font-size: 16px; }
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid li:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .grid li:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .grid li, .grid li:nth-child(even) { padding: 28px 0 32px; border-left: 0; }
}

/* Info bubbles */
.info {
  flex: none;
  width: 20px; height: 20px; padding: 0;
  border-radius: 50%; border: 1px solid var(--brass-lo);
  background: transparent; color: var(--brass);
  font: italic 400 12px/1 var(--display); cursor: pointer;
  vertical-align: middle;
}
.info:hover, .info[aria-expanded='true'] { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.tip {
  position: absolute; z-index: 20; left: 0; right: 0; margin-top: 12px;
  max-width: 420px;
  padding: 16px 18px;
  font-size: 14px; line-height: 1.55; color: var(--ink);
  background: var(--paper);
  border-radius: 3px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.tip::before { content: ''; position: absolute; top: -6px; left: var(--ax, 24px); width: 12px; height: 12px; background: var(--paper); transform: rotate(45deg); }
.tip a { color: var(--oxblood); }
.grid .tip { top: auto; }

/* Two views */
.split { display: grid; grid-template-columns: 1fr 1.15fr; margin-top: 56px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.split figure { margin: 0; padding: clamp(22px, 3vw, 36px); min-height: 300px; display: flex; flex-direction: column; }
.split figcaption { font: 400 11px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 26px; }
.device { background: var(--paper); color: var(--ink); }
.device figcaption { color: #8a7a5e; }
.chat { margin-top: auto; margin-bottom: auto; }
.who { font: 500 12px/1 var(--mono); color: var(--oxblood); margin-bottom: 10px; }
.said {
  display: inline-block; max-width: 100%;
  padding: 16px 20px; border-radius: 4px 18px 18px 18px;
  background: #fff8ea; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 10px 24px rgba(60, 40, 10, 0.12);
  font-size: clamp(17px, 2vw, 21px); line-height: 1.4; min-height: 1.4em;
}
.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--oxblood); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.den { background: #070605; color: var(--brass); border-left: 1px solid var(--line); }
.den figcaption { color: var(--brass-lo); }
.meta { margin: 0 0 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; font: 400 12px/1.4 var(--mono); }
.meta dt { color: var(--brass-lo); letter-spacing: 0.08em; }
.meta dd { margin: 2px 0 0; color: var(--cream); overflow-wrap: anywhere; }
.blob {
  font: 400 12.5px/1.75 var(--mono); letter-spacing: 0.04em;
  color: var(--brass); word-break: break-all;
  text-shadow: 0 0 10px rgba(201, 162, 91, 0.25);
  min-height: 7em;
}
.blob .fresh { color: var(--brass-hi); }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .den { border-left: 0; border-top: 1px solid var(--line); }
  .split figure { min-height: 220px; }
}

.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); margin-top: 64px; }
.ledger h3 { font: 400 26px/1.15 var(--display); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ledger ul { list-style: none; padding: 0; margin: 0; }
.ledger li { padding: 14px 0 14px 26px; position: relative; border-bottom: 1px solid rgba(201, 162, 91, 0.1); color: var(--muted); font-size: 16px; }
.ledger li::before { content: ''; position: absolute; left: 2px; top: 23px; width: 8px; height: 8px; transform: rotate(45deg); border: 1px solid var(--brass-lo); }
.ledger > div:last-child li { color: var(--cream); }
.ledger > div:last-child li::before { background: var(--brass); border-color: var(--brass); }
@media (max-width: 720px) { .ledger { grid-template-columns: 1fr; } }

.disclose { margin-top: 48px; display: grid; gap: 14px; padding: 24px 26px; border-left: 3px solid var(--oxblood); background: rgba(107, 35, 33, 0.14); border-radius: 0 3px 3px 0; }
.disclose p { font-size: 15.5px; color: var(--cream); }
.disclose strong { font-weight: 600; color: var(--brass-hi); }

/* Entry */
.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 48px; }
.ways article {
  position: relative;
  padding: 30px 28px 34px;
  background: linear-gradient(180deg, rgba(201, 162, 91, 0.07), rgba(201, 162, 91, 0.015));
  border: 1px solid var(--line);
  border-radius: 999px 999px 3px 3px / 140px 140px 3px 3px;
  padding-top: 64px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.ways article:hover { border-color: var(--brass); transform: translateY(-3px); }
.ways article::before {
  content: ''; position: absolute; top: 26px; left: 50%; width: 46px; height: 6px; margin-left: -23px; border-radius: 3px;
  background: var(--brass-lo); box-shadow: 0 0 0 3px rgba(201, 162, 91, 0.12);
}
.ways h3 { display: flex; align-items: center; justify-content: center; gap: 10px; font: 400 25px/1.2 var(--display); text-align: center; margin-bottom: 12px; }
.ways p { color: var(--muted); text-align: center; font-size: 16px; }
.ways .tip { top: 100%; margin-top: 10px; text-align: left; }
@media (max-width: 860px) { .ways { grid-template-columns: 1fr; max-width: 460px; } }

/* Install */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 48px 0 0; display: grid; gap: 0; }
.steps li {
  position: relative; counter-increment: step;
  display: grid; grid-template-columns: 76px 1fr; column-gap: 8px;
  padding: 28px 0; border-top: 1px solid var(--line);
}
.steps li::before { content: counter(step); grid-row: span 3; font: 400 44px/0.9 var(--display); color: var(--brass); }
.steps h3 { display: flex; align-items: center; gap: 10px; font: 400 26px/1.2 var(--display); margin-bottom: 10px; }
.steps p { color: var(--muted); }
.steps .tip { position: relative; margin-top: 16px; grid-column: 2; }
.term {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 16px 16px 16px 20px;
  background: #070605; border: 1px solid var(--line); border-radius: 3px;
}
.term code { flex: 1; min-width: 0; font: 400 14px/1.6 var(--mono); color: var(--brass-hi); overflow-wrap: anywhere; }
.term code::before { content: '$ '; color: var(--brass-lo); }
.copy {
  flex: none; min-height: 36px; padding: 0 14px;
  background: transparent; color: var(--cream); border: 1px solid var(--line); border-radius: 2px;
  font: 600 12px/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
}
.copy:hover { border-color: var(--brass); color: var(--brass-hi); }
@media (max-width: 600px) {
  .steps li { grid-template-columns: 1fr; }
  .steps li::before { grid-row: auto; font-size: 34px; margin-bottom: 10px; }
  .steps .tip { grid-column: 1; }
  .term { flex-direction: column; align-items: stretch; }
}

.alt { margin-top: 14px; font-size: 14px; color: var(--muted); }
.alt code, .steps p code { font: 400 13px/1.6 var(--mono); color: var(--brass-hi); overflow-wrap: anywhere; }
.cmds { margin: 18px 0 0; display: grid; gap: 0; border-top: 1px solid rgba(201, 162, 91, 0.12); }
.cmds div { display: grid; grid-template-columns: minmax(0, 15rem) 1fr; gap: 4px 20px; padding: 10px 0; border-bottom: 1px solid rgba(201, 162, 91, 0.12); }
.cmds dt code { font: 400 13px/1.6 var(--mono); color: var(--brass-hi); }
.cmds dd { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 600px) { .cmds div { grid-template-columns: 1fr; } }

/* Source */
.repo {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 36px; padding: clamp(22px, 4vw, 40px) 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font: 400 clamp(1.4rem, 4.4vw, 3.2rem)/1.1 var(--display); color: var(--cream); text-decoration: none;
  overflow-wrap: anywhere;
}
.repo .arrow { color: var(--brass); transition: transform 0.25s ease; }
.repo:hover { color: var(--brass-hi); }
.repo:hover .arrow { transform: translateX(8px); }
.links { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 12px 32px; font-size: 15px; }

.coda {
  text-align: center;
  padding: clamp(40px, 10vw, 120px) var(--gutter) clamp(60px, 12vw, 140px);
  font: 400 clamp(2.6rem, 9vw, 7.5rem)/1 var(--display);
  color: transparent;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass) 50%, var(--brass-lo));
  -webkit-background-clip: text; background-clip: text;
}

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-delay: 0s !important; transition: none !important; }
  .cipher { animation: none; padding-left: 0; }
  .reveal { opacity: 1; transform: none; }
}
