:root {
  --bg: #0a0b14;
  --surface: #10111e;
  --surface-hover: #14152a;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --accent: #6366f1;
  --accent-soft: rgba(99,102,241,0.1);
  --accent-glow: rgba(99,102,241,0.2);
  --yubico-green: #84bd00;
  --yubico-soft: rgba(132,189,0,0.1);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-dim: #71717a;
}

* { box-sizing: border-box; }

/* ══════ COVER PAGE ══════ */
.cover {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.cover.cover-exit {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.cover-bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.cover-glow {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.cover-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 680px;
  padding: 0 24px;
  animation: coverFadeIn 0.8s ease-out;
}

@keyframes coverFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cover-badge {
  display: inline-block;
  font-size: 0.68em;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  border: 1px solid rgba(99,102,241,0.3);
  background: rgba(99,102,241,0.06);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 32px;
}

.cover-name {
  font-size: 3.2em;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.1;
}

.cover-title {
  font-size: 1.05em;
  color: var(--text-secondary);
  margin: 18px 0 0;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.cover-divider {
  width: 48px;
  height: 1px;
  margin: 36px auto;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.cover-hook {
  font-size: 0.92em;
  color: var(--text-dim);
  line-height: 1.8;
  margin: 0 0 40px;
}

.cover-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 48px;
}

.cover-pill {
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 5px 14px;
  border-radius: 16px;
  border: 1px solid;
}

.cover-pill.yubi {
  color: var(--yubico-green);
  border-color: rgba(132,189,0,0.3);
  background: rgba(132,189,0,0.06);
}

.cover-pill.azure {
  color: var(--accent);
  border-color: rgba(99,102,241,0.3);
  background: rgba(99,102,241,0.06);
}

.cover-pill.ai {
  color: #ff9800;
  border-color: rgba(255,152,0,0.3);
  background: rgba(255,152,0,0.06);
}

.cover-enter {
  font-size: 0.9em;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 14px 40px;
  border-radius: 8px;
  border: 1px solid rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.1);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s ease;
  animation: coverPulse 3s ease-in-out infinite;
}

.cover-enter:hover {
  background: rgba(99,102,241,0.18);
  border-color: rgba(99,102,241,0.6);
  box-shadow: 0 0 30px rgba(99,102,241,0.15);
  transform: translateY(-2px);
  animation: none;
}

@keyframes coverPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(99,102,241,0); border-color: rgba(99,102,241,0.4); }
  50% { box-shadow: 0 0 32px rgba(99,102,241,0.3); border-color: rgba(99,102,241,0.7); }
}

