/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:      #0bb3c7;
  --accent-dim:  #0899ab;
  --accent-glow: rgba(11,179,199,0.20);
  --accent-soft: rgba(11,179,199,0.08);
  --bg:          #080d0f;
  --surface:     #0d1416;
  --surface2:    #121b1e;
  --border:      rgba(11,179,199,0.10);
  --border-hi:   rgba(11,179,199,0.28);
  --text:        #ddeaec;
  --text-muted:  #4e6e76;
  --text-dim:    #2e4a52;
  --green:       #4ade80;
  --green-soft:  rgba(74,222,128,0.08);
  --green-border:rgba(74,222,128,0.30);
  --mono:        'JetBrains Mono', 'Fira Mono', 'Cascadia Code', 'Courier New', monospace;
  --sans:        'DM Sans', 'Outfit', system-ui, sans-serif;
  --radius:      16px;
  --radius-sm:   9px;
  --radius-xs:   6px;
}

html, body { height: 100%; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px 56px;
  position: relative;
  overflow-x: hidden;
  align-items: flex-start;
  cursor: default;
}

/* center vertically only when content clearly fits */
@media (min-height: 700px) and (min-width: 600px) {
  body { align-items: flex-start; }
}

/* ── Background ─────────────────────────────────────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(11,179,199,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,179,199,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
}

.bg-glow {
  position: fixed; z-index: 0; pointer-events: none;
  left: 50%; transform: translateX(-50%);
  width: 700px; height: 420px;
  background: radial-gradient(ellipse, rgba(11,179,199,0.09) 0%, transparent 68%);
}

/* ── Wrap ───────────────────────────────────────────────────────────────────── */
.wrap {
  position: relative; z-index: 1;
  width: 100%; max-width: 540px;
  animation: fadeUp .6s cubic-bezier(.22,1,.36,1) both;
}

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

/* ── Header ─────────────────────────────────────────────────────────────────── */
.header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
}

.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%,100% { opacity:1; box-shadow: 0 0 8px var(--accent); }
  50%      { opacity:.45; box-shadow: 0 0 18px var(--accent); }
}

.time-badge {
  font-family: var(--mono); font-size: 11px;
  color: var(--text-muted); letter-spacing: .06em;
  background: var(--surface2); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 999px;
}

/* ── IP Hero Card ───────────────────────────────────────────────────────────── */
.ip-card {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 30px 28px 26px;
  margin: 14px 0;
  position: relative; overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(11,179,199,0.04),
    0 8px 40px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(11,179,199,0.09);
}

.ip-card::before {
  content: '';
  position: absolute; top:0; left:0; right:0; height:1px;
  background: linear-gradient(90deg, transparent 5%, var(--accent) 40%, var(--accent) 60%, transparent 95%);
  opacity: .5;
}

.ip-card::after {
  content: '';
  position: absolute; bottom:-60px; right:-40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(11,179,199,0.06), transparent 70%);
  pointer-events: none;
}

.ip-label {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: .20em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 12px;
  display: flex; align-items: center; gap: 7px;
  font-weight:bold;
}

.ip-value {
  font-family: var(--mono);
  font-size: clamp(24px, 6vw, 36px);
  font-weight: 700; color: #fff;
  letter-spacing: -.02em; line-height: 1;
  margin-bottom: 22px; word-break: break-all;
}

/* ── Buttons Row ────────────────────────────────────────────────────────────── */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: var(--radius-sm); font-family: var(--mono);
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em;
  padding: 9px 18px; cursor: pointer;
  transition: background .18s, border-color .18s, box-shadow .18s, transform .1s;
  user-select: none; outline: none; border: 1px solid;
}
.btn:active { transform: scale(.96); }

.btn svg {
  width: 13px; height: 13px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}

.btn-primary {
  background: var(--accent-soft); border-color: var(--border-hi); color: var(--accent);
}
.btn-primary:hover {
  background: rgba(11,179,199,0.14); border-color: var(--accent);
  box-shadow: 0 0 20px rgba(11,179,199,0.18);
}
.btn-primary.copied {
  color: var(--green); border-color: var(--green-border); background: var(--green-soft);
}

/* ── Details Card ───────────────────────────────────────────────────────────── */
.details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.35);
}

