/* Nightgap — shared styles */

:root {
  --bg: #0e1528;
  --bg-2: #141d36;
  --card: #1a2442;
  --line: #2a3660;
  --text: #e6e9f2;
  --muted: #9aa5c4;
  --amber: #f2b863;
  --amber-dark: #d99a3f;
  --teal: #7fd1c4;
  --red: #e88a7a;
  --radius: 12px;
  --wrap: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}

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

a { color: var(--amber); text-underline-offset: 3px; }
a:hover { color: #ffd08e; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(14, 21, 40, .92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}
.brand:hover { color: var(--text); }
.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--amber); }

/* Hero */
.hero { padding: 64px 0 48px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}
.eyebrow {
  color: var(--teal);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .8em;
}
.lead { font-size: 1.15rem; color: #c9cfe2; }
.hero-art { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }

.button {
  display: inline-block;
  background: var(--amber);
  color: #1b1405;
  font-weight: 600;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 8px;
  margin: 6px 10px 6px 0;
}
.button:hover { background: #ffcb80; color: #1b1405; }
.button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.button.ghost:hover { border-color: var(--muted); }

/* Sections */
.section { padding: 56px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 32px; }
.section-head p { color: var(--muted); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; align-items: start; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card p:last-child { margin-bottom: 0; }
.card .icon { width: 40px; height: 40px; margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Sample alert */
.alert-mock {
  background: #f7f5ef;
  color: #22252e;
  border-radius: var(--radius);
  padding: 20px 22px;
  font-size: .95rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.alert-mock .meta { color: #6b6f7a; font-size: .82rem; margin-bottom: 10px; }
.alert-mock strong { color: #111; }
.alert-mock table { width: 100%; border-collapse: collapse; margin: 12px 0; font-family: var(--mono); font-size: .85rem; }
.alert-mock td { padding: 3px 6px; border-bottom: 1px solid #e3dfd3; }
.alert-mock td:last-child { text-align: right; }

/* Score legend */
.scores { list-style: none; padding: 0; margin: 0; }
.scores li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.scores li:last-child { border-bottom: 0; }
.score {
  font-family: var(--mono);
  font-weight: 700;
  min-width: 3.2em;
  text-align: center;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: .9rem;
}
.score.good { background: rgba(127, 209, 196, .18); color: var(--teal); }
.score.fair { background: rgba(242, 184, 99, .18); color: var(--amber); }
.score.poor { background: rgba(232, 138, 122, .18); color: var(--red); }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.plan { display: flex; flex-direction: column; }
.plan.featured { border-color: var(--amber-dark); }
.price { font-size: 2rem; font-weight: 700; margin: 4px 0 2px; }
.price small { font-size: .95rem; color: var(--muted); font-weight: 400; }
.plan ul { padding-left: 1.1em; margin: 14px 0 20px; flex: 1; }
.plan li { margin-bottom: 6px; }

/* Notes / posts */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 20px 0; border-bottom: 1px solid var(--line); }
.post-list li:first-child { padding-top: 0; }
.post-list h3 { margin-bottom: .3em; }
.post-list h3 a { color: var(--text); text-decoration: none; }
.post-list h3 a:hover { color: var(--amber); }
time, .date { color: var(--muted); font-size: .88rem; font-family: var(--mono); }

.article { max-width: 720px; padding: 48px 20px 64px; margin: 0 auto; }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.article h2 { font-size: 1.35rem; margin-top: 1.6em; }
.article figure { margin: 28px 0; }
.article figcaption { color: var(--muted); font-size: .88rem; margin-top: 8px; }
.article ul, .article ol { padding-left: 1.2em; }
.article li { margin-bottom: .4em; }
.back { display: inline-block; margin-bottom: 20px; font-size: .92rem; }
.byline { color: var(--muted); font-size: .92rem; margin-bottom: 28px; }

code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

/* FAQ */
details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 12px;
}
summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 10px; }
details p:last-child { margin-bottom: 0; }

/* Page head */
.page-head { padding: 52px 0 12px; }
.page-head p { color: var(--muted); max-width: 680px; font-size: 1.08rem; }

/* Team */
.person { display: flex; gap: 16px; align-items: flex-start; }
.avatar {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #1b1405;
  background: var(--amber);
}
.avatar.teal { background: var(--teal); color: #0b2622; }

/* 404 */
.notfound { text-align: center; padding: 90px 20px 110px; }
.notfound img { margin: 0 auto 28px; }
.notfound p { color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* Mobile */
@media (max-width: 820px) {
  .hero { padding: 40px 0 32px; }
  .hero-inner, .grid-2 { grid-template-columns: 1fr; }
  .grid-3, .plans { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
  .site-header { position: static; }
}
