/* IPv5 Registry Search, the Modern view: the HLC portal at night. Its
   night-flight tokens, glass, cards, info tiles, tables and pills
   (src/app/globals.css and the portal's shared components in the HLC web
   app), over its aurora sky (atmosphere.js). Fonts: Manrope and Fraunces
   (SIL Open Font License), served here. */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/fraunces-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: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/manrope-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: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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;
}

/* The portal's night flight. */
:root {
  --background: #050f1e;
  --background-soft: #0a1c31;
  --surface-border: rgba(150, 205, 235, 0.16);
  --foreground: #eaf6ff;
  --muted: #9dbdd2;
  --accent: #6cc4e4;
  --accent-strong: #a4e0f2;
  --accent-soft: rgba(90, 180, 215, 0.2);
  --success: #7fe3ad;
  --warning: #ffd27a;
  --warning-soft: rgba(230, 170, 60, 0.2);
  --danger: #f2919f;
  --danger-soft: rgba(210, 90, 110, 0.2);
  --glass-2-bg: rgba(19, 31, 46, 0.45);
  --glass-border: rgba(150, 205, 235, 0.18);
  --glass-edge: rgba(0, 0, 0, 0.35);
  --glass-highlight: rgba(170, 215, 240, 0.12);
  --glass-glow: 0 0 28px rgba(86, 166, 214, 0.1);
  --shadow: 0 2px 8px rgba(0, 6, 14, 0.4), 0 16px 40px rgba(0, 6, 14, 0.32);
  --card: rgba(21, 43, 66, 0.92);
  --input: rgba(9, 24, 40, 0.92);
  --btn-bg-from: #1a3d5c;
  --btn-bg-to: #112a43;
  --btn-hover-from: #224c6c;
  --btn-hover-to: #163650;
  --btn-border: rgba(150, 205, 235, 0.2);
  --btn-border-hover: rgba(108, 196, 228, 0.46);
  --btn-shadow: 0 1px 4px rgba(0, 6, 14, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --btn-shadow-hover: 0 2px 9px rgba(0, 6, 14, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --cta-label: #f7fdff;
  --cta-face-top: #459fc0;
  --cta-face-bottom: #247998;
  --selection-bg: rgba(108, 196, 228, 0.34);
  --sky-gradient:
    radial-gradient(ellipse 90% 55% at 72% 10%, rgba(86, 230, 174, 0.1), transparent 62%),
    radial-gradient(ellipse 70% 45% at 20% 30%, rgba(169, 139, 245, 0.08), transparent 60%),
    linear-gradient(180deg, #020814 0%, #051225 38%, #0a2138 68%, #14365a 100%);
  --sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
::selection { background: var(--selection-bg); }
html { background: var(--background); }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--foreground);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  background: var(--sky-gradient) fixed, var(--background);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
code, .mono { font-family: var(--mono); font-size: 12px; color: var(--foreground); }
.line { display: block; }
.muted { color: var(--muted); }
.icon { width: 16px; height: 16px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The living sky, under everything. */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.sky canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 800ms ease; }
.sky canvas[data-live="true"] { opacity: 1; }
.page { position: relative; z-index: 1; }

/* Header, as the portal's own. */
.top { max-width: 64rem; margin: 0 auto; padding: 20px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--foreground); }
.brand:hover { color: var(--foreground); }
.brand img { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--display); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.views { display: inline-flex; gap: 8px; }
.view {
  border-radius: 999px; border: 1px solid var(--surface-border); background: var(--card);
  padding: 6px 12px; font-size: 14px; color: var(--muted); transition: color 140ms ease, border-color 140ms ease;
}
.view:hover { color: var(--foreground); }
.view[aria-current="page"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }

.main { max-width: 64rem; margin: 0 auto; padding: 0 16px 32px; display: flex; flex-direction: column; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack:empty { display: none; }

/* Glass panels: the portal's .hlc-glass-2, rounded-2xl. */
.panel {
  padding: 24px; border-radius: 16px;
  background: var(--glass-2-bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border); outline: 1px solid var(--glass-edge);
  box-shadow: var(--shadow), var(--glass-glow), inset 0 1px 0 var(--glass-highlight);
}
.eyebrow { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.panel-title { margin: 4px 0 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--foreground); overflow-wrap: anywhere; }
.panel-desc { margin: 4px 0 0; max-width: 48rem; font-size: 14px; line-height: 1.6; color: var(--muted); }
.panel-body { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.panel-head > div:first-child { min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Search: the portal's field and primary button. */
.search { margin-top: 16px; display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; border-radius: 12px; border: 1px solid var(--surface-border); background: var(--input);
  padding: 10px 14px; font: 14px var(--sans); color: var(--foreground); outline: none;
}
.search input::placeholder { color: var(--muted); opacity: 0.8; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; cursor: pointer;
  border-radius: 14px; border: 1px solid var(--btn-border);
  background: linear-gradient(to bottom, var(--btn-bg-from), var(--btn-bg-to));
  padding: 8px 18px; font: 500 14px/20px var(--sans); letter-spacing: 0.01em; color: var(--foreground);
  box-shadow: var(--btn-shadow); transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.btn:hover { background: linear-gradient(to bottom, var(--btn-hover-from), var(--btn-hover-to)); border-color: var(--btn-border-hover); box-shadow: var(--btn-shadow-hover); color: var(--foreground); }
.btn:active { transform: translateY(1px); }
.btn-primary { border-color: transparent; color: var(--cta-label); background: linear-gradient(to bottom, var(--cta-face-top), var(--cta-face-bottom)); }
.btn-primary:hover { border-color: transparent; color: var(--cta-label); background: linear-gradient(to bottom, var(--cta-face-top), var(--cta-face-bottom)); filter: brightness(1.06); }
.btn-sm { border-radius: 10px; padding: 5px 12px; font-size: 12px; line-height: 16px; }

.tries { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.try { border-radius: 999px; border: 1px solid var(--surface-border); background: var(--card); padding: 4px 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.try:hover { color: var(--foreground); border-color: var(--accent); }

/* Badge: a status dot and its label. */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; border: 1px solid var(--surface-border); background: var(--card); padding: 2px 10px; font-size: 12px; font-weight: 500; color: var(--foreground); white-space: nowrap; }
.dot { width: 6px; height: 6px; border-radius: 999px; background: var(--muted); flex: none; }
.dot.ok { background: var(--success); }
.dot.info { background: var(--accent); }
.dot.warn { background: var(--warning); }
.dot.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Info tiles: the portal's InfoItem. */
.info { margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.info-item { border-radius: 12px; border: 1px solid var(--surface-border); background: var(--background-soft); padding: 12px; min-width: 0; }
.info-item.wide { grid-column: 1 / -1; }
.info-item dt { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.info-item dd { margin: 4px 0 0; font-size: 14px; color: var(--foreground); overflow-wrap: anywhere; }
.info-item dd.text { white-space: pre-wrap; }

.sub { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* Tables: the portal's RecordTable. */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--surface-border); }
table { width: 100%; min-width: 600px; border-collapse: collapse; text-align: left; font-size: 14px; }
thead { background: var(--background-soft); border-bottom: 1px solid var(--surface-border); }
th { padding: 8px 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
td { padding: 8px 12px; vertical-align: top; color: var(--foreground); border-top: 1px solid var(--surface-border); overflow-wrap: break-word; }
tbody tr:first-child td { border-top: 0; }

.notice { margin: 0; border-radius: 12px; border: 1px solid var(--surface-border); background: var(--card); padding: 12px; font-size: 14px; color: var(--muted); }
.notice.warn { border-color: transparent; background: var(--warning-soft); color: var(--warning); }
.notice.error { border-color: transparent; background: var(--danger-soft); color: var(--danger); }

.foot { max-width: 64rem; margin: 0 auto; padding: 8px 16px 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 12px; color: var(--muted); }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--foreground); }
.noscript { max-width: 640px; margin: 40px auto; padding: 0 16px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .dot.pulse { animation: none; }
  .sky canvas { transition: none; }
}

@media (max-width: 900px) {
  .info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .top { padding: 16px; }
  .brand-name { font-size: 15px; }
  .view { padding: 4px 10px; font-size: 13px; }
  .panel { padding: 20px; }
  .search { flex-direction: column; }
  .info { grid-template-columns: minmax(0, 1fr); }
}