.detail-row {
  display: flex; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  gap: 12px; transition: background .15s;
}
.detail-row:last-child { border-bottom: none; }
.detail-row:hover { background: var(--accent-soft); }

.detail-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.detail-icon svg {
  width: 14px; height: 14px;
  fill: none; stroke: var(--accent); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; opacity: .85;
}

.detail-key {
  font-size: 13px; color: var(--text-muted);
  letter-spacing: .03em; flex: 0 0 96px;
}

.detail-val {
  font-family: var(--mono); font-size: 13px;
  color: var(--text); flex: 1; word-break: break-all; text-align: right;
}

.detail-val .badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
}
.badge-v4 { background: rgba(11,179,199,0.12); color: var(--accent); border: 1px solid rgba(11,179,199,0.25); }
.badge-v6 { background: rgba(139,92,246,0.12); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }
.badge-https { background: rgba(74,222,128,0.10); color: var(--green); border: 1px solid var(--green-border); }
.badge-http  { background: rgba(251,191,36,0.10); color: #fbbf24; border: 1px solid rgba(251,191,36,0.25); }

/* ── curl Box ───────────────────────────────────────────────────────────────── */
.curl-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.35);
}

.curl-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px 0;
}

.curl-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(11,179,199,0.08); border: 1px solid var(--border-hi);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.curl-icon svg {
  width: 15px; height: 15px;
  fill: none; stroke: var(--accent); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

.curl-title { font-size: 15px; font-weight: 600; color: var(--text); }
.curl-desc  {
  font-size: 13px; color: var(--text-muted); line-height: 1.55;
  padding: 8px 18px 14px;
}

.curl-cmd-wrap {
  margin: 0 18px 18px;
  background: var(--surface2); border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm); overflow: hidden;
}

.curl-cmd-bar {
  display: flex; align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}

.curl-prompt {
  font-family: var(--mono); font-size: 12px;
  color: var(--accent); opacity: .6;
  padding: 10px 0; margin-right: 8px; flex-shrink: 0;
}

.curl-cmd-text {
  font-family: var(--mono); font-size: 13px;
  color: var(--text); flex: 1;
  padding: 10px 0; letter-spacing: .02em;
}

.curl-cmd-text .cmd-highlight { color: var(--accent); }

