:root {
  --accent:      #9333EA;
  --accent-soft: #C084FC;
  --ink:         #1C1B1F;
  --bg:          #FAF7F2;
  --surface:     #FFFFFF;
  --text:        #2B2730;
  --muted:       #756C81;
  --line:        #EAE2D8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito Sans", "Baloo 2", sans-serif;
  color: var(--text);
  background-color: var(--bg);
}

/* ── Header ─────────────────────────────────────────── */

.site-header {
  border-bottom: 3px solid var(--ink);
  background: var(--surface);
}

.header-inner {
  width: min(100% - 2rem, 960px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}

.brand-mark {
  width: clamp(68px, 10vw, 132px);
  height: clamp(68px, 10vw, 132px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.wordmark {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: -0.3px;
  line-height: 1;
}

.ip-part   { color: var(--accent); }
.tool-part { color: var(--ink); }

.brand-sublabel {
  font-family: "Nunito Sans", sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* ── Subnav ──────────────────────────────────────────── */

.subnav {
  border-bottom: 1px solid var(--line);
  background: rgba(147, 51, 234, 0.05);
}

.subnav-inner {
  width: min(100% - 2rem, 960px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.55rem 0;
}

.subnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.85;
}

.subnav a:hover { color: var(--accent); opacity: 1; }
.subnav a[aria-current="page"] { color: var(--accent); opacity: 1; }

.subnav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.subnav-dropdown-toggle {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.85;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.subnav-dropdown-toggle:hover { color: var(--accent); opacity: 1; }
.subnav-dropdown-toggle[aria-expanded="true"] { color: var(--accent); opacity: 1; }

.subnav-dropdown-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.35rem 0;
  min-width: 230px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(28, 27, 31, 0.12);
}

.subnav-dropdown-menu.open {
  display: flex;
}

.subnav-dropdown-menu a {
  display: block;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.9;
}

.subnav-dropdown-menu a:hover { color: var(--accent); opacity: 1; }
.subnav-dropdown-menu a[aria-current="page"] { color: var(--accent); opacity: 1; }

/* ── Footer ──────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 1.25rem 0;
}

.footer-inner {
  width: min(100% - 2rem, 960px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
  justify-self: start;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover { color: var(--accent); }

.footer-attribution {
  justify-self: center;
  text-align: center;
}

.footer-copyright {
  justify-self: end;
  text-align: right;
}

.footer-inner small a {
  color: var(--muted);
}

.footer-inner small a:hover { color: var(--accent); }

.link-button {
  font: inherit;
  font-size: inherit;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.link-button:hover { color: var(--accent); }

/* ── Cookie banner ───────────────────────────────────── */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--ink);
  border-top: 3px solid var(--ink);
  box-shadow: 0 -4px 16px rgba(28, 27, 31, 0.16);
}

.cookie-banner-inner {
  width: min(100% - 2rem, 960px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.cookie-banner-inner p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--bg);
  max-width: 60ch;
}

.cookie-banner-actions {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-cookie {
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 0.6rem;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-cookie-accept {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.btn-cookie-accept:hover { background: #7E22CE; border-color: #7E22CE; }

.btn-cookie-reject {
  color: var(--bg);
  background: transparent;
  border-color: var(--muted);
}

.btn-cookie-reject:hover { border-color: var(--bg); }

@media (max-width: 760px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Layout ──────────────────────────────────────────── */

.wrap {
  width: min(100% - 2rem, 960px);
  margin: 0 auto;
  padding: 3rem 0;
}

.hero {
  margin-bottom: 1.25rem;
}

h1 {
  margin: 0;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.3px;
  color: var(--ink);
}

h2 {
  margin: 0;
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.sub {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ── Cards ───────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 2px 10px rgba(28, 27, 31, 0.04);
}

.card + .card {
  margin-top: 1rem;
}

/* ── Contact form ────────────────────────────────────── */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 480px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
}

.field-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.btn-primary {
  align-self: flex-start;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 0.6rem;
  padding: 0.65rem 1.3rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: #7E22CE; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.form-status {
  min-height: 1.2em;
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
}

.form-status-success { color: #16A34A; }
.form-status-error { color: #DC2626; }

/* ── Diagnostic table ────────────────────────────────── */

.diag-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
  font-size: 0.9rem;
}

.diag-table tr {
  border-bottom: 1px solid var(--line);
}

.diag-table td {
  vertical-align: top;
  padding: 0.55rem 0.35rem;
}

.diag-table td:first-child {
  width: 34%;
  color: var(--muted);
  font-weight: 600;
}

/* ── Copy button ─────────────────────────────────────── */

.copy-btn {
  margin-top: 0.65rem;
  border: 2px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 0.6rem;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.copy-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ── JSON pre ────────────────────────────────────────── */

#debug-json {
  margin-top: 0.7rem;
  background: #201C29;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.75rem;
  overflow: auto;
  max-height: 420px;
  color: #E9D8FD;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

/* ── IP copy button ──────────────────────────────────── */

.copy-ip-btn {
  background: none;
  border: none;
  padding: 2px 4px;
  margin-left: 0.4rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 0;
  vertical-align: middle;
  border-radius: 0.25rem;
  transition: color 0.15s;
}

.copy-ip-btn:hover { color: var(--accent); }
.copy-ip-btn.copied { color: #16A34A; }

/* ── Geo layout ──────────────────────────────────────── */

.geo-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-top: 0.6rem;
}

.geo-map-wrap {
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
}

.geo-map-wrap iframe {
  display: block;
  width: 100%;
  height: 240px;
  border: none;
}

.geo-caption {
  margin: 0.85rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.85;
}

/* ── Ad slots ────────────────────────────────────────── */

.ad-slot {
  width: min(100% - 2rem, 960px);
  margin: 0 auto;
  padding: 0.5rem 0;
  text-align: center;
  overflow: hidden;
}

.ad-slot-inline {
  margin: 1rem 0;
  text-align: center;
  overflow: hidden;
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 760px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 0.5rem;
  }

  .footer-nav,
  .footer-attribution,
  .footer-copyright {
    justify-self: center;
  }

  .diag-table td:first-child {
    width: 45%;
  }

  .geo-layout {
    grid-template-columns: 1fr;
  }
}
