:root {
  --ink: #14201c;
  --ink-soft: #3a4a44;
  --paper: #eef3ef;
  --tile: #f7faf8;
  --tile-border: rgba(20, 32, 28, 0.12);
  --accent: #0f6e56;
  --accent-soft: #c8e6db;
  --vpn: #1d4f91;
  --vpn-soft: #d5e4f7;
  --vpn-tile: #eef3f9;
  --vpn-border: rgba(29, 79, 145, 0.28);
  --bg-glow-a: #b8d9cc;
  --bg-glow-b: #d7e3c8;
  --bg-glow-c: #c5d8e8;
  --bg-mid: #e8f0ea;
  --bg-end: #e6ebe4;
  --toggle-bg: #f7faf8;
  --toggle-border: rgba(20, 32, 28, 0.12);
  --radius: 14px;
  --font-brand: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

html[data-theme="dark"] {
  --ink: #e8e6e3;
  --ink-soft: #9a9590;
  --paper: #121416;
  --tile: #1c1f24;
  --tile-border: rgba(232, 230, 227, 0.12);
  --accent: #2dd4bf;
  --accent-soft: #134e4a;
  --vpn: #93c5fd;
  --vpn-soft: #1e3a5f;
  --vpn-tile: #1a2230;
  --vpn-border: rgba(147, 197, 253, 0.28);
  --bg-glow-a: #1a2a26;
  --bg-glow-b: #242018;
  --bg-glow-c: #1a2430;
  --bg-mid: #14181a;
  --bg-end: #101214;
  --toggle-bg: #1c1f24;
  --toggle-border: rgba(232, 230, 227, 0.12);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.4;
  color-scheme: light;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, var(--bg-glow-a) 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, var(--bg-glow-b) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, var(--bg-glow-c) 0%, transparent 55%),
    linear-gradient(165deg, var(--bg-mid) 0%, var(--paper) 45%, var(--bg-end) 100%);
}

html[data-theme="dark"] body {
  color-scheme: dark;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--toggle-border);
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

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

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) 1.25rem 1.5rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: clamp(2.8rem, 10vw, 5.5rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.tagline {
  margin: 1rem auto 0;
  max-width: 22rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 3.5rem;
}

.tabs {
  display: flex;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 1.5rem;
  padding: 0.2rem;
  border: 1px solid var(--tile-border);
  border-radius: 999px;
  background: var(--tile);
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 1.15rem;
  border-radius: 999px;
  cursor: pointer;
}

.tab:hover {
  color: var(--ink);
}

.tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tab[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.tabs[data-active="vpc"] .tab[aria-selected="true"] {
  background: var(--vpn-soft);
  color: var(--vpn);
}

.tabs[data-active="vpc"] .tab:focus-visible {
  box-shadow: 0 0 0 3px var(--vpn-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.85rem;
}

.grid[hidden] {
  display: none;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
  min-height: 7.25rem;
  padding: 1rem 0.95rem 0.9rem;
  text-decoration: none;
  color: inherit;
  background: var(--tile);
  border: 1px solid var(--tile-border);
  border-radius: var(--radius);
  transition:
    transform 0.15s ease,
    border-color 0.15s ease;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  outline: none;
}

.tile:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tile-name {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tile-host {
  font-size: 0.72rem;
  color: var(--ink-soft);
  word-break: break-all;
}

.tile-vpn {
  border-color: var(--vpn-border);
  background: var(--vpn-tile);
}

.tile-vpn:hover,
.tile-vpn:focus-visible {
  border-color: var(--vpn);
}

.vpn-badge {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  color: var(--vpn);
  background: var(--vpn-soft);
  border-radius: 999px;
}

.vpn-badge::before {
  content: "";
  width: 0.95rem;
  height: 0.95rem;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 4 5v6c0 5 3.4 9.4 8 11 4.6-1.6 8-6 8-11V5l-8-3zm0 2.2 6 2.2v4.6c0 3.9-2.5 7.4-6 8.8-3.5-1.4-6-4.9-6-8.8V6.4l6-2.2z'/%3E%3Cpath fill='black' d='M12 8a2.2 2.2 0 0 0-2.2 2.2v1.1H9v4.4h6v-4.4h-.8V10.2A2.2 2.2 0 0 0 12 8zm0 1.5c.4 0 .7.3.7.7v1.1h-1.4V10.2c0-.4.3-.7.7-.7z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 4 5v6c0 5 3.4 9.4 8 11 4.6-1.6 8-6 8-11V5l-8-3zm0 2.2 6 2.2v4.6c0 3.9-2.5 7.4-6 8.8-3.5-1.4-6-4.9-6-8.8V6.4l6-2.2z'/%3E%3Cpath fill='black' d='M12 8a2.2 2.2 0 0 0-2.2 2.2v1.1H9v4.4h6v-4.4h-.8V10.2A2.2 2.2 0 0 0 12 8zm0 1.5c.4 0 .7.3.7.7v1.1h-1.4V10.2c0-.4.3-.7.7-.7z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile:hover,
  .tile:focus-visible {
    transform: none;
  }
}
