/* ════════════════════════════════════════════════
   FrameTheGlobe Status — Premium Light Theme
   Fraunces (display) · Instrument Sans (UI)
   JetBrains Mono (data)
   ════════════════════════════════════════════════ */

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

:root {
  /* Base */
  --cream: #f5f2ec;
  --paper: #fdfcf9;
  --paper-2: #f9f7f3;
  --border: #e2dbd0;
  --border-hi: #c8bfb1;

  /* Text */
  --ink-1: #1a1614;
  --ink-2: #4b433b;
  --ink-3: #8a8078;
  --ink-4: #b8b0a8;

  /* Status */
  --green: #1a6b3c;
  --green-bg: #f0f7f3;
  --green-rim: #9dcdb4;

  --amber: #b45309;
  --amber-bg: #fdf5e8;
  --amber-rim: #e8b87a;

  --red: #991b1b;
  --red-bg: #fdf2f2;
  --red-rim: #f0a8a8;

  /* Shape */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;

  /* FTG Branding */
  --ftg-blue:    #1d4ed8;
  --ftg-blue-dk: #1e3a8a;
  --ftg-red:     #dc2626;
}

/* ── Fonts ─────────────────────────────────── */
html {
  color-scheme: light;
}

body {
  font-family: 'Instrument Sans', system-ui, sans-serif;
  background-color: white;
  color: var(--ink-1);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Top stripe ────────────────────────────── */
.status-stripe {
  height: 4px;
  background: var(--border);
  transition: background 0.7s ease;
}

.status-stripe.stripe-up {
  background: var(--green);
}

.status-stripe.stripe-degraded {
  background: var(--amber);
}

.status-stripe.stripe-down {
  background: var(--red);
}

/* ── Shell ─────────────────────────────────── */
.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  animation: rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Banner ────────────────────────────────── */
.status-banner {
  padding: 1.5rem 2.25rem;
  background: #f6f8fa;
  border-bottom: 1px solid var(--border);
  color: var(--ink-1);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: all 0.3s ease;
}

.status-banner--up {
  background: var(--green);
  color: white;
}

.status-banner--degraded {
  background: var(--amber);
  color: white;
}

.status-banner--down {
  background: var(--red);
  color: white;
}

.banner-text {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.banner-subtext {
  font-size: 0.85rem;
  opacity: 0.9;
}

.brand-row {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem 2.25rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ftg-blue-dk);
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.brand-news {
  color: var(--ftg-blue);
}

.beta-badge {
  background: var(--ftg-red);
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  top: -0.15rem;
}

.breaking-bar {
  background: var(--ftg-blue);
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.6rem 1rem;
  margin: 1rem -2.25rem -2.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.breaking-label {
  background: var(--ftg-blue-dk);
  padding: 0.6rem 1.25rem;
  margin: -0.6rem 0 -0.6rem -1rem;
}

.breaking-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Main Content ────────────────────────── */
.main-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.page-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink-1);
}

.page-meta {
  font-size: 0.8rem;
  color: var(--ink-4);
  display: flex;
  gap: 0.5rem;
}

.brand-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.meta-live {
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.meta-live::before {
  content: '';
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green-rim);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
}

.live-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-green 2.2s ease infinite;
}

.hero-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.55rem;
}

.hero-headline {
  font-family: 'Instrument Sans', sans-serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink-1);
  margin-bottom: 1.5rem;
}

.hero-headline span {
  color: var(--ftg-blue);
}

.breaking-bar {
  background: white;
  color: var(--ng-navy);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  border-top: 1px solid #e2e8f0;
  padding: 0.75rem 2.25rem;
  margin: 2rem -2.25rem -2.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.breaking-label {
  color: white;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breaking-label::before {
  content: 'STATUS';
  background: var(--ftg-blue-dk);
  color: white;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
}

.hero-foot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--ink-4);
}

/* ── Status Tags ───────────────────────────── */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-tag::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-tag--up {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-rim);
}

.status-tag--up::before {
  animation: pulse-green 2.2s ease infinite;
}

.status-tag--degraded {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-rim);
}

.status-tag--down {
  color: var(--red);
  background: var(--red-bg);
  border-color: var(--red-rim);
}

.status-tag--muted {
  color: var(--ink-3);
  background: transparent;
  border-color: var(--border);
}

/* ── Pulse animations ──────────────────────── */
@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 107, 60, 0.55);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(26, 107, 60, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(26, 107, 60, 0);
  }
}

