:root {
  --den-0: #120e0b;
  --den-1: #1a1410;
  --den-2: #241c16;
  --den-3: #2e241c;
  --den-4: #3d3228;
  --hide: #5c4e42;
  --fog: #8a7e72;
  --mist: #c9b8a6;
  --parchment: #f4ede3;
  --cream: #fbf6ee;
  --ink: #1a1410;
  --copper: #c45c26;
  --copper-hot: #e08a3c;
  --copper-dim: #8a3e18;
  --latch: #c9a66b;
  --fern: #4a8a5c;
  --ember: #c44732;
  --online: #5ba86a;
  --line: rgba(92, 78, 66, 0.18);
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-ui: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --shadow-lift: 0 24px 64px rgba(18, 14, 11, 0.18);
  --page: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.55'/></svg>");
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  background: var(--ink);
  color: var(--parchment);
  padding: 8px 12px;
  border-radius: var(--r-sm);
}

.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(var(--page), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

.kicker {
  margin: 0 0 10px;
  color: var(--copper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; }
h1, h2 { font-family: var(--font-display); }
h1 { font-size: clamp(44px, 8vw, 88px); line-height: 0.92; }
h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1.05; }
h3 { font-size: 20px; line-height: 1.25; }

.lede {
  margin: 16px 0 0;
  max-width: 38ch;
  color: var(--hide);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.4;
}

.mono { font-family: var(--font-mono); }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--parchment) 86%, transparent);
  border-bottom: 1px solid var(--line);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  height: 52px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--hide);
  font-size: 14px;
  font-weight: 600;
}

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

.nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--parchment);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--cream);
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 1.5px;
  margin: 0 auto;
  background: var(--ink);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.btn-primary {
  background: var(--copper);
  color: #fff7ef;
}

.btn-primary:hover { background: var(--copper-hot); color: var(--ink); }

.btn-ink {
  background: var(--ink);
  color: var(--parchment);
}

.btn-ink:hover { background: var(--den-4); color: var(--cream); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hide);
}

.btn-ghost:hover { border-color: var(--copper); }

.btn .platform-note {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.82;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: center;
  padding: 28px 0 12px;
}

.hero__copy .kicker { margin-bottom: 14px; }

.hero-mark {
  display: block;
  height: clamp(72px, 11vw, 132px);
  width: auto;
  margin: 0 0 22px;
}

.fine {
  margin: 14px 0 0;
  color: var(--fog);
  font-size: 13px;
}

/* Product window */

.den-window {
  background: var(--den-0);
  color: var(--mist);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  border: 1px solid rgba(18, 14, 11, 0.4);
}

.den-window__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 12px;
  background: var(--den-1);
  border-bottom: 1px solid rgba(92, 78, 66, 0.28);
  font-size: 12px;
  font-weight: 600;
}

.den-window__chrome-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.den-window__chrome-brand img { width: 16px; height: 16px; }

.traffic {
  display: flex;
  gap: 6px;
}

.traffic i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--den-4);
}

.traffic i:nth-child(1) { background: #c44732; }
.traffic i:nth-child(2) { background: #c9a66b; }
.traffic i:nth-child(3) { background: #4a8a5c; }

.den-window__body {
  display: grid;
  grid-template-columns: 56px 156px minmax(0, 1fr);
  min-height: 390px;
}

.den-window .members { display: none; }

.rail, .rooms, .chat, .members {
  min-width: 0;
}

.rail {
  background: var(--den-1);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.den-pip {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--den-3);
  color: var(--mist);
  font-weight: 700;
  font-size: 13px;
}

.den-pip.is-active {
  background: var(--copper);
  color: #fff7ef;
}

.den-pip.is-add {
  background: transparent;
  border: 1px dashed var(--hide);
  color: var(--fog);
}

.rooms {
  background: var(--den-2);
  padding: 16px 12px;
  border-right: 1px solid rgba(92, 78, 66, 0.28);
}

.rooms h3 {
  font-family: var(--font-ui);
  font-size: 16px;
  letter-spacing: 0;
  color: var(--cream);
}

.rooms .meta {
  margin: 2px 0 14px;
  color: var(--fog);
  font-size: 12px;
}

.room-label {
  margin: 12px 0 6px;
  color: var(--fog);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.room {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--fog);
  font-size: 13px;
}

.room.is-active {
  background: var(--den-4);
  color: var(--cream);
}

.chat {
  background: var(--den-3);
  display: flex;
  flex-direction: column;
}

.chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(92, 78, 66, 0.28);
}

.chat__head strong {
  display: block;
  color: var(--cream);
  font-size: 15px;
}

.chat__head span {
  color: var(--fog);
  font-size: 12px;
}

.latch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--copper);
  border: 1px solid rgba(196, 92, 38, 0.35);
}

