:root {
  --bg:      #f7f8fa;
  --surface: #ffffff;
  --border:  #e2e8f0;
  --text:    #1a202c;
  --muted:   #718096;
  --accent:  #4f46e5;
  --ok:      #16a34a;
  --down:    #dc2626;
  --radius:  8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:      #0f1117;
    --surface: #1a1d27;
    --border:  #2a2d3a;
    --text:    #e2e8f0;
    --muted:   #8892a4;
    --accent:  #818cf8;
    --ok:      #4ade80;
    --down:    #f87171;
  }
}

:root[data-theme="dark"] {
  --bg:      #0f1117;
  --surface: #1a1d27;
  --border:  #2a2d3a;
  --text:    #e2e8f0;
  --muted:   #8892a4;
  --accent:  #818cf8;
  --ok:      #4ade80;
  --down:    #f87171;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 52px;
}

.bio-section {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

.bio-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.bio-text { min-width: 0; }

header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.tagline {
  color: var(--accent);
  font-size: 0.95rem;
  margin-top: 6px;
}

.description {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
}

.section { margin-bottom: 44px; }
.section.hidden { display: none; }

h2 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 14px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading h2 { margin-bottom: 0; }

/* Company cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.card-body {
  display: block;
  flex: 1;
  padding: 18px 20px 14px;
  text-decoration: none;
  color: inherit;
}

.card-label {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.card-title {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 5px;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.card-footer {
  padding: 10px 20px 14px;
  border-top: 1px solid var(--border);
}

.card-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.card-linkedin:hover { color: var(--accent); }

/* Card header — logo + company name over background image */
.card-header {
  height: 140px;
  background: var(--border);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 12px 16px;
  overflow: hidden;
}

.card-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45), rgba(0,0,0,0.75));
  pointer-events: none;
}

.card-header-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-logo {
  height: 26px;
  width: auto;
  max-width: 88px;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
  padding: 3px 6px;
  flex-shrink: 0;
}

.card-name {
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Quick links */
.pill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-list a {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 5px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.15s;
}

.pill-list a:hover { border-color: var(--accent); }

/* Monitors */
.monitor-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.monitor-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 14px;
}

.monitor-section-label:first-child { margin-top: 0; }

.monitor-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.monitor-item {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.monitor-item:hover { border-color: var(--accent); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  align-self: center;
}

.dot.ok   { background: var(--ok); }
.dot.down { background: var(--down); }

.monitor-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.monitor-label {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-meta {
  display: flex;
  align-items: center;
  gap: 5px;
}

.monitor-ms,
.monitor-status {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.monitor-ms { margin-left: auto; }

.hint {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  header {
    flex-direction: column;
    gap: 12px;
  }

  .header-icons {
    order: -1;
    align-self: flex-end;
  }

  .bio-avatar {
    width: 56px;
    height: 56px;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

/* Header icons row */
.header-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  height: 34px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
  flex-shrink: 0;
  width: 34px;
}

.icon-btn:hover { border-color: var(--accent); color: var(--text); }

/* Language dropdown */
.lang-dropdown { position: relative; }

.lang-trigger {
  width: auto;
  padding: 0 10px;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
}

.lang-label { letter-spacing: 0.04em; }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  list-style: none;
  min-width: 130px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  display: none;
  z-index: 10;
}

.lang-dropdown.open .lang-menu { display: block; }

.lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: none;
  background: transparent;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.875rem;
  text-align: left;
  white-space: nowrap;
  transition: background 0.1s;
}

.lang-option:hover { background: var(--border); }

:root[data-lang="en"] .lang-option[data-lang="en"],
:root[data-lang="fr"] .lang-option[data-lang="fr"] { color: var(--accent); }

/* Theme dropdown */
.theme-dropdown { position: relative; }

.theme-trigger {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.theme-trigger:hover { border-color: var(--accent); color: var(--text); }

.theme-trigger .theme-icon { display: none; }

:root:not([data-theme]) .theme-trigger .icon-system,
:root[data-theme="light"] .theme-trigger .icon-light,
:root[data-theme="dark"]  .theme-trigger .icon-dark  { display: block; }

.theme-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  list-style: none;
  min-width: 116px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  display: none;
  z-index: 10;
}

.theme-dropdown.open .theme-menu { display: block; }

.theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: none;
  background: transparent;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.875rem;
  text-align: left;
  white-space: nowrap;
  transition: background 0.1s;
}

.theme-option:hover { background: var(--border); }

:root:not([data-theme]) .theme-option[data-theme="system"],
:root[data-theme="light"] .theme-option[data-theme="light"],
:root[data-theme="dark"]  .theme-option[data-theme="dark"] { color: var(--accent); }
