:root {
  color-scheme: light dark;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-hover: #ffffff;
  --text: #1a1d23;
  --text-muted: #5b616e;
  --border: #e2e4e9;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-hover: 0 4px 10px rgba(16, 24, 40, 0.10), 0 2px 4px rgba(16, 24, 40, 0.08);
  --accent: #2f5fff;
  --focus-ring: #2f5fff;
}

:root[data-theme="dark"] {
  --bg: #14161a;
  --surface: #1c1f26;
  --surface-hover: #23262f;
  --text: #f2f3f5;
  --text-muted: #9aa0ab;
  --border: #2b2f38;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.4);
  --accent: #6b8bff;
  --focus-ring: #6b8bff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 32px;
  width: auto;
  display: none;
}

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

:root[data-theme="dark"] .logo-dark {
  display: block;
}

.brand-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  background: var(--surface-hover);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.theme-toggle .icon {
  width: 18px;
  height: 18px;
  display: none;
}

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

:root[data-theme="dark"] .icon-moon {
  display: block;
}

/* Content */

.content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 24px;
}

.intro h1 {
  font-size: 28px;
  margin: 0 0 8px;
}

.intro p {
  color: var(--text-muted);
  margin: 0 0 32px;
  font-size: 15px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.app-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.app-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: var(--surface-hover);
}

.app-card:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.app-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: color-mix(in srgb, var(--icon-color) 16%, transparent);
}

.app-info h2 {
  font-size: 16px;
  margin: 0 0 6px;
}

.app-info p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.app-url {
  margin-top: 8px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px !important;
  color: var(--accent) !important;
  word-break: break-all;
}

.app-grid-status {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px 0;
}

.app-grid-status-error {
  color: #d1495b;
  max-width: 60ch;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}
