/* The user-facing site.
 *
 * Deliberately a separate stylesheet from index.html, which is his workshop and
 * carries five thousand lines of controls nobody else should see. This is the
 * shop front: black, quiet, and built out of about a dozen custom properties, so
 * the whole mood of the place can be changed by editing the block at the top
 * rather than by hunting through rules.
 */

:root {
  /* Black, but not flat black. Three steps of near-black give depth without a
     single border being drawn. */
  --ink:        #05060a;
  --ink-raised: #0c0e15;
  --ink-card:   #11141d;
  --line:       #1e2330;
  --line-soft:  #171b26;

  /* Bright azure, which is the site's one loud colour. Everything else defers
     to it, which is what makes it read as bright. */
  --azure:      #2fb2ff;
  --azure-lit:  #7fd0ff;
  --azure-deep: #0d7fcc;
  --azure-glow: rgba(47, 178, 255, .30);

  --text:       #e8ecf3;
  --text-dim:   #97a1b4;
  --text-faint: #5d6678;

  --radius:     14px;
  --radius-lg:  20px;
  --ease:       cubic-bezier(.22, .61, .36, 1);

  /* The page used to sit in a 1320px box centred on the screen, which left the
     logo and the left column floating in the middle of a wide monitor with
     empty space outside them. The furniture now runs to the edge - a gutter,
     not a margin - and only the READING part keeps a maximum width, because a
     line of text 1900px wide is unreadable while a column of names is not. */
  --gutter:     28px;
  --side-w:     232px;
  --read:       1180px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* min-height, not height: a body held to one screen tall ends there, and the
   sticky top bar - which can never leave its parent - scrolled away with it
   the moment a conversation grew past one screen. */
html { height: 100%; }
body { min-height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv05' 1, 'ss03' 1;
}

/* A very slow wash of colour behind everything, so pure black never reads as a
   switched-off screen. Fixed, so it does not travel with the scroll. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(47, 178, 255, .11), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(120, 80, 255, .07), transparent 60%);
}

a { color: var(--azure); text-decoration: none; }
a:hover { color: var(--azure-lit); }

h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; margin: 0; }

::selection { background: var(--azure-deep); color: #fff; }

/* ---------- the top panel ------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(5, 6, 10, .78);
  backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-in {
  padding: 0 var(--gutter);
  height: 66px;
  display: flex;
  align-items: center;
  gap: 22px;
}

/* The logo is a placeholder and says so. A wordmark in a good face is what most
   of these actually ship with, and it leaves the corner ready for a real mark
   the moment there is one - swap the <svg>, keep everything else. */
.brand { display: flex; align-items: center; gap: 11px; flex: none; }

/* The page's own controls, between the logo and the account corner. Empty on
   pages that have none, where it simply takes up the slack. */
.topmid {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
}

.top-burger {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  margin-right: -8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text-dim);
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.top-burger:hover { color: var(--azure); border-color: rgba(47,178,255,.5); }
.top-burger svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.top-burger[hidden] { display: none; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }
.brand-mark {
  width: 34px; height: 34px;
  transition: transform .4s var(--ease);
}
.brand-name {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--text);
}
.brand-name em {
  font-style: normal;
  color: var(--azure);
}

.topright { display: flex; align-items: center; gap: 8px; }

/* Credits, mailbox, name, face - right to left, as asked. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .18s var(--ease), color .18s var(--ease),
              background .18s var(--ease), transform .18s var(--ease);
}
.chip:hover {
  border-color: rgba(47, 178, 255, .5);
  color: var(--text);
  transform: translateY(-1px);
}
.chip svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.chip b { color: var(--text); font-weight: 600; }

.chip-credits b { color: var(--azure); }

/* Words rather than an arrow. An icon that means "leave" is one of the least
   agreed-on shapes there is, and this is not a button anyone should have to
   hover over to understand. */
.btn-logout { height: 38px; padding: 0 15px; margin-left: 4px; font-size: 13.5px; }

/* The unread dot on the mailbox. */
.chip-mail { position: relative; }
.chip-mail.has-unread::after {
  content: '';
  position: absolute;
  top: 6px; right: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--azure);
  box-shadow: 0 0 0 2px var(--ink), 0 0 12px var(--azure);
}