.chat__stream {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.system {
  color: var(--fog);
  font-size: 12px;
  text-align: center;
}

.msg {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--den-4);
  color: var(--cream);
  font-size: 12px;
  font-weight: 700;
}

.msg b { color: var(--cream); font-size: 14px; }
.msg time { margin-left: 8px; color: var(--fog); font-size: 12px; font-weight: 400; }
.msg p { margin: 2px 0 0; font-size: 14px; line-height: 1.4; color: var(--mist); }

.composer {
  margin: 8px 12px 12px;
  min-height: 44px;
  border-radius: 10px;
  background: var(--den-4);
  color: var(--fog);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 14px;
  font-size: 13px;
}

.composer .send {
  background: var(--copper);
  color: #fff7ef;
  border: 0;
  border-radius: 8px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.members {
  background: var(--den-2);
  padding: 16px 14px;
  border-left: 1px solid rgba(92, 78, 66, 0.28);
  font-size: 13px;
}

.members h4 {
  margin: 0 0 10px;
  color: var(--fog);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.member {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  color: var(--mist);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--online);
}

.dot.idle { background: var(--latch); }
.dot.off { background: var(--hide); }

.aside-note {
  margin-top: 18px;
  padding: 10px;
  border-radius: 8px;
  background: var(--den-1);
  color: var(--fog);
  font-size: 12px;
  line-height: 1.4;
}

.phone {
  display: none;
  width: min(100%, 340px);
  margin: 0 auto;
  background: var(--den-0);
  color: var(--mist);
  border-radius: 28px;
  padding: 10px 10px 18px;
  box-shadow: var(--shadow-lift);
  border: 1px solid rgba(18, 14, 11, 0.4);
}

.phone__notch {
  width: 92px;
  height: 8px;
  margin: 6px auto 10px;
  background: var(--den-3);
  border-radius: 999px;
}

.phone .chat__head { padding: 8px 10px; }
.phone .chat { min-height: 420px; border-radius: 20px; overflow: hidden; }

/* Fox-den fractal skins */

.skulk,
.latch-band,
.site-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.skulk::before,
.latch-band::before,
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.skulk > *,
.latch-band > *,
.site-footer > * {
  position: relative;
  z-index: 1;
}

.skulk--hero::before {
  background-image: url("../img/bg/skulk.jpg");
  opacity: 0.5;
}
.skulk--hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(105deg, rgba(244, 237, 227, 0.9) 0%, rgba(244, 237, 227, 0.58) 46%, rgba(244, 237, 227, 0.2) 100%);
}

.skulk--dens::before {
  background-image: url("../img/bg/bracken.jpg");
  opacity: 0.58;
}
.skulk--dens::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(244, 237, 227, 0.42) 0%, transparent 52%);
}

.skulk--circles::before {
  background-image: url("../img/bg/circles.jpg");
  opacity: 0.3;
}

.skulk--door::before {
  background-image: url("../img/bg/door.jpg");
  opacity: 0.34;
}

.latch-band::before {
  background-image: url("../img/bg/den.jpg");
  opacity: 0.48;
}
.latch-band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(18, 14, 11, 0.38), rgba(18, 14, 11, 0.12) 42%, rgba(18, 14, 11, 0.4));
}

.site-footer::before {
  background-image: url("../img/bg/bracken.jpg");
  opacity: 0.22;
}

.page-inner {
  background-image:
    linear-gradient(rgba(244, 237, 227, 0.82), rgba(244, 237, 227, 0.88)),
    url("../img/bg/bracken.jpg");
  background-size: cover;
  background-position: center top;
}

@media (min-width: 861px) {
  .skulk--dens::before,
  .skulk--circles::before,
  .skulk--door::before,
  .latch-band::before,
  .page-inner {
    background-attachment: fixed;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skulk--dens::before,
  .skulk--circles::before,
  .skulk--door::before,
  .latch-band::before,
  .page-inner {
    background-attachment: scroll;
  }
}

/* Bands */

.band {
  padding: 72px 0;
}

.band-tight { padding: 28px 0 64px; }

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: start;
}

