/* Fonts are self-hosted so visitors never contact a third party. */
@font-face {
  font-family: "Martian Mono";
  src: url("fonts/martian-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Martian Mono";
  src: url("fonts/martian-mono-latin-ext.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { font-family: "Chakra Petch"; font-weight: 400; font-display: swap; src: url("fonts/chakra-petch-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Chakra Petch"; font-weight: 400; font-display: swap; src: url("fonts/chakra-petch-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url("fonts/chakra-petch-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url("fonts/chakra-petch-600-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url("fonts/chakra-petch-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url("fonts/chakra-petch-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Night City palette. Cyan always means network bits, red host bits;
   yellow is for things you act on and the address itself. */
:root {
  --void: #08090f;
  --panel: #10121c;
  --line: #262b40;
  --text: #e9edf5;
  --dim: #8f98b3;
  --yellow: #fcee0a;
  --cyan: #02d7f2;
  --red: #ff003c;
  --red-text: #ff5c7a;

  --mono: "Martian Mono", ui-monospace, Menlo, Consolas, monospace;
  --hud: "Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --cut: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--void);
  /* Faint CRT scanlines. */
  background-image: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .022) 0 1px, transparent 1px 3px);
  color: var(--text);
  font: 400 17px/1.55 var(--hud);
}

::selection { background: var(--yellow); color: var(--void); }

a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: var(--yellow); }

:is(a, button, input, summary):focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

code, .data { font-family: var(--mono); font-size: .84em; font-stretch: 87.5%; }
.wrap { overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
.none { color: var(--dim); }
sup { font-size: .68em; line-height: 0; }

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Top bar */
.top {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.top::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 96px;
  height: 3px;
  background: var(--yellow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--yellow);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
}
.brand::before {
  content: "";
  width: 22px;
  height: 14px;
  background: linear-gradient(to right,
    var(--cyan) 0 5px, transparent 5px 6px,
    var(--cyan) 6px 11px, transparent 11px 12px,
    var(--cyan) 12px 17px, transparent 17px 18px,
    var(--yellow) 18px 22px);
}
/* A domain keeps its own case; the TLD gets the accent colour. */
.brand-domain { text-transform: none; letter-spacing: .02em; }
.brand .tld { color: var(--cyan); }

.search { display: flex; flex: 1 1 340px; max-width: 500px; gap: 8px; }
.search input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: var(--yellow); outline: none; }
.search button {
  height: 46px;
  padding: 0 22px;
  border: 0;
  background: var(--yellow);
  color: var(--void);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.search button:hover { background: var(--cyan); }

.error {
  margin: 20px 0 0;
  padding: 12px 16px;
  border-left: 3px solid var(--red);
  background: rgba(255, 0, 60, .12);
  color: var(--text);
}

/* Hero */
.hero { padding: 54px 0 44px; }

.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.lead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--cyan);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.lead::before { content: ""; width: 8px; height: 8px; background: var(--yellow); }

.view {
  display: inline-flex;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.view > * { padding: 5px 14px; text-decoration: none; }
.view .active { background: var(--yellow); color: var(--void); }
.view a { color: var(--dim); }
.view a:hover { color: var(--yellow); }

.ip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin-top: 14px;
}

.ip {
  position: relative;
  margin: 0;
  color: var(--yellow);
  font-family: var(--mono);
  /* Scales with the viewport so even 255.255.255.255 fits on one line
     at 320px instead of wrapping its last digit. */
  font-size: clamp(24px, 8.6vw, 76px);
  font-weight: 800;
  font-stretch: 100%;
  letter-spacing: -.02em;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-shadow: 0 0 22px rgba(252, 238, 10, .28);
}
.ip.ip6 { font-size: clamp(22px, 4.4vw, 46px); font-stretch: 87.5%; letter-spacing: -.01em; overflow-wrap: normal; }

/* Chromatic split copies used by the load glitch. */
.ip::before, .ip::after {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  text-shadow: none;
}
.ip::before { color: var(--red); }
.ip::after { color: var(--cyan); }

.copy {
  padding: 8px 16px;
  border: 1px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.copy:hover { background: var(--cyan); color: var(--void); }

.where { margin: 24px 0 0; font-size: 20px; }
.where.org { margin-top: 12px; color: var(--dim); }
.flag { margin-right: 10px; }

/* Bit ruler: one cell per bit of the address. */
.ruler {
  margin: 30px 0 0;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  /* Opaque so the full-screen glitch's ghosts stay hidden behind it. */
  background: var(--panel);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.bits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.grp { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.val { color: var(--dim); font-family: var(--mono); font-size: 13px; }

.cells {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 3px;
}
.cells i {
  display: grid;
  place-items: center;
  height: 40px;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--dim);
  font: 400 13px/1 var(--mono);
  font-style: normal;
  clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 0 100%);
}
.cells i.on { color: var(--text); font-weight: 700; }

.known .cells i.n { background: rgba(2, 215, 242, .12); box-shadow: inset 0 0 0 1px rgba(2, 215, 242, .55); color: rgba(2, 215, 242, .75); }
.known .cells i.n.on { background: var(--cyan); box-shadow: none; color: var(--void); }
.known .cells i.h { background: rgba(255, 0, 60, .1); box-shadow: inset 0 0 0 1px rgba(255, 0, 60, .5); color: rgba(255, 92, 122, .8); }
.known .cells i.h.on { background: var(--red); box-shadow: none; color: #fff; }

/* 128 bits are too many to label; their value is shown by fill. */
.v6 .bits { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.v6 .cells { grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 2px; }
.v6 .cells i { height: 26px; font-size: 0; box-shadow: none; background: var(--line); clip-path: none; }
.v6 .cells i.on { background: var(--dim); }
.v6.known .cells i.n { background: rgba(2, 215, 242, .3); box-shadow: none; }
.v6.known .cells i.n.on { background: var(--cyan); }
.v6.known .cells i.h { background: rgba(255, 0, 60, .26); box-shadow: none; }
.v6.known .cells i.h.on { background: var(--red); }

figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  margin-top: 16px;
  color: var(--dim);
  font-size: 15px;
}
.key b { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.key.net b { color: var(--cyan); }
.key.host b { color: var(--red-text); }
.key.net::before, .key.host::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  vertical-align: -1px;
}
.key.net::before { background: var(--cyan); }
.key.host::before { background: var(--red); }

/* Glitches are triggered by app.js: a long one on load, then a short one
   every few seconds. The bits flicker on once by themselves. */
@media (prefers-reduced-motion: no-preference) {
  .glitch-long .ip::before { animation: glitch-a .9s steps(1, end) 1; }
  .glitch-long .ip::after { animation: glitch-b .9s steps(1, end) 1; }
  /* --glitch-dur is set by app.js from GLITCH_DURATION / GLITCH_FULL_DURATION. */
  .glitch .ip::before { animation: glitch-a var(--glitch-dur, .4s) steps(1, end) 1; }
  .glitch .ip::after { animation: glitch-b var(--glitch-dur, .4s) steps(1, end) 1; }
  .glitch .page { animation: jitter var(--glitch-dur, .4s) steps(1, end) 1; }
  .glitch-full .page { filter: url(#tear); }
  .glitch body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    top: var(--glitch-y, 40vh);
    height: var(--glitch-h, 8vh);
    z-index: 10;
    pointer-events: none;
    background:
      repeating-linear-gradient(to bottom, rgba(8, 9, 15, .5) 0 2px, transparent 2px 4px),
      linear-gradient(90deg, rgba(2, 215, 242, .2), rgba(255, 0, 60, .24) 55%, rgba(252, 238, 10, .14));
    mix-blend-mode: screen;
    animation: band var(--glitch-dur, .4s) steps(1, end) 1 forwards;
  }

  .cells i { animation: bit-on .5s linear backwards; }
  .grp:nth-child(2) i { animation-delay: .06s; }
  .grp:nth-child(3) i { animation-delay: .12s; }
  .grp:nth-child(4) i { animation-delay: .18s; }
  .grp:nth-child(5) i { animation-delay: .24s; }
  .grp:nth-child(6) i { animation-delay: .30s; }
  .grp:nth-child(7) i { animation-delay: .36s; }
  .grp:nth-child(8) i { animation-delay: .42s; }
}
@keyframes glitch-a {
  0%   { opacity: 1; transform: translate(-4px, 0); clip-path: inset(10% 0 62% 0); }
  20%  { opacity: 1; transform: translate(3px, 0); clip-path: inset(55% 0 20% 0); }
  40%  { opacity: 1; transform: translate(-2px, 0); clip-path: inset(30% 0 45% 0); }
  60%  { opacity: 1; transform: translate(5px, 0); clip-path: inset(75% 0 5% 0); }
  80%, 100% { opacity: 0; transform: none; clip-path: inset(0); }
}
@keyframes glitch-b {
  0%   { opacity: 1; transform: translate(4px, 0); clip-path: inset(60% 0 15% 0); }
  20%  { opacity: 1; transform: translate(-3px, 0); clip-path: inset(5% 0 70% 0); }
  40%  { opacity: 1; transform: translate(2px, 0); clip-path: inset(40% 0 35% 0); }
  60%  { opacity: 1; transform: translate(-5px, 0); clip-path: inset(20% 0 60% 0); }
  80%, 100% { opacity: 0; transform: none; clip-path: inset(0); }
}
@keyframes jitter {
  0%   { transform: translate(-3px, 1px); }
  25%  { transform: translate(4px, -1px); }
  50%  { transform: translate(-1px, 0); }
  75%, 100% { transform: none; }
}
@keyframes band {
  0%   { opacity: 1; transform: translateX(-3%); }
  30%  { transform: translateX(4%) scaleY(.4); }
  60%  { opacity: .8; transform: translateX(-1%) scaleY(1.7); }
  100% { opacity: 0; transform: none; }
}
@keyframes bit-on {
  0%   { opacity: 0; }
  40%  { opacity: 1; }
  55%  { opacity: .35; }
  70%, 100% { opacity: 1; }
}

/* Detail blocks: heading in a side column, facts beside it. */
.block {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  column-gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.block > * { grid-column: 2; }
.block > h2 {
  grid-column: 1;
  grid-row: 1 / span 4;
  margin: 0;
  color: var(--yellow);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.5;
  text-transform: uppercase;
}

dl {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 9px 24px;
  margin: 0;
}
dt { color: var(--dim); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; line-height: 1.75; }
dd { margin: 0; min-width: 0; }
/* Standalone links in a list get a taller tap area. */
dd > a.data { display: inline-block; padding: 4px 0; margin: -4px 0; }

.crumbs { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.crumbs .sep { color: var(--red-text); }
/* Placeholders such as "Checking…" are words, not data. */
.pending { color: var(--dim); font-family: var(--hud); font-size: 1em; font-stretch: normal; }

details { margin-top: 18px; }
summary { color: var(--cyan); cursor: pointer; }
table { width: 100%; border-collapse: collapse; }
.headers { margin-top: 12px; }
.headers th, .headers td {
  padding: 7px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.headers th { padding-right: 20px; color: var(--dim); font-weight: 400; white-space: nowrap; }

.note { margin: 0 0 14px; color: var(--dim); }
.cmds td { padding: 9px 20px 9px 0; border-top: 1px solid var(--line); vertical-align: top; }
.cmds td:first-child code { color: var(--text); }
.cmds td:first-child code::before { content: "> "; color: var(--yellow); }
.cmds td:last-child { padding-right: 0; color: var(--dim); }
.cmds code { overflow-wrap: anywhere; }
/* Keep commands on one line where there is room; phones stack the rows. */
@media (min-width: 561px) { .cmds td:first-child code { white-space: nowrap; } }
.fields { margin: 16px 0 0; font-size: 15px; }

.prefixes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.prefixes a { text-decoration: none; overflow-wrap: anywhere; }
.prefixes a:hover { text-decoration: underline; }
.block .prefixes + .note { margin: 14px 0 0; }
.whois-body .note { margin-bottom: 12px; }
.whois-body .src { margin: 14px 0 0; font-size: 15px; }

/* Footer: a HUD status panel. Three columns of facts, then a status bar. */
.foot {
  position: relative;
  margin-top: 8px;
  padding: 32px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 15px;
}
.foot::before {
  content: "";
  position: absolute;
  left: 0;
  top: -2px;
  width: 96px;
  height: 3px;
  background: var(--yellow);
}
.foot p { margin: 0 0 6px; }

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 40px;
}
.foot-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.foot-h::before { content: ""; width: 6px; height: 6px; background: var(--cyan); }

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.foot-links a { display: inline-block; padding: 3px 0; }

.foot-dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
}
.foot-dl dt { font-size: 12px; line-height: 1.9; }

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 24px;
  margin-top: 28px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 14px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.foot-bar .build { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
/* A status light: steady, never blinking. */
.foot-bar .build::before { content: ""; width: 8px; height: 8px; background: var(--cyan); box-shadow: 0 0 8px rgba(2, 215, 242, .6); }
.foot-bar .linklike { margin-left: auto; }
.foot-bar a { display: inline-block; padding: 4px 0; }
.nowrap { white-space: nowrap; }

/* Privacy page */
.prose .title {
  margin: 12px 0 0;
  color: var(--text);
  font-size: clamp(28px, 4.6vw, 44px);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.15;
  text-transform: uppercase;
}
.prose .block p { max-width: 68ch; margin: 0 0 12px; }
.prose .block p:last-child { margin-bottom: 0; }
.prose b { color: var(--text); font-weight: 600; }
.fx { position: absolute; width: 0; height: 0; overflow: hidden; }
.linklike {
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--cyan);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linklike:hover { color: var(--yellow); }

@media (max-width: 760px) {
  .foot-cols { grid-template-columns: minmax(0, 1fr); }
  .foot-bar .linklike { margin-left: 0; }
  .block { grid-template-columns: minmax(0, 1fr); }
  .block > *, .block > h2 { grid-column: 1; grid-row: auto; }
  .block > h2 { margin-bottom: 12px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .page { padding: 0 16px; }
  .hero { padding: 36px 0 32px; }
  .ruler { padding: 14px 12px 12px; }
  .bits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .v6 .bits { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .cells i { height: 34px; font-size: 12px; }
  .v6 .cells i { height: 20px; font-size: 0; }
  dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dd { margin-bottom: 10px; }
  .cmds, .cmds tbody, .cmds tr, .cmds td { display: block; }
  .cmds tr { padding: 8px 0; border-top: 1px solid var(--line); }
  .cmds td { padding: 0; border: 0; }
}