.face {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--ink-card);
}
.face-blank {
  display: grid; place-items: center;
  font-size: 14px; font-weight: 600;
  color: var(--azure);
  background: linear-gradient(145deg, #16202e, #0d1119);
}

/* ---------- buttons ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.005em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .16s var(--ease), box-shadow .22s var(--ease),
              background .22s var(--ease), color .18s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.994); }

/* The one bright button on any given screen. The sheen is a single pseudo
   element that travels across on hover - cheap, and it makes the azure look
   lit rather than painted. */
.btn-primary {
  background: linear-gradient(135deg, var(--azure) 0%, var(--azure-deep) 100%);
  color: #02121f;
  box-shadow: 0 2px 14px -2px var(--azure-glow), inset 0 1px 0 rgba(255,255,255,.28);
}
.btn-primary:hover {
  box-shadow: 0 6px 26px -4px rgba(47,178,255,.55), inset 0 1px 0 rgba(255,255,255,.34);
  transform: translateY(-1px);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.42) 50%, transparent 62%);
  transform: translateX(-120%);
  transition: transform .62s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }

.btn-quiet {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-quiet:hover {
  background: rgba(255,255,255,.075);
  border-color: rgba(47,178,255,.42);
  transform: translateY(-1px);
}

.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--azure); background: rgba(47,178,255,.08); }

.btn-wide { width: 100%; height: 44px; }

/* ---------- the shell: left column + page ------------------------------- */

.shell {
  position: relative;
  z-index: 1;
  padding: 0 var(--gutter) 70px;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}
/* The column of names goes to the left edge; what you READ stays a sane width
   inside whatever room is left. */
.shell > main { max-width: var(--read); }

.side {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 26px;
}

.side-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 12px 6px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .16s var(--ease), color .16s var(--ease),
              border-color .16s var(--ease), padding-left .16s var(--ease);
}
.side-link:hover {
  background: rgba(255,255,255,.045);
  color: var(--text);
  padding-left: 15px;
}
.side-link.on {
  background: linear-gradient(90deg, rgba(47,178,255,.14), transparent);
  border-left-color: var(--azure);
  color: var(--text);
}
.side-link img {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line);
  flex: none;
}
/* An inline SVG with no size given is as big as its container lets it be, which
   in a flex column is the whole column. */
.side-link svg {
  width: 18px; height: 18px;
  flex: none;
  stroke: currentColor; fill: none; stroke-width: 1.7;
}
.side-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-sep { height: 1px; background: var(--line-soft); margin: 14px 6px; }

/* ---------- the header block on the home page --------------------------- */

.hero {
  padding: 46px 0 34px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 30px;
  align-items: center;
}
.hero h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.08;
  letter-spacing: -.028em;
}
.hero h1 em { font-style: italic; color: var(--azure); }
.hero p {
  margin: 14px 0 0;
  max-width: 54ch;
  color: var(--text-dim);
  font-size: 16px;
}

/* The couple of faces in the header. Overlapping circles, so the row reads as a
   group rather than a list, and it stays sane when there is only one of them. */
.hero-faces { display: flex; }
.hero-faces img, .hero-faces .ph {
  width: 74px; height: 74px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ink);
  box-shadow: 0 6px 22px rgba(0,0,0,.6);
  margin-left: -20px;
  transition: transform .3s var(--ease);
}
.hero-faces img:first-child, .hero-faces .ph:first-child { margin-left: 0; }
.hero-faces img:hover { transform: translateY(-5px) scale(1.06); z-index: 2; }
.hero-faces .ph {
  background: linear-gradient(145deg, #182334, #0c1017);
  display: grid; place-items: center;
  color: var(--text-faint); font-size: 22px;
}

/* ---------- the roster --------------------------------------------------- */

.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 22px;
  padding-bottom: 20px;
}

.card {
  display: block;
  border-radius: var(--radius-lg);
  background: var(--ink-card);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  cursor: pointer;
  transition: transform .3s var(--ease), border-color .3s var(--ease),
              box-shadow .3s var(--ease);
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(47,178,255,.45);
  box-shadow: 0 18px 44px -18px rgba(0,0,0,.9), 0 0 0 1px rgba(47,178,255,.12);
}

.card-shot {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #0a0c12;
}
.card-shot img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  transition: transform .62s var(--ease), filter .4s var(--ease);
}
.card:hover .card-shot img { transform: scale(1.05); }
/* The picture fades into the card rather than stopping at an edge. */
.card-shot::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 52%, rgba(17,20,29,.72) 86%, var(--ink-card) 100%);
}
.card-tag {
  position: absolute;
  z-index: 2;
  top: 12px; left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--azure-lit);
  background: rgba(5,10,18,.72);
  border: 1px solid rgba(47,178,255,.32);
  backdrop-filter: blur(8px);
}

