:root {
  --bg: #05070c;
  --fg: #e8f4f8;
  --muted: #7a93a0;
  --cyan: #aaffff;
  --cyan-dim: rgba(170, 255, 255, 0.14);
  --orange: #e67e22;
  --orange-soft: rgba(230, 126, 34, 0.35);
  --panel: rgba(8, 14, 22, 0.72);
  --line: rgba(170, 255, 255, 0.16);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  line-height: 1.5;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, transparent 0%, rgba(5, 7, 12, 0.55) 70%, rgba(5, 7, 12, 0.92) 100%),
    linear-gradient(180deg, transparent 0%, rgba(5, 7, 12, 0.35) 100%);
}

.page {
  position: relative;
  z-index: 2;
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 5rem) 0 4rem;
}

.hero {
  text-align: center;
  animation: rise 0.9s ease-out both;
}

.host-label {
  display: none;
}

.wordmark {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: clamp(2.8rem, 10vw, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  animation: breath 6s ease-in-out infinite;
}

.wordmark-ctrl {
  color: var(--cyan);
}

.wordmark-one {
  color: var(--orange);
}

.wordmark-glyph {
  display: none;
}

.lab-by {
  margin: 1rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: none;
  color: var(--cyan);
  animation: rise 1s ease-out 0.12s both;
}

.lab-by a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(170, 255, 255, 0.28);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.lab-by a:hover {
  color: #d6ffff;
  border-bottom-color: var(--cyan);
}

.lab-row,
.lab-logo,
.lab-name {
  display: none;
}

.tagline {
  margin: 1.25rem auto 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
  animation: rise 1s ease-out 0.2s both;
}

.tagline a {
  color: var(--orange);
  text-decoration: none;
  border-bottom: 1px solid var(--orange-soft);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tagline a:hover {
  color: #ff9a3c;
  border-color: #ff9a3c;
}

.section-kicker {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
}

.ip-block {
  margin: 2.5rem auto 0;
  max-width: 36rem;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: rise 1s ease-out 0.28s both;
}

.ip-stack {
  text-align: left;
}

.ip-primary {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ip-addr {
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 3.5vw, 1.55rem);
  font-weight: 600;
  color: var(--orange);
  word-break: break-all;
}

.ip-copy {
  cursor: pointer;
  border-bottom: 1px dashed rgba(230, 126, 34, 0.45);
  transition: color 0.15s ease, border-color 0.15s ease, text-shadow 0.15s ease;
}

.ip-copy:hover,
.ip-copy:focus-visible {
  color: #ff9a3c;
  border-bottom-color: #ff9a3c;
  outline: none;
}

.ip-copy.is-copied {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  text-shadow: 0 0 12px rgba(170, 255, 255, 0.25);
}

.ip-v6 .ip-copy {
  font-size: inherit;
  font-weight: 600;
}

.geo-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  text-decoration: none;
  opacity: 0.8;
}

.geo-link:hover {
  opacity: 1;
}

.ip-meta {
  margin: 0.35rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.ip-geo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ip-geo img {
  display: block;
}

.ip-v6 {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--orange);
  animation: pulse-soft 2.4s ease-in-out infinite;
}

.ip-v6.is-ready {
  animation: none;
}

.ip-v6 a {
  color: var(--cyan);
}

.ip-v6 strong,
.ip-v6 span {
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: 500 !important;
  color: inherit !important;
}

.ip-v6 img {
  height: 12px;
  vertical-align: middle;
}

.tools {
  margin-top: clamp(3rem, 8vh, 4.5rem);
  animation: rise 1s ease-out 0.4s both;
}

.tools-head {
  margin-bottom: 1.25rem;
}

.tools-note {
  margin: 0;
  max-width: 40rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tab:hover {
  color: var(--fg);
  border-color: var(--line);
}

.tab.is-active {
  color: var(--cyan);
  border-color: var(--line);
  background: var(--cyan-dim);
}

.tool-form {
  margin: 0;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#tool-query {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  background: rgba(4, 8, 14, 0.85);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s ease;
}

#tool-query:focus {
  border-color: var(--cyan);
}

#tool-query::placeholder {
  color: rgba(122, 147, 160, 0.7);
}

.type-wrap {
  display: flex;
}

.type-wrap.is-hidden {
  display: none;
}

#dig-type {
  appearance: none;
  padding: 0.75rem 2rem 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 14px) calc(50% - 3px) / 6px 6px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 9px) calc(50% - 3px) / 6px 6px no-repeat,
    rgba(4, 8, 14, 0.85);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

#dig-type:focus {
  border-color: var(--cyan);
}

.run-btn {
  appearance: none;
  border: 1px solid var(--orange-soft);
  background: rgba(230, 126, 34, 0.12);
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.75rem 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.run-btn:hover {
  background: rgba(230, 126, 34, 0.22);
  border-color: var(--orange);
  color: #ff9a3c;
}

.run-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.result {
  margin: 0.85rem 0 0;
  min-height: 10rem;
  max-height: 28rem;
  overflow: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  background: rgba(3, 6, 12, 0.88);
  color: #b7d4de;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.result.is-error {
  color: #ff8e8e;
}

.result.is-loading {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@keyframes breath {
  0%,
  100% {
    text-shadow: 0 0 0 transparent;
    filter: brightness(1);
  }
  50% {
    text-shadow: 0 0 28px rgba(170, 255, 255, 0.18);
    filter: brightness(1.05);
  }
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 560px) {
  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    text-align: center;
    padding-inline: 0.4rem;
  }

  .run-btn {
    width: 100%;
  }

  .ip-block {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .lab-by,
  .tagline,
  .ip-block,
  .tools,
  .wordmark,
  .ip-v6 {
    animation: none !important;
  }
}
