/* whatsmyip.tr. One stylesheet, no build step.
   Shape rule: panels and tiles 12px, inputs and buttons 8px, status tags full pill.
   Colour rule: slate neutrals, one green accent; amber and red only for real warning/error state. */
@font-face {
  font-family: "Plex Sans"; src: url("fonts/plex-sans.woff2") format("woff2");
  font-weight: 100 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #f8fafc;        --surface: #ffffff;   --sunken: #eef2f7;
  --ink: #0f172a;       --muted: #475569;     --line: #d5dde8;    --line-strong: #64748b;
  --accent: #15803d;    --on-accent: #ffffff; --accent-soft: #dcfce7;
  --warn: #b45309;      --bad: #b91c1c;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 8px 24px -12px rgb(15 23 42 / 0.18);

  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --measure: 66ch;
  --r-panel: 12px; --r-control: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  accent-color: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;      --surface: #1b2336;   --sunken: #151c2e;
    --ink: #f8fafc;     --muted: #a3b1c6;     --line: #2c3850;    --line-strong: #64748b;
    --accent: #22c55e;  --on-accent: #0f172a; --accent-soft: #143524;
    --warn: #fbbf24;    --bad: #f87171;
    --shadow: 0 1px 2px rgb(2 6 23 / 0.4), 0 12px 32px -16px rgb(2 6 23 / 0.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; font-size: clamp(100%, 0.72rem + 0.3vw, 137.5%); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--sans); overflow-wrap: break-word; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0; font-weight: 600; }
h1 { font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem); letter-spacing: -0.025em; }
h2 { font-size: 1.5rem; letter-spacing: -0.015em; margin-top: 3.5rem; }
h3 { font-size: 1.0625rem; margin-top: 1.75rem; }
p, ul, ol, dl { margin: 0.75rem 0 0; }
p, li { max-width: var(--measure); text-wrap: pretty; }
ul, ol { padding-left: 1.25rem; }
a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; }
a:hover { text-decoration-thickness: 0.14em; }
code, kbd, samp, pre, .mono { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--sunken); padding: 0.12em 0.4em; border-radius: 5px; border: 1px solid var(--line); }
pre { background: var(--sunken); border: 1px solid var(--line); padding: 1rem 1.125rem; border-radius: var(--r-panel); overflow-x: auto; margin: 1rem 0 0; line-height: 1.55; }
pre code { background: none; padding: 0; border: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(100% - 2.5rem, 76rem); margin-inline: auto; }
.muted { color: var(--muted); }
.lead { font-size: 1.1875rem; color: var(--muted); margin-top: 0.75rem; }
.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.skip { position: absolute; left: 1rem; top: -5rem; background: var(--accent); color: var(--on-accent); padding: 0.6rem 0.9rem; border-radius: var(--r-control); z-index: 30; font-weight: 600; }
.skip:focus { top: 1rem; }

/* Header: one line, 64px, stays reachable while reading long results. */
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
@supports not (background: color-mix(in srgb, red, blue)) { .site-head { background: var(--bg); } }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { font: 700 1.125rem/1 var(--mono); color: var(--ink); text-decoration: none; letter-spacing: -0.03em; padding-block: 0.75rem; white-space: nowrap; }
.brand span { color: var(--accent); }
.site-nav { min-width: 0; }
.site-nav ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav a { display: block; padding: 0.625rem 0.75rem; color: var(--muted); text-decoration: none; font-size: 0.9375rem; font-weight: 500; border-radius: var(--r-control); white-space: nowrap; transition: color 0.15s, background-color 0.15s; }
.site-nav a:hover { color: var(--ink); background: var(--sunken); }
.site-nav a[aria-current] { color: var(--ink); background: var(--sunken); }

main { padding-block: 3rem 5rem; }
.crumbs { font-size: 0.875rem; color: var(--muted); margin: 0 0 0.75rem; }
.crumbs a { color: inherit; }

/* Home hero: address on the left, what it reveals on the right. */
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 2.5rem 3.5rem; align-items: center; }
.hero-label { font-size: 1.0625rem; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.addr { display: block; margin-top: 0.75rem; font: 700 clamp(2rem, 0.9rem + 5.4vw, 4.75rem)/1 var(--mono); letter-spacing: -0.045em; overflow-wrap: anywhere; }
.addr.v6 { font-size: clamp(1.25rem, 0.6rem + 2.6vw, 2.25rem); letter-spacing: -0.03em; line-height: 1.15; }
.bits { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 1.5rem; }
.bits span { display: flex; gap: 3px; }
.bits i { width: 8px; height: 22px; border-radius: 2px; background: var(--line); }
.bits i.on { background: var(--accent); }
.bits.v6 { gap: 5px 10px; }
.bits.v6 span { gap: 2px; }
.bits.v6 i { width: 4px; height: 14px; border-radius: 1px; }
.bits-note { font-size: 0.875rem; color: var(--muted); margin-top: 0.625rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 1.75rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); }
.hero .panel { padding: 0.5rem 1.5rem; }
.hero .facts { margin-top: 0; border-top: 0; grid-template-columns: minmax(7rem, 9.5rem) 1fr; }
.hero .facts dt:last-of-type, .hero .facts dd:last-of-type { border-bottom: 0; }
.hero-foot { margin-top: 1.75rem; font-size: 0.875rem; color: var(--muted); max-width: 34rem; }
@media (max-width: 56rem) { .hero { grid-template-columns: 1fr; } }