.curl-copy-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .07em; color: var(--text-muted);
  cursor: pointer; padding: 10px 0 10px 12px;
  transition: color .15s; flex-shrink: 0;
}
.curl-copy-btn:hover { color: var(--accent); }
.curl-copy-btn.copied { color: var(--green); }
.curl-copy-btn svg {
  width: 12px; height: 12px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.curl-hint {
  padding: 10px 14px;
  font-family: var(--mono); font-size: 12px;
  color: var(--text-dim); letter-spacing: .05em;
  font-weight: bold;
}
.curl-hint span { color: var(--text-muted); }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.footer {
  text-align: center; margin-top: 20px;
  font-family: var(--mono); font-size: 11px;
  color: var(--text-dim); letter-spacing: .10em;
}

/* ── Responsive — 13-inch / small laptop (≤ 1280px) ────────────────────────── */
@media (max-width: 1280px) {
  .wrap { max-width: 500px; }
}

/* ── Responsive — tablet landscape (≤ 1024px) ──────────────────────────────── */
@media (max-width: 1024px) {
  body { padding: 24px 20px 40px; align-items: flex-start; }
  .wrap { max-width: 600px; margin: 0 auto; }
  .bg-grid { background-size: 36px 36px; }
}

/* ── Responsive — tablet portrait (≤ 768px) ────────────────────────────────── */
@media (max-width: 768px) {
  body { padding: 20px 16px 36px; }

  .wrap { max-width: 100%; }

  .header { margin-bottom: 20px; }

  .time-badge {
    font-size: 9px;
    padding: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    max-width: 160px;
    text-overflow: ellipsis;
  }

  .ip-card { padding: 22px 18px 20px; margin-bottom: 10px; }

  .ip-value { font-size: clamp(20px, 5.5vw, 28px); margin-bottom: 16px; }

  .btn { padding: 9px 16px; font-size: 14px; }

  .details { margin-bottom: 10px; }

  .detail-row { padding: 11px 14px; gap: 10px; }

  .detail-icon { width: 28px; height: 28px; border-radius: 7px; }
  .detail-icon svg { width: 13px; height: 13px; }

  .detail-key { font-size: 11px; flex: 0 0 80px; }
  .detail-val  { font-size: 11.5px; }

  .curl-header { padding: 12px 14px 0; gap: 8px; }
  .curl-icon   { width: 28px; height: 28px; }
  .curl-title  { font-size: 12.5px; }
  .curl-desc   { font-size: 11px; padding: 7px 14px 12px; }

  .curl-cmd-wrap { margin: 0 14px 14px; }
  .curl-cmd-text { font-size: 13px; }
  .curl-prompt   { font-size: 12px; }
  .curl-hint     { font-size: 11px; padding: 8px 12px; }

  .footer { font-size: 9.5px; margin-top: 16px; }
}

/* ── Responsive — mobile (≤ 480px) ─────────────────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 16px 12px 32px; }

  .brand { font-size: 11px; letter-spacing: .14em; }
  .brand-dot { width: 7px; height: 7px; }

  .time-badge {
    font-size: 8.5px; padding: 3px 7px;
    max-width: 130px;
  }

  .header { margin-bottom: 16px; }

  .ip-card { padding: 18px 14px 16px; border-radius: 12px; }
  .ip-label { font-size: 12px; letter-spacing: .16em; margin-bottom: 10px; font-weight: bold;}
  .ip-value {
    font-size: clamp(18px, 5vw, 24px);
    margin-bottom: 14px;
  }

  .btn { padding: 8px 14px; font-size: 10.5px; }
  .btn svg { width: 12px; height: 12px; }

  .details { border-radius: 12px; margin-bottom: 10px; }
  .detail-row { padding: 10px 12px; gap: 8px; }
  .detail-icon { width: 26px; height: 26px; border-radius: 6px; }
  .detail-icon svg { width: 12px; height: 12px; }
  .detail-key { font-size: 10.5px; flex: 0 0 70px; }
  .detail-val  { font-size: 11px; }

  .badge { font-size: 9px !important; padding: 2px 6px !important; }

  .curl-box { border-radius: 12px; }
  .curl-header { padding: 12px 12px 0; }
  .curl-desc   { font-size: 10.5px; padding: 6px 12px 10px; line-height: 1.5; }
  .curl-cmd-wrap { margin: 0 12px 12px; border-radius: 8px; }
  .curl-cmd-bar { padding: 0 10px; }
  .curl-cmd-text { font-size: 12px; }
  .curl-prompt   { font-size: 11px; margin-right: 6px; }
  .curl-copy-btn { font-size: 11px; padding: 9px 0 9px 10px; }
  .curl-hint { font-size: 9.5px; padding: 7px 10px; }

  .bg-grid { background-size: 28px 28px; }
}

/* ── Responsive — very small phones (≤ 360px) ──────────────────────────────── */
@media (max-width: 360px) {
  body { padding: 12px 10px 28px; }

  .ip-value { font-size: 17px; }

  .time-badge { display: none; } /* too cramped — hide on tiny screens */

  .detail-key { flex: 0 0 62px; }
}

/* ── Auto Check Hint ────────────────────────────────────────────────────────── */
.auto-hint {
  display: flex; align-items: flex-start; gap: 7px;
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: var(--radius-xs);
  background: var(--surface2);
  border: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px;
  color: var(--text-muted); line-height: 1.55; letter-spacing: .02em;
  overflow: hidden;
  max-height: 0; padding-top: 0; padding-bottom: 0;
  margin-top: 0; opacity: 0; border-width: 0;
  transition: max-height .35s cubic-bezier(.22,1,.36,1),
              opacity .25s ease,
              margin-top .35s cubic-bezier(.22,1,.36,1),
              padding .3s ease,
              border-width .3s ease;
}
.auto-hint.visible {
  max-height: 60px;
  padding-top: 10px; padding-bottom: 10px;
  margin-top: 14px; opacity: 1; border-width: 1px;
}
.auto-hint svg {
  width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px;
  fill: none; stroke: var(--text-dim); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ── Auto Check Button ───────────────────────────────────────────────────────── */
@property --ba {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.btn-auto {
  position: relative;
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-auto:hover {
  background: var(--accent-soft);
  border-color: var(--border-hi);
  color: var(--accent);
  box-shadow: none;
}
.btn-auto.active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}
.btn-auto.active::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--ba),
    rgba(11,179,199,.1)  0deg,
    rgba(11,179,199,.1)  305deg,
    var(--accent)        340deg,
    rgba(255,255,255,.9) 355deg,
    var(--accent)        360deg
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: btn-shimmer 2s linear infinite;
  pointer-events: none;
}
@keyframes btn-shimmer {
  to { --ba: 360deg; }
}

.btn-auto.active svg polyline {
  stroke-dasharray: 80;
  animation: icon-ecg 1.4s ease-in-out infinite;
}
@keyframes icon-ecg {
  0%   { stroke-dashoffset:  80; opacity: .3; }
  45%  { stroke-dashoffset:   0; opacity: 1;  }
  100% { stroke-dashoffset: -80; opacity: .3; }
}

/* ── IP Changed Banner ────────────────────────────────────────────────────────── */
.ip-changed-banner {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  width: calc(100% - 40px);
  max-width: 500px;
  background: #0f0b04;
  border: 1px solid rgba(245,158,11,.45);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 16px 56px rgba(0,0,0,.7), 0 0 0 1px rgba(245,158,11,.06);
  animation: bannerIn .35s cubic-bezier(.22,1,.36,1) both;
}
@keyframes bannerIn {
  from { opacity:0; transform: translateX(-50%) translateY(-14px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}
.banner-top {
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, #f59e0b 40%, #f59e0b 60%, transparent 95%);
  opacity: .85;
}
.banner-body {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px 12px;
}
.banner-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(245,158,11,.10);
  border: 1px solid rgba(245,158,11,.25);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.banner-icon svg {
  width: 16px; height: 16px;
  fill: none; stroke: #f59e0b; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.banner-content { flex: 1; min-width: 0; }
.banner-title {
  font-size: 13px; font-weight: 600;
  color: #f59e0b; margin-bottom: 5px; letter-spacing: .02em;
}
.banner-history {
  display: flex; flex-direction: column; gap: 0;
}
.change-entry {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; flex-wrap: wrap;
  padding: 6px 0;
}
.change-entry + .change-entry {
  border-top: 1px solid rgba(245,158,11,.12);
}
.banner-ip-block {
  display: flex; align-items: center; gap: 6px;
}
.banner-flag {
  width: 16px; height: 16px;
  border-radius: 3px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,.1);
  flex-shrink: 0;
}
.banner-ip-meta {
  display: flex; flex-direction: column; gap: 1px;
}
.ip-old {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(245,158,11,.4);
  font-weight: bold;
}
.ip-new { color: #fff; font-weight: 600; }
.country-label { font-size: 10px; letter-spacing: .03em;font-weight: bold; }
.country-old { color: var(--text-muted); }
.country-new { color: rgba(245,158,11,.65); }
.arrow-icon {
  width: 13px; height: 13px;
  fill: none; stroke: #f59e0b; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.banner-footer {
  padding: 0 18px 14px;
  display: flex; justify-content: flex-end;
}
.banner-dismiss {
  background: rgba(245,158,11,.10);
  border: 1px solid rgba(245,158,11,.30);
  color: #f59e0b;
  border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .06em; padding: 8px 18px;
  cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.banner-dismiss:hover { background: rgba(245,158,11,.18); }

/* ── FAQ / About Section ────────────────────────────────────────────────────── */
.faq-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 8px;
  margin-bottom: 14px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.35);
}

.faq-heading {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .20em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-weight: 600;
}

.faq-item {
  border-top: 1px solid var(--border);
  padding: 11px 0;
}
.faq-item:first-of-type { border-top: none; padding-top: 0; }

.faq-item h3 {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: .01em;
}

.faq-item p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-item code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 5px;
  border-radius: 4px;
}

@media (max-width: 480px) {
  .faq-section { padding: 16px 14px 6px; }
  .faq-item h3 { font-size: 12px; }
  .faq-item p  { font-size: 11px; }
}

@media (max-width: 480px) {
  .ip-changed-banner { top: 12px; width: calc(100% - 24px); }
  .banner-body { gap: 10px; padding: 13px 14px 10px; }
  .banner-footer { padding: 0 14px 12px; }
  .banner-title { font-size: 12px; }
  .change-entry { font-size: 11px; }
  .banner-dismiss { font-size: 10px; padding: 7px 14px; }
}