.story p {
  margin: 12px 0 0;
  color: var(--hide);
  max-width: 48ch;
}

.steps {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.step {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
}

.step b {
  display: block;
  font-family: var(--font-mono);
  color: var(--copper);
  font-size: 12px;
  margin-bottom: 4px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.feature {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}

.feature svg {
  width: 18px;
  height: 18px;
  color: var(--copper);
  margin-bottom: 12px;
}

.feature h3 { margin-bottom: 8px; }
.feature p {
  margin: 0;
  color: var(--hide);
  font-size: 15px;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}

.card p { margin: 8px 0 0; color: var(--hide); }

/* Latch band */

.latch-band {
  background: var(--den-1);
  color: var(--mist);
  padding: 80px 0;
}

.latch-band h2 { color: var(--parchment); }
.latch-band p {
  max-width: 52ch;
  color: var(--fog);
}

.latch-band a {
  color: var(--latch);
  font-weight: 700;
}

.latch-band .follow { margin-top: 24px; }

.limits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}

.limits article {
  background: var(--den-2);
  border-radius: 12px;
  padding: 18px;
}

.limits h3 {
  font-size: 16px;
  color: var(--cream);
  margin-bottom: 8px;
}

.limits p { margin: 0; font-size: 15px; }

/* Photo */

.still-band {
  position: relative;
  min-height: min(72vh, 640px);
  display: grid;
  place-items: end start;
  overflow: hidden;
}

.still-band img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.still-band .caption {
  position: relative;
  z-index: 1;
  margin: 0 0 48px var(--gutter);
  max-width: 18ch;
  color: var(--parchment);
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.95;
  text-shadow: 0 8px 32px rgba(18, 14, 11, 0.55);
}

/* Download */

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.download-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  min-height: 240px;
}

.download-card.is-recommended {
  border-color: var(--copper);
  box-shadow: 0 0 0 1px var(--copper);
}

.download-card h3 { margin: 8px 0 6px; }
.download-card p { margin: 0 0 16px; color: var(--hide); flex: 1; }
.download-card .btn { width: 100%; }

.os {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
}

.notice {
  margin-top: 22px;
  padding: 16px 18px;
  border-left: 4px solid var(--latch);
  background: var(--cream);
  color: var(--hide);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

/* Privacy / prose */

.prose {
  max-width: 68ch;
}

.prose p,
.prose li {
  color: var(--hide);
}

.prose h2 { margin: 36px 0 12px; }
.prose h3 {
  margin: 22px 0 8px;
  font-family: var(--font-ui);
  letter-spacing: 0;
  font-size: 18px;
}
.prose ul,
.prose ol { padding-left: 1.15em; }
.prose .effective {
  margin: 0 0 8px;
  color: var(--fog);
  font-size: 14px;
}

/* Join */

.join-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  padding: 36px 0 72px;
}

.invite-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.invite-code {
  margin: 16px 0 8px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.08em;
}

.dark-card {
  background: var(--den-1);
  color: var(--mist);
  border-radius: 16px;
  padding: 24px;
}

.dark-card h2 { color: var(--cream); font-family: var(--font-ui); letter-spacing: 0; font-size: 22px; }
.dark-card p { color: var(--fog); }

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
}

.site-footer__bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.site-footer nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--hide);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.site-footer a:hover { color: var(--ink); }

.site-footer .brand img { height: 40px; }

.legal {
  margin: 8px 0 0;
  color: var(--fog);
  font-size: 13px;
}

/* Page titles */

.page-hero { padding: 40px 0 12px; }
.page-hero .lede { max-width: 52ch; }

/* 404 */

.empty {
  padding: 12vh 0 18vh;
  text-align: left;
}

/* Responsive */

@media (max-width: 980px) {
  .feature-grid,
  .download-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .hero,
  .split,
  .pair,
  .limits,
  .join-layout { grid-template-columns: 1fr; }
  .den-window { display: none; }
  .phone { display: block; }
  .hero { padding-top: 24px; }
  .feature-grid,
  .download-grid { grid-template-columns: 1fr; }
  .band { padding: 56px 0; }
}

@media (max-width: 640px) {
  .nav-toggle { display: grid; place-items: center; }
  .site-header__bar { position: relative; }
  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    z-index: 30;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-lift);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 16px; }
}

@media (max-width: 520px) {
  h1 { font-size: 42px; }
  .btn { width: 100%; }
  .actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .den-window { transform: none; }
}