/* Fact lists (label / value rows) */
.facts { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; margin-top: 1.5rem; border-top: 1px solid var(--line); }
.facts dt, .facts dd { margin: 0; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); padding-right: 1rem; font-size: 0.9375rem; }
.facts dd { font-family: var(--mono); font-size: 0.9375rem; overflow-wrap: anywhere; min-width: 0; }
.facts dd .muted, .facts dd small { font-family: var(--sans); display: block; font-size: 0.8125rem; }
@media (max-width: 34rem) {
  .facts, .hero .facts { grid-template-columns: 1fr; }
  .facts dt { border-bottom: 0; padding-bottom: 0; font-size: 0.8125rem; }
  .facts dd { padding-top: 0.125rem; }
}

/* Buttons and forms */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; cursor: pointer; white-space: nowrap;
  font: 600 1rem/1.2 var(--sans); min-height: 2.875rem; padding: 0.625rem 1.25rem; text-decoration: none;
  border-radius: var(--r-control); border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
  transition: transform 0.12s var(--ease), filter 0.15s;
}
button:hover, .button:hover { filter: brightness(1.08); }
button:active, .button:active { transform: translateY(1px); }
button:disabled { opacity: 0.6; cursor: progress; }
button.quiet, .button.quiet { background: var(--surface); color: var(--ink); border-color: var(--line-strong); font-weight: 500; font-size: 0.9375rem; }
.copy { display: inline-flex; align-items: center; gap: 0.625rem; }
.copy .tip { font-size: 0.875rem; color: var(--muted); transition: opacity 0.15s; }
.copy .tip:empty { opacity: 0; }

.tool-form { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-top: 2rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 0.4rem; flex: 1 1 15rem; min-width: 0; }
.field.narrow { flex: 0 1 13rem; }
.field label { font-weight: 600; font-size: 0.9375rem; }
.field .hint { font-size: 0.8125rem; color: var(--muted); }
input[type="text"], input[type="search"], select, textarea {
  font: 400 1rem/1.3 var(--mono); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--r-control); padding: 0.6875rem 0.875rem; width: 100%; min-height: 2.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
select { cursor: pointer; font-family: var(--sans); }
textarea { min-height: 5.5rem; resize: vertical; }
::placeholder { color: var(--muted); opacity: 1; }

/* Messages */
.note { margin-top: 1.25rem; padding: 1rem 1.125rem; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); background: var(--surface); border-radius: var(--r-control); max-width: var(--measure); }
.note > :first-child { margin-top: 0; }
.note.error { border-left-color: var(--bad); }
.note.warning { border-left-color: var(--warn); }
.note.ok { border-left-color: var(--accent); }
.note strong:first-child { display: block; margin-bottom: 0.125rem; }
.issues { list-style: none; padding: 0; }
.issues li { padding-left: 1.75rem; position: relative; margin-top: 0.5rem; }
.issues li::before { position: absolute; left: 0; top: 0.45em; width: 0.75rem; height: 0.75rem; border-radius: 3px; content: ""; background: var(--line-strong); }
.issues .error::before { background: var(--bad); }
.issues .warning::before { background: var(--warn); transform: rotate(45deg); }
.issues .ok::before { background: var(--accent); border-radius: 50%; }
.tag { display: inline-block; font: 600 0.8125rem/1.6 var(--sans); padding: 0 0.625rem; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; }
.tag.ok { color: var(--accent); } .tag.warn { color: var(--warn); } .tag.bad { color: var(--bad); } .tag.plain { color: var(--muted); }

