@font-face {
  font-family: "Hanken Grotesk";
  src: url("/static/fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --paper: #000;
  --surface: #000;
  --ink: #fff;
  --muted: rgba(255,255,255,.45);
  --line: rgba(255,255,255,.15);
  --accent: #fff;
  --accent-ink: #000;
  --accent-wash: rgba(255,255,255,.08);
  --good: #9fe8c0;
  --danger: rgba(255,120,140,.95);
  --radius: 0;
  --sans: "Courier New", Courier, monospace;
  --mono: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: .04em;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Headings in the site's voice: small, lowercase, widely spaced */
h1 { font-size: 13px; font-weight: 400; letter-spacing: .3em; text-transform: lowercase; color: rgba(255,255,255,.8); margin: 0; }
h2 { font-size: 12px; font-weight: 400; letter-spacing: .25em; text-transform: lowercase; color: rgba(255,255,255,.55); margin: 0 0 .8rem; }
p { margin: 0; }
a { color: rgba(255,255,255,.75); }
code, .mono { font-family: var(--mono); font-size: 1em; }
.muted { color: var(--muted); }
.lede { color: var(--muted); margin-top: .6rem; max-width: 62ch; }

:focus-visible { outline: 1px solid rgba(255,255,255,.6); outline-offset: 3px; }

/* ---------- Controls ---------- */
.btn {
  font: inherit;
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: lowercase;
  padding: .55rem 1.3rem;
  border-radius: 40px;
  border: 1px solid rgba(255,255,255,.18);
  background: transparent;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  white-space: nowrap;
  transition: color .25s, border-color .25s;
}
a.btn { display: inline-block; text-decoration: none; }
.btn:hover, .btn:focus-visible { color: rgba(255,255,255,.95); border-color: rgba(255,255,255,.5); outline: none; }
.btn.primary { color: rgba(255,255,255,.9); border-color: rgba(255,255,255,.45); }
.btn.primary:hover { color: #000; background: #fff; border-color: #fff; }
.btn.danger { color: var(--danger); border-color: rgba(255,120,140,.35); }
.btn.danger:hover { color: #fff; border-color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #000; }
.btn.quiet { border-color: transparent; }
.btn.quiet:hover { border-color: rgba(255,255,255,.3); }
.btn.small { font-size: 11px; padding: .3rem .85rem; }
.btn:disabled { opacity: .4; cursor: default; }
.link { font: inherit; color: rgba(255,255,255,.75); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.3); }
.link:hover { color: #fff; border-color: rgba(255,255,255,.7); }

label { display: block; font-size: 12px; letter-spacing: .15em; text-transform: lowercase; color: rgba(255,255,255,.5); }
input:not([type=checkbox]), textarea {
  display: block;
  width: 100%;
  margin-top: .4rem;
  font: inherit;
  letter-spacing: .06em;
  padding: .65rem .8rem;
  border-radius: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  caret-color: #fff;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus-visible, textarea:focus-visible { outline: none; border-color: rgba(255,255,255,.6); }
input:-webkit-autofill, input:-webkit-autofill:focus { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 100px #000 inset !important; transition: background-color 9999s; }
select { font: inherit; background: #000; color: #fff; border: 1px solid var(--line); padding: .5rem; }
.check { display: flex; gap: .55rem; align-items: center; text-transform: none; letter-spacing: .04em; }
.check input { width: 1rem; height: 1rem; accent-color: #fff; }
.stack > * + * { margin-top: .9rem; }
.hint { font-size: 12px; color: var(--muted); margin-top: .35rem !important; overflow-wrap: anywhere; text-transform: none; letter-spacing: .04em; }
.form-error { color: var(--danger); }
.notice { color: var(--danger); padding: .7rem 1rem; border: 1px solid rgba(255,120,140,.4); margin-bottom: .9rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 40px; overflow: hidden; }
.segmented button { font: inherit; font-size: 12px; letter-spacing: .15em; text-transform: lowercase; padding: .4rem 1rem; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-pressed=true] { background: #fff; color: #000; }

/* ---------- Signed out ---------- */
/* Signed out: the site's own look. Black, the rain, Courier, thin pale lines. */
.auth {
  position: fixed; inset: 0; overflow: auto;
  background: #000; color: #fff;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px; letter-spacing: .15em;
  text-transform: lowercase;
}
#auth-rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .55; pointer-events: none; }
.auth-forms {
  position: relative; z-index: 1;
  min-height: 100%; display: grid; align-content: center; justify-items: center;
  padding: 2.5rem 1.25rem; gap: 2.2rem;
}
.auth-forms form { width: 100%; max-width: 20rem; }
.auth-host { color: rgba(255,255,255,.6); letter-spacing: .25em; }
.auth h1 { font: inherit; font-size: 12px; color: rgba(255,255,255,.6); letter-spacing: .25em; margin: 0 0 1.6rem; text-align: center; }
.auth label { font: inherit; color: rgba(255,255,255,.4); }
.auth input:not([type=checkbox]) {
  font: inherit; letter-spacing: .1em; text-transform: none;
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.15); border-radius: 0;
  padding: .7rem .8rem; margin-top: .45rem; caret-color: #fff;
}
.auth input:focus-visible { outline: none; border-color: rgba(255,255,255,.6); }
.auth input:-webkit-autofill, .auth input:-webkit-autofill:focus { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 100px #000 inset !important; transition: background-color 9999s; }
.auth .btn.primary {
  font: inherit; letter-spacing: .2em; text-transform: lowercase;
  width: 100%; margin-top: 1.4rem; padding: 10px 24px; border-radius: 40px;
  background: transparent; color: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.15);
  transition: color .3s, border-color .3s;
}
.auth .btn.primary:hover, .auth .btn.primary:focus-visible { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.4); filter: none; outline: none; }
.auth .btn.primary:disabled { opacity: .5; }
.auth .hint, .auth .switch { font: inherit; color: rgba(255,255,255,.35); line-height: 1.7; }
.auth .switch { text-align: center; }
.auth .link { font: inherit; color: rgba(255,255,255,.6); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.25); }
.auth .link:hover { color: rgba(255,255,255,.9); border-color: rgba(255,255,255,.6); }
.auth .form-error { font: inherit; color: rgba(255,120,140,.9); line-height: 1.7; }
.auth-links { display: flex; justify-content: center; gap: 28px; }
.auth-links a { color: rgba(255,255,255,.35); text-decoration: none; transition: color .2s; }
.auth-links a:hover, .auth-links a:focus-visible { color: rgba(255,255,255,.8); outline: none; }

.app { min-height: 100dvh; display: grid; grid-template-columns: 15rem minmax(0, 1fr); }
.rail {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 1.6rem;
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.rail-host { font-size: 12px; letter-spacing: .3em; text-transform: lowercase; color: rgba(255,255,255,.8); text-decoration: none; padding: 0 .6rem; overflow-wrap: anywhere; }
.rail-nav { display: flex; flex-direction: column; gap: .1rem; flex: 1; }
.rail-nav a { display: block; padding: .5rem .6rem; font-size: 12px; letter-spacing: .2em; text-transform: lowercase; color: rgba(255,255,255,.4); text-decoration: none; transition: color .2s; }
.rail-nav a:hover { color: rgba(255,255,255,.85); }
.rail-nav a[aria-current=page] { color: #fff; }
.rail-nav a[aria-current=page]::before { content: "> "; }
.rail-nav .nav-gap { margin-top: 1.2rem; padding: 0 .6rem .3rem; font-size: 11px; letter-spacing: .2em; text-transform: lowercase; color: rgba(255,255,255,.3); }
.rail-foot { display: flex; flex-direction: column; gap: .6rem; padding: 0 .6rem; }
.rail-user { font-size: 12px; letter-spacing: .15em; color: rgba(255,255,255,.6); overflow-wrap: anywhere; }

.view { padding: clamp(1.25rem, 3.5vw, 2.75rem); max-width: 68rem; width: 100%; outline: none; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.block { margin-top: 2.2rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel.pad { padding: 1.1rem 1.2rem; }

/* Address list */
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1.2rem; }
.lines li + li { border-top: 1px solid var(--line); }
.lines .address { color: #fff; letter-spacing: .08em; overflow-wrap: anywhere; }

/* Invite tickets */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: .9rem; }
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
}
.ticket-main { padding: 1rem 1.1rem; min-width: 0; }
.ticket-code { font-family: var(--mono); font-size: 14px; letter-spacing: .12em; color: #fff; overflow-wrap: anywhere; }
.ticket-status { margin-top: .3rem; font-size: 12px; color: var(--muted); }
.ticket-stub {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; gap: .4rem;
  padding: .8rem .9rem;
  border-left: 1.5px dashed var(--line);
}
/* The two notches where the stub tears off */
.ticket-stub::before, .ticket-stub::after {
  content: ""; position: absolute; left: -9px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line);
}
.ticket-stub::before { top: -9px; clip-path: inset(50% 0 0 0); }
.ticket-stub::after { bottom: -9px; clip-path: inset(0 0 50% 0); }
.ticket.open { border-color: rgba(255,255,255,.45); }
.ticket.open .ticket-stub { border-left-color: rgba(255,255,255,.45); }
.ticket.open .ticket-stub::before, .ticket.open .ticket-stub::after { border-color: rgba(255,255,255,.45); }
.ticket.used .ticket-code, .ticket.revoked .ticket-code { color: var(--muted); text-decoration: line-through; }
.ticket.used .ticket-status { color: var(--good); }
.ticket-stub .stamp { font-size: 11px; color: var(--muted); text-align: center; min-width: 4.5rem; }

/* Tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 400; letter-spacing: .2em; text-transform: lowercase; color: var(--muted); padding: .7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.right, th.right { text-align: right; }
.name { color: #fff; }
.tag { display: inline-block; font-size: 10px; letter-spacing: .15em; text-transform: lowercase; padding: .1rem .5rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); margin-left: .4rem; vertical-align: 1px; }
.tag.gone { background: transparent; border: 1px solid var(--line); color: var(--muted); }
tr.gone .name { text-decoration: line-through; color: var(--muted); }
.status-used { color: var(--good); }
.empty { padding: 2rem 1.2rem; color: var(--muted); }
.rail-foot .btn { width: 100%; }

/* Who invited whom */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: .7rem; padding-left: 1.1rem; border-left: 1.5px solid var(--line); }
.tree li { padding: .28rem 0; }
.tree .count { color: var(--muted); font-size: .88rem; margin-left: .45rem; }
.tree .gone { text-decoration: line-through; color: var(--muted); }

/* Sites */
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1.6rem; align-items: start; }
.video { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: .8rem; align-items: start; padding: .8rem 1.2rem; }
.video + .video { border-top: 1px solid var(--line); }
.video .thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 0; background: #111; display: block; border: 1px solid var(--line); }
.video .title { color: #fff; overflow-wrap: anywhere; }
.video-quote { margin: .3rem 0 0; white-space: pre-line; overflow-wrap: anywhere; color: rgba(255,255,255,.7); line-height: 1.5; }
.video-meta { gap: .35rem 1rem; margin-top: .3rem; }
.video-meta .hint { margin-top: 0 !important; }
.video-actions { display: flex; flex-direction: column; gap: .4rem; align-items: stretch; }
.status-busy { color: var(--accent, var(--ink)); }
.status-bad { color: var(--danger); }
.add-form { padding: 1.1rem 1.2rem; border-top: 1px solid var(--line); }

/* Dialog and toast */
.dialog {
  border: 1px solid rgba(255,255,255,.25); border-radius: 0; padding: 0;
  width: min(30rem, calc(100vw - 2rem));
  background: #000; color: var(--ink);
  box-shadow: none;
}
.dialog::backdrop { background: rgba(0, 0, 0, .75); }
.dialog-body { padding: 1.4rem 1.5rem 1.5rem; }
.dialog-body h2 { margin-bottom: .9rem; }
.dialog-actions { margin-top: 1.4rem; }
.secret {
  display: flex; justify-content: space-between; align-items: center; gap: .8rem;
  padding: .7rem .85rem; border: 1px solid rgba(255,255,255,.3);
  font-family: var(--mono); letter-spacing: .08em; color: #fff; overflow-wrap: anywhere;
}
.qr { background: #fff; padding: .6rem; width: 11rem; }
.qr svg { display: block; width: 100%; height: auto; }
.secret.codes { display: block; white-space: pre-line; line-height: 1.8; }
.narrow { max-width: 34rem; }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  background: #fff; color: #000;
  padding: .55rem 1.2rem; border-radius: 999px; font-size: 12px; letter-spacing: .15em; text-transform: lowercase;
  max-width: calc(100vw - 2rem); z-index: 10;
}

/* ---------- Small screens ---------- */
@media (max-width: 52rem) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .8rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-nav { flex-direction: row; flex: 1 1 100%; order: 3; overflow-x: auto; gap: .2rem; }
  .rail-nav a { white-space: nowrap; }
  .rail-nav .nav-gap { display: none; }
  .rail-foot { flex-direction: row; align-items: center; margin-left: auto; padding: 0; }
  .video { grid-template-columns: 5rem minmax(0, 1fr); }
  .video-actions { grid-column: 2; flex-direction: row; flex-wrap: wrap; }
}

/* Small pieces */
.block-tight { margin-top: 1rem; }
.tools { margin-bottom: 1rem; }
.narrow { max-width: 26rem; }
.label-text { font-size: .88rem; font-weight: 620; margin-bottom: .45rem; }
.check + .check { margin-top: .35rem; }
.row > input { flex: 1; min-width: 10rem; margin-top: 0; }
.thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--line); display: block; }
input[type=file] { padding: .4rem; }