@keyframes pulse-amber {
  0% {
    box-shadow: 0 0 0 0 rgba(180, 83, 9, 0.5);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(180, 83, 9, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(180, 83, 9, 0);
  }
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(153, 27, 27, 0.5);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(153, 27, 27, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(153, 27, 27, 0);
  }
}

/* ── Rule ──────────────────────────────────── */
.rule {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

/* ── Metrics strip ─────────────────────────── */
.metrics-strip {
  display: flex;
  align-items: center;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.5rem 1.5rem;
  gap: 2rem;
  margin: 0 -1.5rem 2rem;
}

.metric {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
}

.metric:hover {
  background: var(--paper-2);
}

.metric-sep {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
  align-self: stretch;
}

.metric-n {
  font-weight: 700;
  color: var(--ink-1);
}

.metric-l {
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ── Section ───────────────────────────────── */
.section {
  margin-bottom: 1.5rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.section-title {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-1);
}

.section-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-4);
}

.section-head--gh {
  border-bottom: none;
  margin-bottom: 0.5rem;
  padding-bottom: 0;
}

.section-title--gh {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink-1);
  letter-spacing: -0.02em;
}

.section-link {
  color: #0969da;
  font-weight: 500;
}

.section-link:hover {
  text-decoration: underline;
}

/* ── Checks grid ───────────────────────────── */
.checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 1rem;
}

.check-group {
  margin-bottom: 0.5rem;
}

.check-group-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  margin-bottom: 1rem;
  padding-left: 0.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.check-card {
  background: white;
  border: 1px solid #d0d7de;
  border-radius: 0;
  padding: 1rem 1.25rem;
  transition: background-color 0.1s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: none;
  margin-bottom: -1px; /* Overlap borders */
}

.check-card:first-child {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.check-card:last-child {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  margin-bottom: 0;
}

.check-card:hover {
  background-color: #f6f8fa;
  transform: none;
  box-shadow: none;
  border-color: #d0d7de;
  z-index: 1;
}

.check-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.check-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-1);
}

.check-status-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.check-status-badge--up {
  color: var(--green);
  background: var(--green-bg);
}

.check-status-badge--degraded {
  color: var(--amber);
  background: var(--amber-bg);
}

.check-status-badge--down {
  color: var(--red);
  background: var(--red-bg);
}

/* GitHub-style Status Orb */
.status-orb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-orb--up { 
  background: var(--green); 
  color: white; 
}
.status-orb--degraded { 
  background: var(--amber); 
  color: white; 
}
.status-orb--down { 
  background: var(--red); 
  color: white; 
}

.status-orb svg {
  width: 12px;
  height: 12px;
  stroke-width: 4;
}

/* ── Uptime Bars ───────────────────────────── */
.uptime-viz {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.uptime-bars {
  display: flex;
  gap: 3px;
  height: 34px;
  align-items: stretch;
}

.uptime-bar {
  flex: 1;
  height: 100%;
  background: var(--green-rim);
  border-radius: 1px;
  min-width: 1px;
  transition: opacity 0.1s;
  opacity: 0.6;
}

.uptime-bar--up {
  background: var(--green-rim);
}

.uptime-bar--degraded {
  background: var(--amber-rim);
  opacity: 1;
}

.uptime-bar--down {
  background: var(--red-rim);
  opacity: 1;
}

.uptime-bar:hover {
  opacity: 1;
  transform: scaleY(1.1);
}

.uptime-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--ink-4);
  padding: 0 1px;
}

.uptime-pct {
  color: var(--ink-3);
  font-weight: 500;
}

.uptime-sep {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 0.5rem;
  opacity: 0.5;
}

.check-stats {
  display: flex;
  gap: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.check-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.check-stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-4);
}

.check-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-2);
}

.check-note {
  font-size: 0.72rem;
  color: var(--ink-3);
  line-height: 1.5;
  padding-top: 0.25rem;
}

/* ── Events list ───────────────────────────── */
.events-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.event {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.event:hover {
  border-color: var(--border-hi);
  box-shadow: 0 2px 10px rgba(28, 22, 14, 0.05);
}

.event-tag-wrap {
  flex-shrink: 0;
  padding-top: 1px;
}

.event-body {
  flex: 1;
  min-width: 0;
}

.event-title {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-1);
  margin-bottom: 0.22rem;
  line-height: 1.4;
}

.event-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--ink-4);
}

/* ── Footer ────────────────────────────────── */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.foot-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-4);
}

.foot-link {
  font-size: 0.75rem;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.15s;
}

.foot-link:hover {
  color: var(--ink-1);
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 680px) {
  .metrics-strip {
    flex-wrap: wrap;
  }

  .metric {
    flex: 1 1 calc(50% - 1px);
    border-bottom: 1px solid var(--border);
  }

  .metric:nth-child(4n) {
    border-right: none;
  }

  .metric-sep {
    display: none;
  }
}

@media (max-width: 480px) {
  .shell {
    padding: 1.5rem 1rem 4rem;
  }

  .hero {
    padding: 1.25rem;
  }

  .hero::before,
  .hero::after {
    display: none;
  }

  .hero-nav {
    margin-bottom: 1.5rem;
  }

  .hero-headline {
    margin-bottom: 1rem;
  }
}