/* Result tables */
.result { margin-top: 2.5rem; }
.result > h2:first-child { margin-top: 0; }
.result .note { max-width: none; }
.result pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.result > p { max-width: none; }
@media (min-width: 62rem) {
  .result .facts { grid-template-columns: minmax(8rem, 12rem) 1fr minmax(8rem, 12rem) 1fr; column-gap: 0; }
  .result .facts dd { padding-right: 2rem; }
}
.table-wrap { overflow-x: auto; margin-top: 1.25rem; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); container-type: inline-size; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
caption { text-align: left; padding: 0.875rem 1.125rem; font-weight: 600; border-bottom: 1px solid var(--line); }
caption .muted { font-weight: 400; margin-left: 0.5rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6875rem 1.125rem; }
tbody tr + tr > * { border-top: 1px solid var(--line); }
thead th { font-size: 0.8125rem; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--sunken); border-bottom: 1px solid var(--line); }
td.data, td.mono, th.mono { font-family: var(--mono); font-size: 0.875rem; overflow-wrap: anywhere; }
td.num { font-family: var(--mono); font-size: 0.875rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody th { font-weight: 600; }
/* Record tables stacked on one page share column widths so values line up. */
table.records { table-layout: fixed; }
table.records th:nth-child(1) { width: 32%; } table.records th:nth-child(2) { width: 9%; } table.records th:nth-child(3) { width: 11%; }
table.servers { table-layout: fixed; }
table.servers th:nth-child(1) { width: 24%; } table.servers th:nth-child(2) { width: 28%; } table.servers th:nth-child(3) { width: 17%; } table.servers th:nth-child(5) { width: 9%; }
tbody tr:hover > * { background: color-mix(in srgb, var(--sunken) 60%, transparent); }
/* Narrow containers: each row becomes a labelled block, headers come from data-label. */
@container (width < 40rem) {
  table.stack, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; }
  table.stack thead { display: none; }
  table.records th:nth-child(n), table.servers th:nth-child(n) { width: auto; }
  table.stack tr { padding: 0.625rem 0; }
  table.stack tbody tr + tr { border-top: 1px solid var(--line); }
  table.stack th, table.stack td, table.stack tbody tr + tr > * { border: 0; padding: 0.125rem 1.125rem; }
  table.stack td[data-label]::before { content: attr(data-label) ": "; font: 600 0.8125rem var(--sans); color: var(--muted); }
}

/* Tool directory: tiles sized by importance, grouped under plain headings. */
.finder { margin-top: 1.25rem; max-width: 30rem; position: relative; }
.finder label { font-weight: 600; display: block; margin-bottom: 0.4rem; }
.finder .icon { position: absolute; left: 0.875rem; bottom: 0.8125rem; color: var(--muted); pointer-events: none; }
.finder input { padding-left: 2.75rem; }
.finder-status { min-height: 1.5rem; font-size: 0.875rem; color: var(--muted); margin-top: 0.5rem; }
.group { margin-top: 2rem; }
.group h3 { margin-top: 0; font-size: 0.9375rem; font-weight: 600; color: var(--muted); }
.tiles { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: 0.875rem; }
.tiles li { max-width: none; display: flex; }
.tile { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.875rem; align-content: start; padding: 1.125rem 1.25rem; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); transition: border-color 0.15s, transform 0.2s var(--ease), box-shadow 0.2s; }
.tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.tile:active { transform: translateY(0); }
.tile .icon { grid-row: span 2; width: 2.5rem; height: 2.5rem; padding: 0.5625rem; border-radius: var(--r-control); background: var(--accent-soft); color: var(--accent); }
.tile strong { font-weight: 600; align-self: end; }
.tile span { grid-column: 2; font-size: 0.9375rem; color: var(--muted); line-height: 1.45; }
.wide .tile { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 55%); }

.prose { margin-top: 3.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose { padding-top: 3rem; border-top: 1px solid var(--line); }
.prose h2 { font-size: 1.3125rem; margin-top: 2.75rem; }
@media (min-width: 62rem) {
  .prose { columns: 2; column-gap: 4rem; }
  .prose h2, .prose h3 { break-after: avoid; }
  .prose p, .prose li, .prose pre, .prose .table-wrap { break-inside: avoid; }
  .prose p, .prose li { max-width: none; }
}
.related { margin-top: 3.5rem; padding: 1.25rem 1.5rem; background: var(--sunken); border-radius: var(--r-panel); }
.related h2 { font-size: 0.9375rem; margin: 0; color: var(--muted); font-weight: 600; }
.related ul { list-style: none; padding: 0; margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.related a { display: inline-block; padding-block: 0.375rem; font-weight: 500; }

.site-foot { border-top: 1px solid var(--line); padding-block: 2.5rem 3rem; font-size: 0.9375rem; color: var(--muted); background: var(--sunken); }
.site-foot .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 1.75rem 2rem; }
.site-foot h2 { font-size: 0.9375rem; margin: 0; color: var(--ink); }
.site-foot ul { list-style: none; padding: 0; margin-top: 0.625rem; }
.site-foot li { margin-top: 0; }
.site-foot a { color: inherit; text-decoration: none; display: inline-block; padding-block: 0.3125rem; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }
.site-foot .legal { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); max-width: none; }
.site-foot .legal a { text-decoration: underline; padding: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } .tile:hover { transform: none; } }
@media (prefers-reduced-transparency: reduce) { .site-head { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media print { .site-head, .site-foot, .tool-form, .related, .skip, .finder { display: none; } body { background: #fff; color: #000; } }