.cover-links {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.cover-social {
  color: var(--text-dim);
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.cover-social:hover { color: var(--text-primary); }

@media (max-width: 700px) {
  .cover-name { font-size: 2.2em; }
  .cover-title { font-size: 0.9em; }
  .cover-hook { font-size: 0.84em; }
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 17px;
  color: var(--text-primary);
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow-x: hidden;
}

.grid-overlay { display: none; }

.container { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Top Nav ── */
.topnav {
  display: flex;
  align-items: center;
  background: rgba(9,9,11,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 32px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 24px;
}

.topnav-brand {
  font-size: 0.78em;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-dim);
  flex-shrink: 0;
  font-weight: 600;
}

.topnav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 4px;
  flex-grow: 1;
}

.nav-item {
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  font-size: 0.85em;
  font-weight: 500;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  letter-spacing: 0.2px;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.nav-item.active {
  background: var(--accent-soft);
  border-color: rgba(99,102,241,0.3);
  color: var(--text-primary);
}

.nav-item.yubi-active {
  background: var(--yubico-soft) !important;
  border-color: rgba(132,189,0,0.3) !important;
  color: var(--text-primary) !important;
}

.topnav img {
  height: 22px;
  border-radius: 3px;
  object-fit: contain;
  opacity: 0.9;
}

.topnav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Main content ── */
.main {
  flex-grow: 1;
  padding: 56px 44px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  background: radial-gradient(ellipse 70% 40% at 50% 0%, rgba(99,102,241,0.05) 0%, transparent 65%);
}

/* ── Header ── */
.header-area {
  margin-bottom: 52px;
  text-align: center;
}

.header-area h2 {
  font-size: 2.2em;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 0;
  color: var(--text-primary);
}

.header-area p {
  margin-top: 12px;
  font-size: 0.85em;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.header-divider {
  width: 48px;
  height: 1px;
  margin: 24px auto 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* ── Tiles ── */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  position: relative;
  overflow: hidden;
}

/* Subtle top accent line on every tile */
.tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.tile:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.tile h3 {
  margin: 0 0 14px 0;
  color: var(--text-primary);
  font-size: 0.95em;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.tile p {
  font-size: 0.85em;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0 0 14px 0;
  line-height: 1.65;
}

.tile label {
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-bottom: 6px;
}

/* ── YubiKey section ── */
.yubi-theme .tile::before {
  background: linear-gradient(90deg, transparent, rgba(132,189,0,0.35), transparent);
}

.yubi-theme .tile h3 { color: var(--yubico-green); }

.yubi-theme .tile:hover {
  border-color: rgba(132,189,0,0.22);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(132,189,0,0.06);
}

.yubi-theme button {
  background: rgba(132,189,0,0.08);
  border: 1px solid rgba(132,189,0,0.3);
  color: var(--yubico-green);
}

.yubi-theme button:hover {
  background: rgba(132,189,0,0.14);
  border-color: rgba(132,189,0,0.5);
  opacity: 1;
}

/* Push tile footer (buttons + results) to bottom as a unit */
.tile-footer { margin-top: auto; display: flex; flex-direction: column; }

/* ── Azure section ── */
.azure-theme .tile::before {
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.4), transparent);
}

.azure-theme .tile h3 { color: var(--accent); }

.azure-theme .tile:hover {
  border-color: rgba(99,102,241,0.25);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(99,102,241,0.07);
}

.azure-theme button {
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--accent);
}

.azure-theme button:hover {
  background: rgba(99,102,241,0.14);
  border-color: rgba(99,102,241,0.5);
  opacity: 1;
}

/* ── Inputs ── */
input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: 7px;
  margin-bottom: 10px;
  font-size: 0.88em;
  width: 100%;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: rgba(99,102,241,0.5);
  background: #0d0d10;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--text-primary);
  border-color: var(--border);
}

/* ── Buttons ── */
button {
  background: linear-gradient(180deg, #7577f3 0%, #5f61e8 100%);
  border: none;
  padding: 10px 18px;
  border-radius: 7px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  font-size: 0.85em;
  letter-spacing: 0.3px;
}

button:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* Push standalone buttons to tile bottom */
.tile > button { margin-top: auto; }

button:active {
  transform: translateY(0);
}

/* ── Result and counter boxes ── */
.result-box {
  margin: 12px 0;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.84em;
  color: var(--text-secondary);
  min-height: 20px;
  line-height: 1.8;
}

.counter-box {
  margin-top: 6px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.8em;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ── Info icon ── */
.info-icon { color: var(--text-dim); }
.tile-info { color: var(--text-secondary); }

/* ── Tile Info Button + Modal ── */
.tile-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
  color: var(--text-dim);
  font-size: 0.65em;
  font-weight: 700;
  font-style: italic;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1;
}
.tile-info-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}
.yubi-theme .tile-info-btn:hover {
  color: var(--yubico-green);
  border-color: var(--yubico-green);
}
.azure-theme .tile-info-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.tile-diagram-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
  color: var(--text-dim);
  font-size: 0.6em;
  cursor: pointer;
  margin-left: 4px;
  vertical-align: middle;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1;
}
.tile-diagram-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}
.azure-theme .tile-diagram-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.tile-info-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.tile-info-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  max-width: 1400px;
  width: 95vw;
  max-height: 92vh;
  overflow-y: auto;
}

.tile-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tile-info-header h3 {
  margin: 0;
  font-size: 1.1em;
  color: var(--text-primary);
}

