:root {
  --primary-blue: #1a73e8;
  --dark-blue: #0d47a1;
  --light-blue: #e8f0fe;
  --text-dark: #3c4043;
  --text-medium: #5f6368;
  --text-light: #9aa0a6;
  --border-color: #dadce0;
  --bg-light: #f8f9fa;
  --white: #ffffff;

  --navy: #070f26;
  --navy-2: #0b1838;
  --navy-3: #12275a;
  --ink-soft: rgba(255, 255, 255, 0.72);
  --ink-faint: rgba(255, 255, 255, 0.55);
  --line-dark: rgba(255, 255, 255, 0.12);

  --p-low: #8a97a6;
  --p-normal: #1a73e8;
  --p-high: #e08a1e;
  --p-critical: #d9382f;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(9, 18, 46, 0.06), 0 4px 14px rgba(9, 18, 46, 0.05);
  --shadow: 0 18px 50px rgba(9, 18, 46, 0.12);
  --shadow-lg: 0 40px 90px rgba(9, 18, 46, 0.28);
  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  font-family: 'Google Sans', Roboto, Arial, sans-serif;
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--text-dark); }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { color: var(--text-medium); }
button { font: inherit; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 2000;
  background: var(--white); color: var(--dark-blue); padding: 10px 16px;
  border-radius: 10px; box-shadow: var(--shadow); text-decoration: none; font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid transparent;
  text-decoration: none; white-space: nowrap;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn:focus-visible { outline: 3px solid rgba(26, 115, 232, 0.35); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(120deg, var(--primary-blue), var(--dark-blue));
  color: var(--white); box-shadow: 0 12px 30px rgba(26, 115, 232, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(26, 115, 232, 0.45); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.85); color: var(--text-dark);
  border-color: var(--border-color);
}
.btn-ghost:hover { border-color: var(--primary-blue); color: var(--primary-blue); background: var(--white); }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border: none;
  background: transparent; color: var(--text-medium); border-radius: 12px; cursor: pointer;
}
.icon-btn:hover { background: var(--bg-light); color: var(--text-dark); }
.icon-btn:focus-visible { outline: 3px solid rgba(26, 115, 232, 0.35); outline-offset: 2px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(9, 18, 46, 0.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-badge {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(140deg, var(--primary-blue), var(--dark-blue));
  box-shadow: 0 8px 20px rgba(26, 115, 232, 0.35); flex: none;
}
.brand-badge svg { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 19px; color: var(--text-dark); white-space: nowrap; }
.brand-sub { font-size: 12.5px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px;
  padding: 6px 14px; border-radius: 999px; background: var(--bg-light);
  border: 1px solid var(--border-color); font-size: 13px; font-weight: 600; color: var(--text-medium);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-light); transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.status-dot.live { background: #2e9e6b; box-shadow: 0 0 0 4px rgba(46, 158, 107, 0.16); }
.status-dot.warn { background: #e08a1e; box-shadow: 0 0 0 4px rgba(224, 138, 30, 0.16); }
.status-dot.offline { background: var(--p-critical); box-shadow: 0 0 0 4px rgba(217, 56, 47, 0.16); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  background: var(--navy); color: var(--white);
  padding: clamp(64px, 9vw, 104px) 0 clamp(72px, 10vw, 120px);
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(90% 120% at 50% -10%, rgba(26, 115, 232, 0.45), transparent 62%),
    linear-gradient(180deg, rgba(7, 15, 38, 0.2), rgba(7, 15, 38, 0.9));
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; }
.hero-kicker {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: #8fbaff; margin-bottom: 16px;
}
.hero h1 { color: var(--white); margin-bottom: 14px; }
.hero h1 .gradient-text {
  background: linear-gradient(120deg, #7db4ff, #ffffff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--ink-soft); font-size: clamp(1rem, 1.4vw, 1.15rem); }

.hero-inner > * { opacity: 0; transform: translateY(18px); animation: rise 0.8s var(--ease) forwards; }
.hero-inner > *:nth-child(1) { animation-delay: 0.04s; }
.hero-inner > *:nth-child(2) { animation-delay: 0.12s; }
.hero-inner > *:nth-child(3) { animation-delay: 0.2s; }
.hero-inner > *:nth-child(4) { animation-delay: 0.28s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.hero-stats {
  display: inline-flex; align-items: center; gap: 22px; margin-top: 30px;
  padding: 14px 26px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-dark);
  backdrop-filter: blur(8px);
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--white); line-height: 1.1; }
.stat-label { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }
.stat-divider { width: 1px; height: 34px; background: var(--line-dark); }

/* ---------- feed ---------- */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.feed-wrap { max-width: 820px; }
.feed-head { text-align: center; margin-bottom: clamp(28px, 4vw, 44px); }
.feed-head h2 { margin-bottom: 8px; }
.feed-head p { font-size: 1.02rem; }

.feed { display: flex; flex-direction: column; gap: 14px; }

.card {
  position: relative; display: flex; gap: 16px;
  background: var(--white); border: 1px solid rgba(9, 18, 46, 0.08);
  border-radius: var(--radius); padding: 20px 20px 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  animation: cardIn 0.5s var(--ease) both;
}
.card:hover { transform: translateY(-3px); border-color: rgba(26, 115, 232, 0.28); box-shadow: var(--shadow); }
@keyframes cardIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.card-bar { width: 4px; border-radius: 999px; background: var(--p-normal); flex: none; }
.card[data-priority="low"] .card-bar { background: var(--p-low); }
.card[data-priority="normal"] .card-bar { background: var(--p-normal); }
.card[data-priority="high"] .card-bar { background: var(--p-high); }
.card[data-priority="critical"] .card-bar { background: var(--p-critical); }

.card-body { flex: 1; min-width: 0; }
.card-top { display: flex; align-items: center; gap: 12px; }
.card-title { font-size: 1.02rem; font-weight: 700; color: var(--text-dark); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  background: var(--light-blue); color: var(--dark-blue);
}
.card[data-priority="low"] .badge { background: #eef1f4; color: #5f6b78; }
.card[data-priority="normal"] .badge { background: var(--light-blue); color: var(--dark-blue); }
.card[data-priority="high"] .badge { background: #fdf1de; color: #a5640c; }
.card[data-priority="critical"] .badge { background: #fdecea; color: #b3261e; }

.card-message { margin-top: 8px; color: var(--text-medium); font-size: 0.97rem; line-height: 1.55; }
.card-meta { margin-top: 12px; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-light); }
.card-meta a { color: var(--primary-blue); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.card-meta a:hover { text-decoration: underline; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 40px 20px; }
.empty[hidden] { display: none; }
.empty-icon {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 20px; color: var(--primary-blue);
  background: linear-gradient(135deg, rgba(26, 115, 232, 0.12), rgba(13, 71, 161, 0.12));
  border: 1px solid rgba(26, 115, 232, 0.18);
}
.empty h3 { margin-bottom: 8px; }
.empty p { max-width: 360px; margin: 0 auto; }
.empty .btn { margin-top: 20px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(7, 15, 38, 0.55); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; width: 100%; max-width: 440px; background: var(--white);
  border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-lg);
  animation: rise 0.35s var(--ease) forwards;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-help { font-size: 0.95rem; margin-bottom: 18px; }
.field { display: block; }
.field-label { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-light); margin-bottom: 8px; }
.field input {
  width: 100%; min-height: 48px; padding: 12px 14px; font: inherit; font-size: 15px;
  color: var(--text-dark); background: var(--bg-light);
  border: 1px solid var(--border-color); border-radius: 12px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.field input:focus { outline: none; background: var(--white); border-color: var(--primary-blue); box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.14); }
.field-error { color: var(--p-critical); font-size: 13px; font-weight: 600; margin-top: 8px; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.modal-actions .spacer { flex: 1; }

/* ---------- footer ---------- */
.site-footer { padding: 34px 0; text-align: center; border-top: 1px solid rgba(9, 18, 46, 0.06); background: var(--white); }
.site-footer p { font-size: 13.5px; color: var(--text-light); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .container { padding: 0 18px; }
  .brand-sub { display: none; }
  .status-pill { padding: 5px 11px; font-size: 12px; }
  .hero-stats { width: 100%; justify-content: center; }
  .card-top { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .status-pill #statusText { display: none; }
  .status-pill { padding: 8px; min-height: 34px; }
  #keyButtonText { display: none; }
  .btn-ghost { padding: 10px 12px; }
  .brand-badge { width: 38px; height: 38px; }
  .brand-badge svg { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-inner > * { opacity: 1 !important; transform: none !important; }
}
