/* Overnight Desk — misch13f.com
   Self-contained. No external fonts, CDNs, or trackers. */

:root {
  --bg: #0c0d0f;
  --bg-warm: #121318;
  --bg-card: #16181d;
  --ink: #f3eee6;
  --ink-soft: #c6c0b6;
  --muted: #8f8a81;
  --faint: #6a665e;
  --line: rgba(243, 238, 230, 0.1);
  --line-strong: rgba(243, 238, 230, 0.18);
  --gold: #c9a36a;
  --gold-deep: #a5844e;
  --gold-soft: rgba(201, 163, 106, 0.14);
  --paper: #d7e0c8;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --wide: 72rem;
  --narrow: 40rem;
  --header-h: 3.75rem;
  --ease: 180ms ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(90rem 36rem at 50% -12%, rgba(201, 163, 106, 0.08), transparent 58%),
    radial-gradient(40rem 28rem at 100% 100%, rgba(70, 82, 104, 0.16), transparent 60%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

header,
main,
footer {
  position: relative;
  z-index: 2;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 400;
}

h2 {
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  color: var(--ink);
}

h3 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

p + p {
  margin-top: 0.9rem;
}

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

.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;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 30;
  background: var(--ink);
  color: var(--bg);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
  color: var(--bg);
}

.wrap {
  width: min(calc(100% - 2.25rem), var(--wide));
  margin-inline: auto;
}

.wrap.narrow,
.narrow {
  width: min(calc(100% - 2.25rem), var(--narrow));
}

.section .wrap.narrow {
  width: min(calc(100% - 2.25rem), var(--narrow));
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 13, 15, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding-top: env(safe-area-inset-top);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.wordmark:hover {
  color: var(--ink);
}

.wordmark-mark {
  display: block;
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
}

.wordmark-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 0.9rem;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
}

/* Hero */

.hero {
  padding: 3.25rem 0 4.25rem;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  width: min(calc(100% - 2.25rem), 46rem);
}

.hero-logo {
  display: block;
  width: 6.5rem;
  height: 6.5rem;
  margin: 0.15rem 0 1.15rem;
}

.hero h1 {
  font-size: clamp(3.35rem, 16vw, 7.25rem);
  line-height: 0.88;
  letter-spacing: -0.045em;
}

.hero-line {
  display: block;
}

.tagline {
  margin-top: 1.75rem;
  max-width: 34rem;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  line-height: 1.4;
  color: var(--ink);
}

.lead {
  margin-top: 1.15rem;
  max-width: 36rem;
  color: var(--ink-soft);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.75rem;
  padding: 0.45rem 0.8rem 0.45rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(215, 224, 200, 0.06);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(215, 224, 200, 0.12);
}

/* Sections */

.section {
  padding: 4.25rem 0;
  border-bottom: 1px solid var(--line);
}

.section-intro {
  margin-bottom: 2rem;
}

.section-intro h2 {
  margin-bottom: 0.85rem;
}

.section-intro p:not(.eyebrow) {
  color: var(--ink-soft);
  max-width: 34rem;
}

/* Desk / agents */

.desk-grid {
  display: grid;
  gap: 2.25rem;
}

.agents {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.agents li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.85rem 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.agent-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  padding-top: 0.2rem;
}

.agent-body h3 {
  margin-bottom: 0.35rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
}

.agent-body p {
  color: var(--ink-soft);
  max-width: 36rem;
}

/* Safety */

.rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.rules li {
  padding: 1.2rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
}

.rules h3 {
  margin-bottom: 0.35rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--ink);
}

.rules p {
  color: var(--ink-soft);
}

/* Latest night */

.night-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.example-banner {
  margin: 0;
  padding: 0.55rem 1.15rem;
  background: var(--gold);
  color: #1a140c;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.night-head {
  padding: 1.35rem 1.25rem 0.5rem;
}

.night-kicker {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.night-head h3 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 400;
}