.tile-info-close {
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.tile-info-close:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.tile-info-section {
  margin-bottom: 18px;
}
.tile-info-section:last-child {
  margin-bottom: 0;
}

.tile-info-section h4 {
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin: 0 0 8px 0;
}

.tile-info-section p {
  font-size: 0.88em;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.tile-info-section ul {
  margin: 0;
  padding-left: 18px;
  list-style: none;
}

.tile-info-section li {
  font-size: 0.85em;
  color: var(--text-secondary);
  line-height: 1.7;
  position: relative;
  padding-left: 4px;
}
.tile-info-section li::before {
  content: "—";
  position: absolute;
  left: -16px;
  color: var(--text-dim);
}

/* ── Command Center ── */
.cc-theme .tile::before {
  background: linear-gradient(90deg, transparent, rgba(56,189,248,0.4), transparent);
}
.cc-theme .tile h3 { color: #38bdf8; }
.cc-theme .tile:hover {
  border-color: rgba(56,189,248,0.25);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(56,189,248,0.07);
}
.cc-theme button {
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.3);
  color: #38bdf8;
}
.cc-theme button:hover {
  background: rgba(56,189,248,0.14);
  border-color: rgba(56,189,248,0.5);
  opacity: 1;
}

/* Gauge row */
.cc-gauges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.cc-gauge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.cc-gauge-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56,189,248,0.35), transparent);
}
.cc-gauge-card:hover {
  border-color: rgba(56,189,248,0.25);
  background: var(--surface-hover);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.cc-gauge-title {
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.cc-gauge-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(var(--text-dim) 0deg, var(--surface) 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.cc-gauge-ring::after {
  content: '';
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--surface);
}
.cc-gauge-card:hover .cc-gauge-ring::after {
  background: var(--surface-hover);
}

.cc-gauge-value {
  position: relative;
  z-index: 1;
  font-size: 1.3em;
  font-weight: 700;
  color: var(--text-primary);
}

.cc-gauge-detail {
  font-size: 0.78em;
  color: var(--text-dim);
  margin-top: 10px;
}

.cc-gauge-actions {
  margin-top: 12px;
  display: flex;
  gap: 6px;
}
.cc-gauge-actions button {
  font-size: 0.72em;
  padding: 5px 10px;
}

/* Project cards */
.cc-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.cc-project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.cc-project-name {
  font-weight: 600;
  font-size: 0.9em;
  color: var(--text-primary);
  margin-bottom: 6px;
  text-transform: capitalize;
}

.cc-project-status {
  font-size: 0.8em;
  font-weight: 500;
  margin-bottom: 4px;
}

.cc-project-next {
  font-size: 0.78em;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Quick links */
.cc-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cc-link-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.82em;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}
.cc-link-card:hover {
  border-color: rgba(56,189,248,0.4);
  color: #38bdf8;
}

.cc-link-icon { font-size: 1.2em; }

/* Edit overlay */
.cc-edit-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.cc-edit-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  min-width: 300px;
  max-width: 400px;
}

/* Cost comparison */
.cc-cost-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.cc-cost-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.cc-cost-label {
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.cc-cost-value {
  font-size: 1.4em;
  font-weight: 700;
  line-height: 1.4;
}

.cc-cost-sub {
  font-size: 0.75em;
  color: var(--text-dim);
  margin-top: 6px;
}

.cc-cost-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.85em;
  margin-top: 16px;
}

.cc-cost-table colgroup .cc-col-icon { width: 36px; }
.cc-cost-table colgroup .cc-col-role { width: 28%; }

.cc-cost-table th {
  text-align: right;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.cc-cost-table th:nth-child(1),
.cc-cost-table th:nth-child(2) {
  text-align: left;
}

.cc-cost-table td:first-child,
.cc-cost-table th:first-child {
  width: 30px;
}

.cc-cost-table td:nth-child(2),
.cc-cost-table th:nth-child(2) {
  width: auto;
  padding-right: 20px;
}

.cc-cost-table td {
  padding: 10px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.cc-cost-table .cc-num {
  text-align: right;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.92em;
}

.cc-cost-table .cc-highlight {
  color: #4caf50;
  font-weight: 600;
}

.cc-cost-table .cc-solo {
  color: #ff9800;
}

.cc-cost-table .cc-total-row td {
  border-top: 1px solid var(--border);
  border-bottom: none;
  padding-top: 12px;
}

.cc-cost-footnote {
  font-size: 0.75em;
  color: var(--text-dim);
  line-height: 1.7;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

@media (max-width: 700px) { .cc-cost-summary { grid-template-columns: 1fr; } }

.cc-tailscale-nodes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cc-ts-node {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}

.cc-ts-node-name {
  font-weight: 600;
  font-size: 0.9em;
  color: var(--accent);
}

.cc-ts-node-role {
  font-size: 0.8em;
  color: var(--text-dim);
}

@media (max-width: 1100px) { .cc-gauges { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .cc-gauges { grid-template-columns: 1fr; } }

/* ── Responsive ── */
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) {
  .topnav { padding: 0 16px; gap: 12px; }
  .topnav-brand { display: none; }
  .tiles { grid-template-columns: 1fr; }
  .main { padding: 32px 20px; }
}
