:root {
  --accent: #8eb9cf;
  --bg: #121210;
  --surface: #171714;
  --text: #f2f1ec;
  --prose: #c8c6bd;
  --muted: #9b9a92;
  --dim: #6d6c65;
  --line: #26261f;
  --line-soft: #1f1f1a;
  --line-input: #2e2e26;
  --line-strong: #38382f;
  --hover: #1c1c18;
  --hatch: repeating-linear-gradient(135deg, #191916 0 9px, #1d1d19 9px 18px);
  /* Warm red, picked to stay readable on the near-black background. */
  --danger: #e2a08f;
  --danger-bg: #241a17;
  --danger-line: #4a2f27;
  /* Muted green, same treatment as --danger: readable without shouting. */
  --ok: #9ec7a4;
  --shell: 1080px;
  --gutter: 32px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); }

body {
  font-family: "Instrument Sans", Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--bg); }
input:focus { outline: none; }
input::placeholder { color: var(--dim); }

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 18, 16, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .shell {
  padding-top: 15px;
  padding-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand:hover { color: var(--text); }

.brand-mark { height: 24px; width: auto; display: block; }

/* [hidden] must still win over the display rules above. */
[hidden] { display: none !important; }

.brand-text {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 24px;
  color: var(--text);
}

.version {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line-input);
  border-radius: 3px;
  padding: 3px 7px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
}

.site-nav a:not(.btn) {
  color: var(--muted);
  padding: 7px 11px;
  border-radius: 4px;
}

.site-nav a:not(.btn):hover,
.site-nav a:not(.btn)[aria-current="page"] {
  color: var(--text);
  background: var(--hover);
}

/* ---------- buttons ---------- */

.btn {
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  border-radius: 5px;
  padding: 13px 16px;
  cursor: pointer;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

/* Hover colours are pinned because these render as <a> as well as <button>,
   and the generic a:hover rule would otherwise repaint the label. */
.btn-accent,
.btn-accent:hover {
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
}

.btn-accent:hover { filter: brightness(1.08); }

.btn-quiet,
.btn-quiet:hover {
  color: var(--text);
  background: transparent;
}

.btn-quiet { border: 1px solid var(--line-strong); }
.btn-quiet:hover { border-color: var(--dim); }

.btn-nav {
  margin-left: 8px;
  font-size: 14.5px;
  padding: 9px 16px;
}

.btn-hero { font-size: 16px; padding: 13px 24px; }

/* ---------- shared layout ---------- */

main { display: block; }

.page { padding-bottom: 40px; }

.page-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px var(--gutter) 90px;
}

.back-link {
  display: inline-block;
  margin-top: 40px;
  font-size: 15px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}

.back-link:hover { color: var(--text); }

/* ---------- home ---------- */

.hero { padding: 72px 0 56px; }
.hero-inner { max-width: 760px; }

.hero h1 {
  font-size: 50px;
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-weight: 600;
  margin: 0 0 18px;
  max-width: 20ch;
}

.hero p {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 30px;
  max-width: 50ch;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-note { font-size: 15.5px; color: var(--dim); }

.shot {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.shot-frame {
  height: 400px;
  background-image: var(--hatch);
  display: flex;
  align-items: center;
  justify-content: center;
}

.shot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shot-hint {
  font-size: 12.5px;
  color: var(--dim);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 4px;
}

.features {
  padding: 76px 0 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 44px;
}

.features h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.012em;
}

.features p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  text-wrap: pretty;
}

.pricing {
  margin: 78px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 44px;
}

.pricing h2 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: 0 0 6px;
}

.pricing > p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 16px;
}

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.plan {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan-featured { border-color: var(--accent); }

.plan-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.plan-featured .plan-label { color: var(--accent); }

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.plan-price strong {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.plan-price span { font-size: 15px; color: var(--dim); }

.plan p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  text-wrap: pretty;
}

.plan .btn { margin-top: auto; }

/* ---------- signup ---------- */

.signup {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 64px var(--gutter) 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

.signup h1 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.028em;
  margin: 0 0 14px;
  line-height: 1.08;
}

.signup-lede {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 16.5px;
  max-width: 40ch;
  text-wrap: pretty;
}

.signup-notes {
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--dim);
  border-left: 1px solid var(--line);
  padding-left: 20px;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--surface);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  font-size: 13.5px;
  color: var(--muted);
  letter-spacing: 0.005em;
}

