:root {
  --bg: #07111f;
  --bg-elevated: #0b1728;
  --panel: rgba(17, 32, 51, 0.86);
  --panel-solid: #112033;
  --panel-soft: #0d1b2e;
  --text: #edf5ff;
  --muted: #93a8c2;
  --line: rgba(159, 183, 211, 0.14);
  --primary: #61d9ff;
  --primary-strong: #16bce9;
  --accent: #8b7cff;
  --success: #50dea4;
  --danger: #ff8295;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.26);
  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 12px;
}

:root[data-theme="light"] {
  --bg: #f3f7fb;
  --bg-elevated: #ffffff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --panel-soft: #eef5fb;
  --text: #14243a;
  --muted: #62748a;
  --line: rgba(43, 73, 106, 0.13);
  --primary: #087fa4;
  --primary-strong: #066989;
  --accent: #6254d7;
  --success: #0a9f68;
  --danger: #d33e58;
  --shadow: 0 22px 70px rgba(34, 67, 102, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 12% 3%, rgba(47, 166, 222, 0.15), transparent 30rem),
    radial-gradient(circle at 88% 8%, rgba(123, 89, 255, 0.13), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(97, 217, 255, 0.35);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(97, 217, 255, 0.2), rgba(139, 124, 255, 0.18));
  color: var(--primary);
  font-size: 0.86rem;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.theme-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease;
}

.theme-button:hover {
  transform: translateY(-2px);
  border-color: rgba(97, 217, 255, 0.55);
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 34px;
  padding: clamp(32px, 5vw, 60px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(130deg, rgba(35, 136, 184, 0.13), rgba(111, 74, 220, 0.1)),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  right: -110px;
  top: -150px;
  border-radius: 50%;
  background: rgba(97, 217, 255, 0.1);
  filter: blur(3px);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 790px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 720px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.ip-spotlight {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 22px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid rgba(97, 217, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(5, 13, 24, 0.32);
  backdrop-filter: blur(16px);
}

:root[data-theme="light"] .ip-spotlight {
  background: rgba(255, 255, 255, 0.55);
}

.label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hero-ip {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.35rem, 4vw, 2.15rem);
  letter-spacing: -0.03em;
}

.spotlight-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.button,
.small-button {
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.button {
  min-height: 44px;
  padding: 0 17px;
}

.button:hover:not(:disabled),
.small-button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #031522;
}

.button-secondary {
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--text);
}

.status-message {
  display: flex;
  gap: 11px;
  align-items: center;
  min-height: 48px;
  margin: 20px 0 0;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.91rem;
}

.status-message.success {
  border-color: rgba(80, 222, 164, 0.22);
  color: var(--success);
}

.status-message.error {
  border-color: rgba(255, 130, 149, 0.25);
  color: var(--danger);
}

.spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 2px solid rgba(97, 217, 255, 0.24);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.status-message.success .spinner,
.status-message.error .spinner {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.section {
  padding-top: 72px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-heading h2,
.privacy-note h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  letter-spacing: -0.035em;
}

.section-badge {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.section-badge.success {
  color: var(--success);
}

.section-badge.offline {
  color: var(--danger);
}

.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.feature-card,
.detail-card,
.wide-card,
.privacy-note {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.08);
}

.feature-card {
  min-height: 146px;
  padding: 23px;
  border-radius: var(--radius-md);
}

.location-summary {
  display: flex;
  gap: 20px;
  align-items: center;
}

.country-flag {
  width: 68px;
  height: 68px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  font-size: 2.1rem;
}

.feature-card h3,
.wide-card h3 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.025em;
}

.feature-card p {
  margin: 7px 0 0;
  color: var(--muted);
}

.coordinate-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.coordinate-card strong {
  margin-bottom: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.1rem;
}

.text-link {
  width: fit-content;
  color: var(--primary);
  font-size: 0.89rem;
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.text-link.disabled {
  pointer-events: none;
  opacity: 0.48;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.detail-card {
  min-height: 116px;
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 19px;
  border-radius: var(--radius-md);
  transition: transform 170ms ease, border-color 170ms ease;
}

.detail-card:hover {
  transform: translateY(-2px);
  border-color: rgba(97, 217, 255, 0.28);
}

.detail-card.featured {
  border-color: rgba(97, 217, 255, 0.19);
  background: linear-gradient(145deg, rgba(97, 217, 255, 0.06), transparent 60%), var(--panel);
}

.detail-icon {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--primary);
  font-size: 0.95rem;
}

.detail-card strong {
  display: block;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.35;
}

.wide-card {
  margin-top: 14px;
  padding: 22px;
  border-radius: var(--radius-md);
}

.wide-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.small-button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 0.82rem;
}

code {
  display: block;
  overflow-x: auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.privacy-note {
  display: flex;
  gap: 17px;
  margin-top: 72px;
  padding: 24px;
  border-radius: var(--radius-md);
}

.privacy-note p {
  margin: 8px 0 0;
  color: var(--muted);
}

.privacy-icon {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(97, 217, 255, 0.28);
  border-radius: 12px;
  background: rgba(97, 217, 255, 0.09);
  color: var(--primary);
  font-weight: 900;
}

footer {
  padding: 42px 0 32px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 22px;
  bottom: 22px;
  max-width: min(340px, calc(100% - 44px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
  }

  .site-header {
    min-height: 68px;
  }

  .hero {
    padding: 28px 20px;
    border-radius: 19px;
  }

  .ip-spotlight,
  .section-heading {
    align-items: stretch;
  }

  .ip-spotlight {
    flex-direction: column;
  }

  .spotlight-actions {
    width: 100%;
  }

  .spotlight-actions .button {
    flex: 1;
  }

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

  .section {
    padding-top: 56px;
  }

  .section-heading {
    flex-direction: column;
  }

  .section-badge {
    width: fit-content;
  }
}

@media (max-width: 520px) {
  .details-grid {
    grid-template-columns: 1fr;
  }

  .location-summary {
    align-items: flex-start;
  }

  .country-flag {
    width: 54px;
    height: 54px;
    border-radius: 15px;
    font-size: 1.65rem;
  }

  .privacy-note {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
