/* Bolt's mailroom. The site's two materials: his ink body for the rail and the sign-in door, his paper face for
   reading. Deadbolt orange only on the one button that sends or lets you in; marker red only ever handwriting. */
@font-face { font-family: 'Geist'; src: url('/assets/fonts/geist-wght.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('/assets/fonts/caveat.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --paper: #FCFBFA;
  --paper-2: #F3F2F0;
  --paper-3: #ECEAE6;
  --rule: #E2E0DC;
  --ink: #161616;
  --graphite: #4D4C4B;
  --mute: #6B6966;
  --night: #0B0B0B;
  --night-2: #131313;
  --night-3: #1A1A1A;
  --night-rule: #232323;
  --night-rule-2: #323232;
  --chalk: #EDEBE7;
  --ash: #A3A09A;
  --smoke: #86837E;
  --marker: #E2451A;
  --deadbolt: #F2592D;
  --deadbolt-ink: #170A05;
  --sage: #2E9E6B;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sans: 'Geist', 'Segoe UI', system-ui, sans-serif;
  --hand: 'Caveat', 'Segoe Print', cursive;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.5 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; font-kerning: normal; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.rail :focus-visible, .gate :focus-visible { outline-color: var(--chalk); }
::selection { background: rgba(22, 22, 22, 0.14); }
.hand { font-family: var(--hand); font-weight: 700; color: var(--marker); letter-spacing: 0; line-height: 1; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 40px; }
[hidden] { display: none !important; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent;
  font-weight: 560; font-size: 14.5px; letter-spacing: -0.005em; text-decoration: none; white-space: nowrap;
  transition: background 120ms var(--ease), border-color 120ms var(--ease), transform 120ms var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-go { background: var(--deadbolt); color: var(--deadbolt-ink); }
.btn-go:hover { background: #F46A42; }
.btn-go[disabled] { opacity: 0.6; cursor: progress; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #2a2a2a; }
.btn-ghost { background: transparent; border-color: var(--rule); color: var(--ink); }
.btn-ghost:hover { background: var(--paper-2); border-color: #D2CFCA; }
.btn-quiet { background: transparent; color: var(--graphite); height: 34px; padding: 0 10px; font-weight: 520; }
.btn-quiet:hover { background: var(--paper-2); color: var(--ink); }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- the door (sign in) */
.gate { background: var(--night); color: var(--chalk); min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 32px 16px 48px; }
.gate-in { width: 100%; max-width: 380px; }
.gate-bolt { position: relative; width: 176px; margin: 0 0 18px -18px; }
.gate-bolt img { width: 176px; height: 176px; }
.gate-note { position: absolute; left: 196px; top: 6px; font-size: 30px; transform: rotate(-6deg); white-space: nowrap; }
.gate-title { font-weight: 660; font-size: 44px; line-height: 0.95; letter-spacing: -0.045em; }
.gate-lede { margin-top: 14px; color: var(--ash); font-size: 16px; line-height: 1.5; max-width: 30em; }
.gate-form { margin-top: 28px; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 520; color: var(--ash); }
.gate .field input {
  height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--night-rule-2); background: var(--night-2); color: var(--chalk);
  font-size: 16px; outline: none; transition: border-color 120ms var(--ease), background 120ms var(--ease);
}
.gate .field input:focus { border-color: var(--chalk); background: var(--night-3); }
.gate .btn-go { height: 46px; margin-top: 6px; font-size: 15.5px; }
.gate-error { padding: 10px 12px 10px 38px; border-radius: 10px; background: var(--night-3); border: 1px solid var(--night-rule-2); color: var(--chalk); font-size: 14px; position: relative; }
.gate-error::before { content: '!'; position: absolute; left: 12px; top: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--chalk); color: var(--night); font-weight: 700; font-size: 12px; display: grid; place-items: center; line-height: 1; }

/* ---------- the mailroom */
.hub { background: var(--night); overflow: hidden; }
.app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 248px minmax(340px, 400px) minmax(0, 1fr); }

/* rail: Bolt's ink body */
.rail { background: var(--night); color: var(--chalk); display: flex; flex-direction: column; min-height: 0; padding: 18px 14px 14px; gap: 18px; }
.who { display: flex; align-items: center; gap: 11px; padding: 2px 4px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.who-name { font-weight: 620; font-size: 15px; letter-spacing: -0.01em; line-height: 1.2; }
.who-mail { font-size: 12.5px; color: var(--smoke); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.rail .btn-go { width: 100%; height: 42px; }
.nav { display: grid; gap: 2px; }
.nav a, .boxes a {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; text-decoration: none;
  color: var(--ash); font-weight: 520; font-size: 14.5px; transition: background 120ms var(--ease), color 120ms var(--ease);
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }
.nav a:hover, .boxes a:hover { background: var(--night-2); color: var(--chalk); }
.nav a[aria-current='page'], .boxes a[aria-current='page'] { background: var(--night-3); color: var(--chalk); box-shadow: inset 2px 0 0 var(--chalk); }
.nav .count, .boxes .count { margin-left: auto; font-size: 12.5px; color: var(--smoke); font-variant-numeric: tabular-nums; }
.nav .count.fresh, .boxes .count.fresh { color: var(--chalk); font-weight: 650; }
.boxes { display: grid; gap: 1px; min-height: 0; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.boxes-head { font-size: 12.5px; color: var(--smoke); padding: 0 10px 6px; font-weight: 520; }
.boxes a { height: 32px; font-size: 13.5px; }
.boxes a .at { color: var(--smoke); }
.boxes a .local { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--night-rule); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rail-foot form { margin: 0; }
.rail-foot button { background: none; border: 0; padding: 6px 8px; border-radius: 7px; color: var(--smoke); font-size: 13px; }
.rail-foot button:hover { color: var(--chalk); background: var(--night-2); }
.rail-foot .domain { font-size: 12px; color: var(--night-rule-2); padding-left: 8px; }

/* list: paper */
.list { background: var(--paper); border-radius: 14px 0 0 14px; margin: 8px 0 8px 0; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--rule); }
.list-head { padding: 22px 20px 12px; display: grid; gap: 12px; }
.list-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.list-title h1 { font-weight: 660; font-size: 27px; line-height: 1; letter-spacing: -0.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-title .sub { font-size: 13px; color: var(--mute); white-space: nowrap; }
.filter { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 520; justify-self: start; max-width: 100%; }
.filter span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.14); color: var(--paper); display: grid; place-items: center; padding: 0; }
.filter button svg { width: 10px; height: 10px; }
.search { position: relative; }
.search input {
  width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: 9px; border: 1px solid var(--rule); background: var(--paper-2);
  font-size: 14.5px; outline: none; transition: border-color 120ms var(--ease), background 120ms var(--ease);
}
.search input:focus { border-color: var(--ink); background: #fff; }
.search svg { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--mute); pointer-events: none; }
.rows { overflow: auto; min-height: 0; flex: 1; border-top: 1px solid var(--rule); overscroll-behavior: contain; }
.row {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 2px; align-items: baseline;
  padding: 13px 20px 13px 12px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--graphite);
  position: relative; transition: background 120ms var(--ease);
}
.row:hover { background: var(--paper-2); }
.row[aria-current='true'] { background: var(--paper-3); box-shadow: inset 3px 0 0 var(--ink); }
.row .dot { grid-row: 1; width: 7px; height: 7px; border-radius: 50%; align-self: center; }
.row.unread .dot { background: var(--ink); }
.row .from { font-weight: 560; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.row .time { font-size: 12.5px; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .subject { grid-column: 2; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 450; }
.row .slot { grid-column: 3; justify-self: end; }
.row .snippet { grid-column: 2 / 4; font-size: 13.5px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.unread .from { font-weight: 700; }
.row.unread .subject { font-weight: 620; }
.row:not(.unread) .from { color: var(--graphite); }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; border: 1px solid var(--rule);
  background: var(--paper); color: var(--graphite); font-size: 11.5px; font-weight: 560; letter-spacing: 0.005em; white-space: nowrap;
}
.tag .clip { margin-left: 4px; }
.more { display: block; width: calc(100% - 40px); margin: 14px 20px 24px; }
.list-empty { padding: 48px 28px; text-align: left; color: var(--mute); }
.list-empty img { width: 112px; height: 112px; margin: 0 0 10px -12px; }
.list-empty .hand { font-size: 30px; display: block; margin-bottom: 8px; }
.list-empty p { max-width: 26em; font-size: 14.5px; }

/* reader: the letter itself */
.reader { background: #fff; margin: 8px 8px 8px 0; border-radius: 0 14px 14px 0; min-height: 0; overflow: auto; overscroll-behavior: contain; position: relative; }
.bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px; padding: 10px 16px; background: rgba(255,255,255,0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.bar .spacer { flex: 1; }
.bar .back { display: none; }
.bar-empty { display: none; }
.letter { padding: 30px 40px 64px; max-width: 860px; }
.letter h1 { font-weight: 650; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.12; letter-spacing: -0.03em; text-wrap: balance; overflow-wrap: anywhere; }
.meta { margin-top: 22px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; }
.face { grid-row: span 2; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 650; font-size: 17px; text-transform: uppercase; }
.face.bolt { background: none; }
.face.bolt img { width: 44px; height: 44px; border-radius: 50%; }
.meta .name { font-weight: 620; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta .name .addr { font-weight: 400; color: var(--mute); margin-left: 6px; }
.meta .when { font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meta .route { grid-column: 2 / 4; font-size: 13.5px; color: var(--mute); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.meta .route .tag { height: 22px; font-size: 12.5px; background: var(--paper-2); border-color: transparent; color: var(--ink); }
.trust { margin-top: 16px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); }
.trust svg { width: 16px; height: 16px; flex: none; }
.trust.ok svg { color: var(--sage); }
.trust.warn { color: var(--ink); }
.trust.warn svg { color: var(--marker); }
.views { margin-top: 26px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--paper-2); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font-size: 13.5px; font-weight: 540; color: var(--mute); }
.seg button[aria-pressed='true'] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(22,22,22,0.08), 0 0 0 1px var(--rule); }
.views .note { font-size: 13px; color: var(--mute); }
.body-text { margin-top: 22px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.68; color: var(--ink); max-width: 70ch; }
.body-text a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.body-frame { margin-top: 18px; width: 100%; height: 72vh; min-height: 420px; border: 1px solid var(--rule); border-radius: 12px; background: #fff; display: block; }
.cut { margin-top: 14px; font-size: 13px; color: var(--mute); }
.files { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--rule); }
.files h2 { font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }
.files ul { display: flex; flex-wrap: wrap; gap: 8px; }
.file { display: inline-flex; align-items: center; gap: 10px; max-width: 320px; padding: 9px 12px 9px 10px; border-radius: 10px; border: 1px solid var(--rule); text-decoration: none; background: var(--paper); transition: border-color 120ms var(--ease), background 120ms var(--ease); }
.file:hover { border-color: var(--ink); background: #fff; }
.file svg { width: 18px; height: 18px; flex: none; color: var(--graphite); }
.file .fname { font-size: 13.5px; font-weight: 540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .fsize { font-size: 12px; color: var(--mute); white-space: nowrap; }
.reply-cta { margin-top: 34px; display: flex; gap: 8px; flex-wrap: wrap; }
.blank { height: 100%; display: grid; place-items: center; padding: 40px; text-align: center; color: var(--mute); }
.blank img { width: 120px; height: 120px; margin: 0 auto 6px; opacity: 0.95; }
.blank p { font-size: 14.5px; }

/* writing */
.compose { padding: 26px 40px 48px; max-width: 820px; }
.compose h1 { font-weight: 650; font-size: 28px; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 20px; }
.line { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--rule); min-height: 48px; }
.line > label { font-size: 13.5px; color: var(--mute); font-weight: 520; }
.line input { width: 100%; height: 46px; border: 0; outline: none; background: transparent; font-size: 15px; }
.line .from-wrap { display: flex; align-items: center; gap: 10px; }
.line .from-wrap img { width: 26px; height: 26px; border-radius: 50%; }
.hint { font-size: 12.5px; color: var(--mute); padding: 0 0 12px; margin-top: -4px; }
.hint .hand { font-size: 19px; margin-left: 4px; }
.compose textarea { display: block; width: 100%; min-height: 300px; margin-top: 18px; padding: 0; border: 0; outline: none; resize: vertical; font-size: 15.5px; line-height: 1.65; background: transparent; }
.compose .actions { margin-top: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.compose .problem { color: var(--ink); font-size: 13.5px; padding: 8px 12px; border-radius: 8px; background: var(--paper-2); }
.quote { margin-top: 18px; padding: 12px 14px; border-left: 2px solid var(--rule); color: var(--mute); font-size: 13.5px; white-space: pre-wrap; max-height: 160px; overflow: hidden; }

/* addresses */
.slots { padding: 30px 40px 64px; max-width: 860px; }
.slots h1 { font-weight: 660; font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -0.04em; line-height: 0.98; }
.slots .lede { margin-top: 14px; color: var(--graphite); font-size: 16px; max-width: 34em; line-height: 1.5; }
.slots-list { margin-top: 34px; position: relative; display: grid; gap: 0; border-top: 1px solid var(--ink); }
.slot-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 16px 2px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.slot-row:hover .slot-addr { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.slot-addr { font-weight: 620; font-size: clamp(18px, 2vw, 22px); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.slot-addr .at { color: var(--mute); font-weight: 450; }
.slot-n { font-size: 14px; color: var(--graphite); font-variant-numeric: tabular-nums; white-space: nowrap; }
.slot-last { grid-column: 1 / 3; font-size: 13px; color: var(--mute); }
.slots-note { position: absolute; right: -6px; top: -54px; font-size: 27px; transform: rotate(-4deg); pointer-events: none; }
.slots-note::after { content: ''; position: absolute; right: 30px; top: 30px; width: 2.5px; height: 30px; background: var(--marker); border-radius: 2px; transform: rotate(18deg); }
.slots-any { margin-top: 26px; padding: 18px 20px; border-radius: 12px; background: var(--paper-2); font-size: 14.5px; color: var(--graphite); max-width: 40em; }
.slots-any b { color: var(--ink); font-weight: 620; }

/* toasts */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 520; transition: opacity 160ms var(--ease), transform 160ms var(--ease); z-index: 50; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* top bar + drawer: phones and small windows */
.top { display: none; }
.scrim { display: none; }

@media (max-width: 1023px) {
  .hub { overflow: auto; background: var(--paper); }
  .app { display: block; height: auto; min-height: 100dvh; }
  .top {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; height: 58px; padding: 0 12px 0 8px;
    background: var(--night); color: var(--chalk);
  }
  .top .menu { width: 42px; height: 42px; border: 0; border-radius: 10px; background: none; color: var(--chalk); display: grid; place-items: center; }
  .top .menu svg { width: 20px; height: 20px; }
  .top .avatar { width: 32px; height: 32px; }
  .top .title { font-weight: 620; font-size: 15.5px; letter-spacing: -0.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top .btn-go { height: 36px; padding: 0 14px; }
  .rail {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 84vw); z-index: 40; transform: translateX(-102%);
    transition: transform 220ms var(--ease); padding-top: 16px; overflow: auto;
  }
  .app[data-drawer='open'] .rail { transform: none; }
  .app[data-drawer='open'] .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(11,11,11,0.5); }
  .rail .btn-go.write { display: none; }
  .list, .reader { margin: 0; border-radius: 0; border: 0; }
  .list { min-height: calc(100dvh - 58px); }
  .rows { overflow: visible; }
  .reader { overflow: visible; min-height: calc(100dvh - 58px); }
  .app[data-pane='list'] .reader { display: none; }
  .app[data-pane='reader'] .list { display: none; }
  .bar { top: 58px; padding: 8px 10px; }
  .bar .back { display: inline-flex; }
  .bar-empty { display: flex; }
  .bar .label { display: none; }
  .letter, .compose, .slots { padding: 22px 18px 56px; }
  .list-head { padding: 18px 16px 12px; }
  .row { padding: 13px 16px 13px 10px; }
  .blank { min-height: 50vh; }
  .slots-note { display: none; }
  .body-frame { height: 70vh; min-height: 360px; }
}
@media (max-width: 420px) {
  .meta .name .addr { display: block; margin-left: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
  .gate-title { font-size: 38px; }
  .gate-bolt { margin-left: -14px; }
  .gate-note { left: 180px; font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