.field input {
  font-family: inherit;
  font-size: 15.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-input);
  border-radius: 5px;
  padding: 11px 13px;
}

.field input:focus { border-color: var(--accent); }

.field input.is-invalid { border-color: var(--danger); }

.field-hint {
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.45;
}

.field-error {
  font-size: 12.5px;
  color: var(--danger);
  line-height: 1.45;
}

/* Live username availability. Sits where the format hint was. */
.field-status {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--dim);
}

.field-status.is-available { color: var(--ok); }

.field-status.is-available::before {
  content: "✓ ";
}

/* Form-level failures: a wrong password, an unreachable server. */
.form-error {
  margin: 0;
  font-size: 13.5px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  border-radius: 5px;
  padding: 10px 12px;
}

.signup-form.is-pending { cursor: progress; }
.signup-form.is-pending .btn { opacity: 0.75; }
.signup-form .btn:disabled { cursor: not-allowed; }

.signup-form .btn { margin-top: 4px; }

.signup-alt {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--dim);
  text-align: center;
}

.signup-alt a {
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
}

.signup-alt a:hover { color: var(--text); }

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

.dash {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 56px var(--gutter) 90px;
}

.dash h1 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.028em;
  margin: 0 0 32px;
  line-height: 1.08;
}

.rows {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.row:last-child { border-bottom: 0; }

.row dt, .row-key {
  font-size: 14.5px;
  color: var(--muted);
  margin: 0;
}

.row dd, .row-val {
  font-size: 15.5px;
  font-weight: 500;
  margin: 0;
}

.rows dl { margin: 0; }

.soon {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px 24px;
  text-align: center;
  background-image: var(--hatch);
}

.soon h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.soon p {
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
  max-width: 44ch;
  text-wrap: pretty;
}

.dash .back-link { margin-top: 32px; }

.dash-status {
  color: var(--muted);
  font-size: 15.5px;
  padding: 20px 0;
}

.dash-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* A button that reads as a link, for actions that change state. */
.link-button {
  font-family: inherit;
  font-size: 15px;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  padding: 0 0 2px;
  margin-top: 32px;
  cursor: pointer;
}

.link-button:hover { color: var(--text); }

/* Signed-out dashboard, and the post-signup confirmation panel. */
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px 26px;
  background-image: var(--hatch);
}

.notice h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.018em;
  margin: 0 0 8px;
}

.notice p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  max-width: 46ch;
  text-wrap: pretty;
}

.notice strong { color: var(--text); font-weight: 600; }

.notice .btn, .notice-actions { margin-top: 20px; }

.notice-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.notice-actions .btn { margin-top: 0; }

/* ---------- legal pages ---------- */

.legal h1 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.028em;
  margin: 0 0 10px;
  line-height: 1.08;
}

.legal-date {
  margin: 0 0 34px;
  color: var(--dim);
  font-size: 12.5px;
}

.legal-body {
  display: flex;
  flex-direction: column;
  gap: 26px;
  font-size: 16.5px;
  color: var(--prose);
  line-height: 1.65;
}

.legal-body p { margin: 0; text-wrap: pretty; }

.legal-contact { color: var(--muted); font-size: 13px; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  margin-top: 40px;
}

.site-footer .shell {
  padding-top: 26px;
  padding-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--dim);
}

.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--dim); }
.footer-links a:hover { color: var(--text); }

/* ---------- narrow viewports ---------- */

@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .signup { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .site-header .shell { flex-wrap: wrap; gap: 12px; }
  .site-nav { font-size: 14px; gap: 4px; }
  .site-nav a { padding: 7px 8px; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 16.5px; }
  .shot-frame { height: 220px; }
  .features { grid-template-columns: 1fr; gap: 32px; }
  .plans { grid-template-columns: 1fr; }
  .signup h1, .dash h1, .legal h1 { font-size: 32px; }
  .row { flex-direction: column; align-items: flex-start; gap: 4px; }
}

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