/* IP Intel landing page. Apache-2.0. https://github.com/sakshaminabox/ip-intel */

:root {
  --paper: #eef2f4;
  --panel: #f8fafb;
  --ink: #0f2a3d;
  --muted: #4a6070;
  --rule: #c9d4da;
  --teal: #1b7d76;
  --flag: #c85e12;
  --code-bg: #e2e9ed;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c1f2c;
    --panel: #112a3b;
    --ink: #e6eef2;
    --muted: #9fb3c0;
    --rule: #24425a;
    --teal: #4cc3b9;
    --flag: #ff9a4d;
    --code-bg: #163448;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
}
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.prose { max-width: 680px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; }
.brand img { width: 32px; height: 32px; }
.top nav a { color: var(--ink); margin-left: 20px; text-decoration: none; }
.top nav a:hover { text-decoration: underline; }

/* Hero */
.hero { padding: 48px 0 32px; }
h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 20px;
  max-width: 17ch;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; margin: 0 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; padding: 11px 18px; border-radius: 8px; font-weight: 600;
  text-decoration: none; border: 2px solid var(--ink);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-secondary { color: var(--ink); }
.btn:hover { text-decoration: none; opacity: 0.88; }

/* Specimen: an IP address taken apart */
.specimen { margin: 56px 0 24px; }
.specimen-ip {
  font-family: var(--mono);
  font-size: clamp(2.4rem, 9vw, 5.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}
.facts { list-style: none; margin: 8px 0 0 0.45em; padding: 0; border-left: 2px solid var(--ink); }
.fact {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 24px;
  align-items: baseline;
  padding: 12px 0 12px 40px;
  max-width: 760px;
}
.fact::before {
  content: "";
  position: absolute; left: 0; top: 1.45em;
  width: 28px; height: 2px; background: var(--ink);
  transform-origin: left;
}
.fact-value { font-size: 1.1rem; font-weight: 600; overflow-wrap: anywhere; }
.fact-value .note { font-weight: 400; color: var(--muted); }
.fact-source { font-family: var(--mono); font-size: 0.85rem; color: var(--teal); text-align: right; }
.fact.flag .fact-value { color: var(--flag); }
.fact.flag::before { background: var(--flag); height: 3px; }
.fact.seen { margin-top: 8px; }
.fact.seen .fact-value { font-weight: 400; color: var(--muted); font-size: 1rem; }
.fact.seen .fact-value strong { color: var(--ink); font-weight: 600; }
.specimen-caption { color: var(--muted); font-size: 0.95rem; margin: 16px 0 0; max-width: 60ch; }

@media (prefers-reduced-motion: no-preference) {
  .fact::before { animation: branch 420ms cubic-bezier(.2,.7,.2,1) both; }
  .fact > * { animation: reveal 420ms ease-out both; }
  .fact:nth-child(1)::before, .fact:nth-child(1) > * { animation-delay: 150ms; }
  .fact:nth-child(2)::before, .fact:nth-child(2) > * { animation-delay: 260ms; }
  .fact:nth-child(3)::before, .fact:nth-child(3) > * { animation-delay: 370ms; }
  .fact:nth-child(4)::before, .fact:nth-child(4) > * { animation-delay: 480ms; }
  .fact:nth-child(5)::before, .fact:nth-child(5) > * { animation-delay: 590ms; }
  .fact:nth-child(6)::before, .fact:nth-child(6) > * { animation-delay: 700ms; }
  @keyframes branch { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
}

/* Sections */
section { padding: 56px 0 8px; }
h2 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 16px; }
h3 { font-size: 1.1rem; margin: 28px 0 8px; }
p { margin: 0 0 16px; }
ul.plain { margin: 0 0 16px; padding-left: 1.2em; }
ul.plain li { margin-bottom: 6px; }

/* Code blocks with copy buttons */
.code {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin: 12px 0 16px;
}
.code pre { margin: 0; padding: 16px 96px 16px 18px; overflow-x: auto; line-height: 1.7; }
.copy {
  position: absolute; top: 10px; right: 10px;
  font: 600 0.85rem var(--sans);
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 6px;
  padding: 5px 10px; cursor: pointer;
}
.copy:hover { border-color: var(--ink); }

.install-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; }
.install-grid > div { min-width: 0; }
details { margin: 8px 0 16px; }
summary { cursor: pointer; color: var(--teal); font-weight: 600; }
details[open] summary { margin-bottom: 8px; }

.prompts { list-style: none; padding: 0; margin: 0 0 16px; }
.prompts li {
  font-family: var(--mono); font-size: 0.92rem;
  padding: 10px 0; border-bottom: 1px solid var(--rule);
  overflow-wrap: anywhere;
}
.prompts li span { font-family: var(--sans); color: var(--muted); font-size: 0.9rem; margin-left: 8px; }

.sources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin: 8px 0 16px; }
.sources h3 { margin-top: 0; }
.sources p { color: var(--muted); font-size: 0.95rem; }
.sources ul { list-style: none; padding: 0; margin: 0; }
.sources li { padding: 4px 0; }

footer { margin-top: 72px; padding: 32px 0 48px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.92rem; }
footer p { max-width: 75ch; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: 24px; }
  .top nav a { margin-left: 14px; }
  .install-grid, .sources { grid-template-columns: 1fr; gap: 8px; }
  .fact { grid-template-columns: 1fr; padding-left: 32px; }
  .fact::before { width: 22px; }
  .fact-source { text-align: left; }
  .code pre { padding-right: 18px; padding-top: 48px; }
}