.card-body { padding: 4px 17px 19px; }
.card-name {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.015em;
  color: var(--azure);
  text-shadow: 0 0 22px rgba(47,178,255,.28);
}
.card-blurb {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- the letter that drops out of the mailbox --------------------- */

.drop {
  position: fixed;
  z-index: 60;
  top: 74px;
  right: 26px;
  width: min(376px, calc(100vw - 32px));
  border-radius: var(--radius);
  background: linear-gradient(170deg, #141824, var(--ink-card));
  border: 1px solid rgba(47,178,255,.26);
  box-shadow: 0 26px 60px -20px rgba(0,0,0,.92), 0 0 0 1px rgba(255,255,255,.02);
  overflow: hidden;
  transform-origin: 88% 0;
  animation: drop-in .46s var(--ease) both;
}
@keyframes drop-in {
  0%   { opacity: 0; transform: translateY(-16px) scale(.94); }
  60%  { opacity: 1; transform: translateY(4px)  scale(1.008); }
  100% { opacity: 1; transform: translateY(0)    scale(1); }
}
.drop.going { animation: drop-out .26s var(--ease) both; }
@keyframes drop-out {
  to { opacity: 0; transform: translateY(-10px) scale(.96); }
}

.drop-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px 0;
}
.drop-head img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.drop-from { font-weight: 600; font-size: 14px; }
.drop-sub { font-size: 12px; color: var(--text-faint); }
.drop-x {
  margin-left: auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 0; background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 17px; line-height: 1;
  transition: background .16s, color .16s;
}
.drop-x:hover { background: rgba(255,255,255,.07); color: var(--text); }

.drop-body {
  padding: 9px 15px 15px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-dim);
  cursor: pointer;
}
.drop-more {
  display: block;
  margin-top: 9px;
  color: var(--azure);
  font-weight: 600;
  font-size: 13px;
}

/* ---------- the door: sign in and join ----------------------------------- */

.door {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 30px 18px;
}
.door-card {
  width: 100%;
  max-width: 394px;
  padding: 34px 32px 30px;
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, rgba(20,24,36,.94), rgba(11,13,20,.96));
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.95);
  animation: rise .5s var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}
.door-card h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 27px;
  letter-spacing: -.02em;
  margin-bottom: 4px;
}
.door-card .sub { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }

.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.028);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease),
              background .18s var(--ease);
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus {
  outline: 0;
  border-color: var(--azure);
  background: rgba(47,178,255,.05);
  box-shadow: 0 0 0 3px rgba(47,178,255,.14);
}
.field .hint { margin-top: 6px; font-size: 12px; color: var(--text-faint); }

.door-foot {
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  font-size: 13.5px;
  color: var(--text-dim);
}

.bad {
  margin-bottom: 14px;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 13.5px;
  color: #ffb4b4;
  background: rgba(255,80,80,.09);
  border: 1px solid rgba(255,80,80,.24);
  animation: shake .3s var(--ease);
}
@keyframes shake {
  20% { transform: translateX(-5px); } 60% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

/* ---------- small screens ------------------------------------------------ */

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding: 16px 0 4px;
    gap: 6px;
    scrollbar-width: none;
  }
  .side::-webkit-scrollbar { display: none; }
  .side-title, .side-sep { display: none; }
  .side-link { white-space: nowrap; border-left: 0; }
  .side-link.on { border-left: 0; }
  .hero { grid-template-columns: minmax(0,1fr); padding: 30px 0 24px; }
  .hero-faces { display: none; }
  .topbar-in { padding: 0 16px; gap: 12px; }
  .shell { padding: 0 16px 50px; }
  .chip-name { display: none; }
  .roster { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
}

/* A phone. The header was running off the edge and taking the whole page with
   it - a sideways scrollbar on a page with one column in it is always the
   header, and it is always something that will not shrink. */
@media (max-width: 620px) {
  html, body { overflow-x: clip; }
  .topbar-in { height: 58px; gap: 8px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-name { font-size: 18px; }
  .brand { gap: 8px; }
  .topright { gap: 6px; }
  .btn { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
  .chip { height: 34px; padding: 0 10px; font-size: 13px; }
  .face { width: 30px; height: 30px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
  .who-head { grid-template-columns: minmax(0,1fr); }
}
