/* Homepage: an SRE status page. Shared tokens, top bar and panels are in /_shared/site.css. */

/* ---- status banner ------------------------------------------------------------------ */
.banner { display: flex; align-items: center; gap: 12px; margin: 28px 0 0; padding: 14px 18px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.banner .pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.banner[data-state="operational"] { background: var(--ok-soft); border-color: transparent; color: var(--text); }
.banner[data-state="operational"] .pulse { background: var(--ok); animation: pulse 2s infinite; }
.banner[data-state="degraded"] { background: var(--warn-soft); border-color: transparent; color: var(--text); }
.banner[data-state="degraded"] .pulse { background: var(--warn); }
.banner[data-state="error"] .pulse { background: var(--bad); }
.banner-time { margin-left: auto; font-size: .85rem; color: var(--muted); font-family: var(--mono); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .45); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ---- hero ------------------------------------------------------------------------------ */
.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; padding: 48px 0 28px; align-items: start; }
.eyebrow { margin: 0 0 .4rem; color: var(--muted); font-family: var(--mono); font-size: .85rem; }
h1 { font-size: 3rem; line-height: 1.05; margin: 0 0 .6rem; letter-spacing: -.025em; }
.role { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem; }
.tagline { color: var(--muted); font-size: 1.08rem; margin: 0 0 1.5rem; max-width: 60ch; }

.live { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.live dl { margin: 0; display: grid; gap: 10px; }
.live dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.live dt { color: var(--muted); font-size: .88rem; }
.live dd { margin: 0; font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.fine { color: var(--muted); font-size: .8rem; margin: .9rem 0 0; line-height: 1.5; }

/* ---- metrics ----------------------------------------------------------------------------- */
.slo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; }
.metric b { font-family: var(--mono); font-size: 1.35rem; line-height: 1.25; }
.metric b.long { font-size: 1.05rem; }
.metric .k { color: var(--muted); font-size: .82rem; line-height: 1.45; }

/* ---- writing (first section after the hero) ------------------------------------------------ */
.writing-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.writing-head .more { font-weight: 600; font-size: .9rem; white-space: nowrap; }
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.posts.n1 { grid-template-columns: 1fr; }
.posts.n2 { grid-template-columns: 1fr 1fr; }
.post-card { display: flex; flex-direction: column; gap: .5rem; padding: 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--bg); }
.post-card:hover { border-color: var(--accent); text-decoration: none; }
.post-card:hover h3 { color: var(--accent); }
.post-card h3 { font-size: 1.15rem; line-height: 1.35; }
.post-card p { margin: 0; color: var(--muted); font-size: .93rem; }
.post-meta { color: var(--muted); font-size: .8rem; font-family: var(--mono); display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: .3rem; }
.lead { margin: 0 0 1.2rem; max-width: 72ch; }
.muted { color: var(--muted); }

/* ---- focus areas --------------------------------------------------------------------------- */
.components { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.comp { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.comp:nth-child(odd) { border-right: 1px solid var(--line); }
.comp:nth-last-child(-n+2) { border-bottom: 0; }
.comp p { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.ok-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); margin-top: .5rem; flex: none; }

/* ---- changelog ------------------------------------------------------------------------------- */
.changelog { list-style: none; margin: 0; padding: 0; }
.changelog > li { display: grid; grid-template-columns: 130px 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.changelog > li:first-child { border-top: 0; padding-top: 0; }
.ver { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ver code { font-family: var(--mono); font-size: .85rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.ver .tag { text-transform: uppercase; letter-spacing: .06em; font-size: .68rem; }
.ver .tag.current { background: var(--ok-soft); color: var(--ok); border-color: transparent; font-weight: 700; }
.changelog h3 .sub { font-weight: 500; color: var(--muted); }
.changelog .when { margin: .1rem 0 .5rem; color: var(--muted); font-size: .85rem; font-family: var(--mono); }
.changelog ul { margin: 0; padding: 0; list-style: none; }
.changelog ul li { position: relative; padding-left: 1.3rem; margin-bottom: .35rem; font-size: .95rem; }
.changelog ul li::before { content: "+"; position: absolute; left: 0; color: var(--ok); font-family: var(--mono); font-weight: 700; }

/* ---- services ---------------------------------------------------------------------------------- */
.services { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.services li { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.services li:first-child { border-top: 0; }
.services li:hover { background: var(--bg); }
.services a { flex: 1; color: var(--text); display: flex; flex-direction: column; min-width: 0; }
.services a:hover { text-decoration: none; }
.services a:hover b { color: var(--accent); }
.services a span { color: var(--muted); font-size: .9rem; }
.pill { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.pill[data-state="operational"] { background: var(--ok-soft); color: var(--ok); }
.pill[data-state="degraded"] { background: var(--warn-soft); color: var(--warn); }
.pill[data-state="down"] { background: var(--bad-soft); color: var(--bad); }

/* ---- visitors ------------------------------------------------------------------------------------ */
.vis-top { display: grid; grid-template-columns: repeat(3, 1fr) 2fr; gap: 12px; align-items: stretch; margin-bottom: 20px; }
.vis-num { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.vis-num b { font-family: var(--mono); font-size: 1.4rem; }
.vis-num span { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.vis-chart { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vis-chart span { color: var(--muted); font-size: .8rem; }
.vis-chart svg { width: 100%; height: 64px; display: block; }
.vis-chart .area { fill: var(--accent-soft); }
.vis-chart .line { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.countries { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; }
.countries li { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: 4px 8px; align-items: center; font-size: .9rem; }
.countries .flag { font-size: 1.1rem; line-height: 1; }
.countries .bar { grid-column: 2 / 4; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.countries .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.countries .pct { font-family: var(--mono); color: var(--muted); font-size: .82rem; }
.vis-note { color: var(--muted); font-size: .8rem; margin: 16px 0 0; }

/* ---- lists -------------------------------------------------------------------------------------------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
h2.mt { margin-top: 1.6rem; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: .55rem 0; border-top: 1px solid var(--line); font-size: .93rem; }
.plain li:first-child { border-top: 0; padding-top: 0; }
.proj { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.proj li { display: flex; flex-direction: column; gap: .3rem; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.proj a { font-weight: 600; font-family: var(--mono); font-size: .95rem; }
.proj span { color: var(--muted); font-size: .88rem; }
.badges { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.badges li { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.badges b { font-family: var(--mono); font-size: .78rem; min-width: 3.4rem; text-align: center; padding: 3px 0; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.contact { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.contact p { margin: 0; color: var(--muted); }

/* ---- small screens ------------------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .slo { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .posts, .posts.n2, .proj { grid-template-columns: 1fr; }
  .vis-top { grid-template-columns: repeat(3, 1fr); }
  .vis-chart { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  h1 { font-size: 2.2rem; }
  .components, .countries { grid-template-columns: 1fr; }
  .comp:nth-child(odd) { border-right: 0; }
  .comp:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .changelog > li { grid-template-columns: 1fr; gap: 6px; }
  .ver { flex-direction: row; }
  .contact { flex-direction: column; align-items: flex-start; }
  .banner-time { display: none; }
  .vis-top { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .banner .pulse { animation: none !important; } }
