/* ipPuffin — solid-black, mobile-first, minimal. */

:root {
  --bg: #000;
  --fg: #f4f4f5;
  --muted: #9a9a9f;
  --line: #1c1c1e;
  --card: #0d0d0e;
  --accent: #f5a623;          /* puffin-beak orange */
  --screen-fg: #efefef;       /* matches the baked-in screen text */

  /* Isometric plane of the laptop screen (measured from the artwork).
     Reading axis slopes ~23° down-to-the-right; the +6° skew counters the
     rotation so the glyphs stay upright (not italic) while the baseline still
     sits on the plane. Tweak these if the overlay ever drifts from the label. */
  --iso-rotate: 23deg;
  --iso-skew: 6deg;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}

/* ── Masthead ─────────────────────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
.masthead__logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.masthead__accent { color: var(--accent); }

/* visually-hidden, still available to screen readers */
.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;
}

/* ── Hero + isometric screen overlay ──────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  container-type: inline-size;   /* enables cqw units for the overlay */
  aspect-ratio: 1 / 1;
}
.hero__img {
  display: block;
  width: 100%;
  height: auto;
}

/* Live-IP overlay — Montserrat, scaled to blend with the baked-in label.
   Dropped onto the value line right below the artwork's "IP:". scaleX condenses
   Montserrat to match the narrower baked font; see --iso-* for the plane. */
.screen {
  position: absolute;
  left: 26.4%;
  top: 48.7%;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 4.5cqw;
  color: var(--screen-fg);
  white-space: nowrap;
  line-height: 1;
  /* soft edge so the overlay matches the artwork's anti-aliased text */
  text-shadow: 0 0 1.2px rgba(239, 239, 239, 0.45);
  transform-origin: left center;
  /* --screen-sx is set by app.js to shrink longer IPs so they never overflow
     the laptop screen; 0.6 is the default that matches the baked-in label. */
  transform: translateY(-50%) rotate(var(--iso-rotate)) skewX(var(--iso-skew)) scaleX(var(--screen-sx, 0.6));
  pointer-events: none;
}
.screen__value { font-variant-numeric: tabular-nums; }

/* ── Results ──────────────────────────────────────────────────────────── */
.results { margin-top: 28px; }

.ip-headline { text-align: center; margin-bottom: 22px; }
.ip-headline__eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.ip-headline__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
/* Mirror-spacer opposite the copy button so the IP value stays truly centered
   (the button sits symmetrically to its right instead of shoving it left). */
.ip-headline__row::before {
  content: "";
  flex: 0 0 40px;
  width: 40px;
}
.ip-headline__value {
  margin: 0;
  font-size: clamp(1.8rem, 8vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}
.dev-note {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: var(--accent);
  opacity: 0.85;
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.fact {
  position: relative;
  background: var(--card);
  padding: 14px 42px 14px 16px;   /* right padding reserves room for copy btn */
  min-width: 0;
}
.fact--wide { grid-column: 1 / -1; }
.fact dt {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}
.fact dd {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 500;
  word-break: break-word;
}
.fact__ua {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
}
.fact__asn {
  color: var(--muted);
  font-weight: 400;
}

/* ── Copy buttons ─────────────────────────────────────────────────────── */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
  transition: color .15s, background .15s, opacity .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.copy-btn svg { width: 1em; height: 1em; display: block; }
.copy-btn:hover { color: var(--fg); }
.copy-btn:active { transform: scale(0.9); }
.copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.copy-btn.is-copied { color: #43c463; }   /* green check on success */

/* Large button beside the headline IP — always visible */
.copy-btn--lg {
  font-size: 1.35rem;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--line);
}
.copy-btn--lg:hover { border-color: #333; background: #141416; }

/* Per-fact button — appears on hover / keyboard focus */
.fact .copy-btn {
  position: absolute;
  top: 12px;
  right: 10px;
  font-size: 1rem;
  width: 26px;
  height: 26px;
  opacity: 0;
}
.fact:hover .copy-btn,
.fact:has(.copy-btn:focus-visible) .copy-btn,
.fact .copy-btn.is-copied { opacity: 1; }

/* Touch devices have no hover — keep the affordance faintly visible */
@media (hover: none) {
  .fact .copy-btn { opacity: 0.55; }
}

/* ── Globe ────────────────────────────────────────────────────────────── */
.globe-section {
  margin: 30px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.globe {
  width: 260px;
  max-width: 72vw;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.globe__svg { display: block; overflow: visible; }
.globe__graticule {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 0.5;
}
.globe__land {
  fill: #3a3d47;
  stroke: #4c505c;
  stroke-width: 0.4;
}
.globe__rim {
  fill: none;
  stroke: rgba(245, 166, 35, 0.35);
  stroke-width: 1;
}
.globe__marker { fill: var(--accent); }
.globe__pulse {
  fill: var(--accent);
  transform-origin: center;
  transform-box: fill-box;
  animation: globe-pulse 2.4s ease-out infinite;
}
@keyframes globe-pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  70%  { transform: scale(3.4); opacity: 0;   }
  100% { transform: scale(3.4); opacity: 0;   }
}
.globe-caption {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .globe__pulse { animation: none; opacity: 0; }
}

/* ── Ad slot (space reserved to avoid layout shift when the unit loads) ── */
.ad-slot {
  margin: 26px auto 0;
  display: flex;
  justify-content: center;
}
.ad-placeholder {
  width: 100%;
  max-width: 336px;
  min-height: 280px;           /* reserves a 336×280 medium-rectangle slot */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px dashed #2a2a2c;
  border-radius: 12px;
  color: #55555a;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
}
.ad-placeholder small { font-size: 0.62rem; letter-spacing: 0.06em; text-transform: none; }

/* ── Footer ───────────────────────────────────────────────────────────── */
/* Subtle terminal hint — devs clock it instantly, everyone else scrolls past. */
.curl-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 5px 8px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}
.curl-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  color: #9a9a9f;
}
.curl-hint code::before { content: "$ "; color: #55555a; }
.curl-hint .copy-btn--curl {
  font-size: 0.9rem;
  width: 22px;
  height: 22px;
  color: #6f6f76;
}

.site-footer {
  margin-top: 30px;
  text-align: center;
  color: #5a5a5f;
  font-size: 0.74rem;
}
.site-footer p { margin: 4px 0; }
.site-footer__by { color: #47474c; }
.site-footer__by a {
  color: #77777e;
  text-decoration: none;
  border-bottom: 1px solid #2e2e33;
  transition: color .15s, border-color .15s;
}
.site-footer__by a:hover { color: var(--accent); border-color: var(--accent); }

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