.night-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 1rem 1.25rem 0;
  padding: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.night-facts div {
  padding: 0.85rem 0.9rem 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.night-facts div:nth-child(odd) {
  padding-right: 0.9rem;
  border-right: 1px solid var(--line);
}

.night-facts div:nth-child(even) {
  padding-left: 0.9rem;
}

.night-facts div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.night-facts dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.night-facts dd {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink);
}

.night-note {
  padding: 1.1rem 1.25rem 1.3rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Build log */

.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.log-list li {
  padding: 1.35rem 0 1.45rem;
  border-top: 1px solid var(--line);
}

.log-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.log-meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.4rem;
}

.log-list h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
}

.log-list p:not(.log-meta) {
  color: var(--ink-soft);
}

/* Newsletter */

.signup {
  margin-top: 0.25rem;
  padding: 1.25rem;
  border: 1px dashed var(--line-strong);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.015);
}

.signup-status {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.signup-row {
  display: grid;
  gap: 0.65rem;
}

.signup input,
.signup button {
  font: inherit;
  font-size: 0.95rem;
  border-radius: 0.45rem;
  width: 100%;
}

.signup input {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: #0e0f12;
  color: var(--faint);
  padding: 0.75rem 0.85rem;
  cursor: not-allowed;
}

.signup input::placeholder {
  color: var(--faint);
}

.signup button {
  border: 1px solid var(--line-strong);
  background: #1a1c21;
  color: var(--muted);
  padding: 0.75rem 1rem;
  cursor: not-allowed;
  letter-spacing: 0.01em;
}

.signup input:disabled,
.signup button:disabled {
  opacity: 0.85;
}

/* Footer */

.site-footer {
  padding: 2.75rem 0 calc(3.25rem + env(safe-area-inset-bottom));
}

.footer-inner {
  display: grid;
  gap: 1.75rem;
}

.footer-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.footer-brand p:last-child,
.footer-legal p {
  color: var(--muted);
  font-size: 0.9rem;
}

.disclaimer {
  color: var(--ink-soft) !important;
  font-size: 0.95rem !important;
  margin-bottom: 0.55rem;
}

/* Desktop */

@media (max-width: 719px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    min-height: 0;
    padding-top: calc(0.7rem + env(safe-area-inset-top));
    padding-bottom: 0;
  }

  .wordmark {
    min-height: 2.35rem;
  }

  .nav {
    justify-content: space-between;
    flex-wrap: nowrap;
    max-width: none;
    width: 100%;
    gap: 0.35rem 0.55rem;
    margin-top: 0.55rem;
    padding: 0.5rem 0 0.65rem;
    border-top: 1px solid var(--line);
  }

  .nav a {
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

@media (min-width: 720px) {
  .wrap {
    width: min(calc(100% - 4.5rem), var(--wide));
  }

  .hero {
    padding: 5.5rem 0 6rem;
  }

  .hero-logo {
    width: 8rem;
    height: 8rem;
    margin: 0.2rem 0 1.4rem;
  }

  .section {
    padding: 5.5rem 0;
  }

  .nav {
    gap: 0.2rem 1.35rem;
  }

  .nav a {
    font-size: 0.875rem;
  }

  .desk-grid {
    grid-template-columns: minmax(16rem, 0.9fr) minmax(22rem, 1.25fr);
    gap: 3.5rem;
    align-items: start;
  }

  .desk .section-intro {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    margin-bottom: 0;
  }

  .agents li {
    grid-template-columns: 3rem 1fr;
    padding: 1.45rem 0 1.55rem;
  }

  .signup-row {
    grid-template-columns: 1fr auto;
    align-items: stretch;
  }

  .signup button {
    width: auto;
    padding-inline: 1.15rem;
    white-space: nowrap;
  }

  .footer-inner {
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: start;
  }

  .night-head,
  .night-note {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .night-facts {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
  }
}

@media (max-width: 359px) {
  .nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.35rem 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
