/* ==========================================================================
   TSRC — Aerospace Modernism UI (Phase 1 / Static)
   File: /public/assets/css/tsrc.v1.css
   Notes:
   - Dark mode by default (institutional / mission-control aesthetic)
   - Relative URLs only
   ========================================================================== */

/* --------------------------------------------------------------------------
   0) Design tokens (required palette)
-------------------------------------------------------------------------- */
:root{
  /* Deep Space (structure) */
  --c-void: #0b3d91;        /* Deep Void */
  --c-midnight: #111111;    /* Midnight Layer */
  --c-space: #212121;       /* Space Grey */

  /* Mission accents */
  --c-orange: #fc3d21;      /* Launch Orange */
  --c-yellow: #f1ff00;      /* Solar Yellow */
  --c-cyan: #00edff;        /* Atmospheric Cyan */

  /* Text */
  --c-white: #ffffff;       /* Star White */
  --c-silver: #cccccc;      /* Nebula Silver */

  /* UI */
  --radius-8: 8px;
  --radius-12: 12px;
  --radius-16: 16px;

  --shadow-soft: 0 18px 60px rgba(0,0,0,.35);
  --shadow-hover: 0 0 0 1px rgba(0,237,255,.18), 0 18px 70px rgba(0,0,0,.40);

  --border-soft: 1px solid rgba(255,255,255,.10);
  --border-softer: 1px solid rgba(255,255,255,.08);

  --glass-bg: rgba(17,17,17,.42);
  --glass-bg-strong: rgba(17,17,17,.55);
  --glass-blur: blur(10px);

  --max-w: 1100px;
  --max-w-narrow: 920px;
}

/* --------------------------------------------------------------------------
   1) Base / Reset
-------------------------------------------------------------------------- */
*{ box-sizing: border-box; }
html{ color-scheme: dark; }
body{
  margin: 0;
  min-height: 100vh;
  background: var(--c-midnight);
  color: var(--c-white);
  font: 14px/1.55 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  text-rendering: geometricPrecision;
}
img{ max-width: 100%; height: auto; }
a{ color: inherit; }
code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
}
::selection{ background: rgba(0,237,255,.22); }

:focus-visible{
  outline: 2px solid rgba(0,237,255,.55);
  outline-offset: 2px;
  border-radius: 8px;
}

/* --------------------------------------------------------------------------
   2) Lightweight starfield + nebula (no heavy assets)
   - Apply via body.page-home / body.page-registry
-------------------------------------------------------------------------- */
body.page-home,
body.page-registry{
  position: relative;
  overflow-x: hidden;
}

/* Background layer */
body.page-home::before,
body.page-registry::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 800px at 18% 10%, rgba(11,61,145,.55), transparent 65%),
    radial-gradient(900px 900px at 82% 22%, rgba(0,237,255,.14), transparent 60%),
    radial-gradient(1100px 900px at 50% 105%, rgba(252,61,33,.10), transparent 55%),
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,.55), transparent 2px),
    radial-gradient(1px 1px at 30% 70%, rgba(255,255,255,.40), transparent 2px),
    radial-gradient(1px 1px at 70% 30%, rgba(255,255,255,.35), transparent 2px),
    radial-gradient(1px 1px at 90% 60%, rgba(255,255,255,.30), transparent 2px),
    linear-gradient(180deg, #0b0f14 0%, #0b0f14 35%, #070a0f 100%);
  filter: saturate(1.05) contrast(1.02);
}

/* Soft vignette */
body.page-home::after,
body.page-registry::after{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 50% 30%, rgba(0,0,0,.25), transparent 65%),
    radial-gradient(1200px 900px at 50% 110%, rgba(0,0,0,.55), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.65));
}

/* --------------------------------------------------------------------------
   3) Layout helpers
-------------------------------------------------------------------------- */
.container{
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 18px;
}
.container-narrow{
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  padding: 0 18px;
}
.stack > * + *{ margin-top: 14px; }
.kicker{
  color: rgba(255,255,255,.70);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 12px;
}
.h1{
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-size: clamp(10px, 4.2vw, 15px);
}
.h2{
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-size: 20px;
}
.lead{
  margin: 0;
  color: var(--c-silver);
  max-width: 80ch;
}
.muted{
  color: rgba(255,255,255,.62);
}

.muted2{
  color: rgba(200,200,200,.62);
   font-size: 10px;
}

/* --------------------------------------------------------------------------
   4) Glass surfaces + cards + hover glow
-------------------------------------------------------------------------- */
.glass{
  background: var(--glass-bg);
  border: var(--border-soft);
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.card{
  border-radius: var(--radius-16);
  border: var(--border-soft);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.card-hd{
  padding: 16px 18px;
  border-bottom: var(--border-softer);
}
.card-bd{
  padding: 16px 18px 18px;
}

/* Hover glow — also usable on touch via focus-within/active */
.hover-glow{
  transition: box-shadow .22s ease, border-color .22s ease, transform .22s ease;
}
.hover-glow:hover,
.hover-glow:focus-within,
.hover-glow:active{
  border-color: rgba(0,237,255,.26);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   5) Buttons, inputs, links
-------------------------------------------------------------------------- */
.btn{
  appearance: none;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(17,17,17,.35);
  color: var(--c-white);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover{
  border-color: rgba(0,237,255,.28);
  box-shadow: 0 0 0 1px rgba(0,237,255,.14);
  transform: translateY(-1px);
}
.btn:active{ transform: translateY(0); }

.btn-primary{
  background: var(--c-orange);
  border-color: rgba(252,61,33,.65);
  color: #0b0f14;
}
.btn-primary:hover{
  box-shadow: 0 0 0 1px rgba(252,61,33,.25), 0 18px 70px rgba(0,0,0,.35);
  border-color: rgba(252,61,33,.9);
}

.btn-secondary{
  background: rgba(17,17,17,.35);
  border-color: rgba(0,237,255,.36);
  color: var(--c-white);
}
.btn-secondary:hover{
  box-shadow: 0 0 0 1px rgba(0,237,255,.18), 0 18px 70px rgba(0,0,0,.35);
}

.input{
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.28);
  color: var(--c-white);
  outline: none;
}
.input::placeholder{ color: rgba(255,255,255,.45); }
.input:focus{
  border-color: rgba(0,237,255,.40);
  box-shadow: 0 0 0 1px rgba(0,237,255,.18);
}

/* Cyan links */
a.link,
body.page-home a,
body.page-registry a{
  color: var(--c-cyan);
  text-decoration: none;
}
body.page-home a:hover,
body.page-registry a:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Badge / pill */
.badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(17,17,17,.35);
  color: var(--c-silver);
}

/* --------------------------------------------------------------------------
   6) Site header (global sticky nav)
-------------------------------------------------------------------------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(17,17,17,.30);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.site-header .bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}
.site-header .brand{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.site-header .brand img{
  height: 22px;
  width: auto;
  opacity: .95;
}
.site-header .brand .title{
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.site-header .brand strong{
  font-size: 13px;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header .brand span{
  color: rgba(255,255,255,.62);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header nav{
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.site-header nav a{
  color: rgba(255,255,255,.80);
  font-weight: 600;
}
.site-header nav a:hover{ color: var(--c-white); }

/* Home uses its own topbar inside the hero panel */
body.page-home .site-header{ display:none; }

/* --------------------------------------------------------------------------
   7) HOME / Resolver page styles (public/index.html)
-------------------------------------------------------------------------- */
.home-stage{
  padding: 34px 0 60px;
}

.hero-shell{
  padding: 22px;
}

.home-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(17,17,17,.28);
}

.home-brand{
  display:flex;
  align-items:center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

/* Wordmark / logo used in your current HTML */
.home-brand-img{
  height: 180px;
  width: auto;
  opacity: .96;
  display:block;
}

/* (Optional) if you later rename to .home-mark, keep both) */
.home-mark{
  height: 30px;
  width: auto;
  opacity: .96;
  display:block;
}

/* Brand text */
.home-brand-text{
  display:flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.home-brand-text strong{
  font-size: 25px;            /* antes 14 */
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-brand-text span{
  color: rgba(255,255,255,.60);
  font-size: 11px;            /* antes 12 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-nav{
  display:flex;
  gap: 16px;
  flex-wrap: wrap;
}
.home-nav a{
  color: rgba(255,255,255,.78);
  font-weight: 600;
  text-decoration:none;
}
.home-nav a:hover{ color: var(--c-white); }

.btn-row{
  display:flex;
  gap: 12px;
  align-items: center;
}
.btn-row .input{ flex: 1 1 auto; min-width: 220px; }
.btn-row .btn{ flex: 0 0 auto; }

.qr-box code{
  color: var(--c-yellow);
}

@media (max-width: 720px){
  .home-topbar{
    flex-direction: column;
    align-items: stretch;
  }
  .home-nav{ justify-content: space-between; }
  .btn-row{ flex-direction: column; align-items: stretch; }
  .home-mark{ height: 22px; }
}

/* Home lookup layout (matches your HTML: .input-group) */
body.page-home .input-group{
  display: flex;
  gap: 12px;              /* espacio entre input y botón */
  align-items: center;
}

body.page-home .input-group .input{
  flex: 1 1 auto;
  min-width: 220px;
}

body.page-home .input-group .btn{
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Mobile: stack nicely */
@media (max-width: 720px){
  body.page-home .input-group{
    flex-direction: column;
    align-items: stretch;
  }
  body.page-home .input-group .btn{
    align-self: flex-start;
  }
}

/* --------------------------------------------------------------------------
   8) REGISTRY page (/__app/registry.html rendered to /registry/<ID>)
-------------------------------------------------------------------------- */
body.page-registry main,
body.page-registry header,
body.page-registry footer{
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 18px;
}

body.page-registry header{ padding-top: 34px; }

body.page-registry .brand{
  color: rgba(255,255,255,.70);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 12px;
}

body.page-registry .lede{
  margin: 0;
  max-width: 78ch;
  color: var(--c-silver);
}

/* Header row: logo left of title */
body.page-registry .registry-head{
  display:flex;
  align-items:center;
  gap: 18px;
  margin-bottom: 18px;
}
body.page-registry .registry-logo{
  height: 180px;
  width: auto;
  opacity: .95;
  display:block;
}
body.page-registry .registry-head-text{ min-width: 0; }
body.page-registry .registry-head-meta{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

@media (max-width: 720px){
  /* Keep the same visual alignment as desktop */
  body.page-registry .registry-head{
    align-items: center;   /* was flex-start */
  }

  /* Avoid amplifying the SVG's internal top padding */
  body.page-registry .registry-logo{
    height: 180px;         /* was 200px */
  }
}

/* KV table */
body.page-registry .kv{
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
}
body.page-registry .kv__row{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
body.page-registry .kv__row:first-child{ border-top: none; }
body.page-registry .kv__k{
  color: rgba(255,255,255,.68);
  letter-spacing: .10em;
  text-transform: uppercase;
  font-size: 11px;
}
body.page-registry .kv__v{
  color: var(--c-white);
  min-width: 0;
}
body.page-registry .kv__v code{
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.10);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--c-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100%;
}

@media (max-width: 820px){
  body.page-registry .kv__row{
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Registry actions + map */
body.page-registry .actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
body.page-registry .map-block{
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
body.page-registry .map-frame{
  width: 100%;
  height: 420px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  overflow: hidden;
  background: #000;
}

/* --- Map header / controls (registry) --- */
body.page-registry .map-head{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

body.page-registry .map-meta{
  color: rgba(255,255,255,.70);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 12px;
}

body.page-registry .map-sub{
  color: var(--c-silver);
  font-size: 13px;
  margin-top: 2px;
  max-width: 78ch;
}

/* Button used for "Show map" */
body.page-registry .map-btn{
  appearance: none;
  border: 1px solid rgba(0,237,255,.36);
  background: rgba(17,17,17,.35);
  color: var(--c-white);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
body.page-registry .map-btn:hover{
  border-color: rgba(0,237,255,.55);
  box-shadow: 0 0 0 1px rgba(0,237,255,.18);
  transform: translateY(-1px);
}
body.page-registry .map-btn:active{ transform: translateY(0); }

/* FIX: "View large sky map" had inline white background; force readable theme */
body.page-registry #btnOpenMapLarge{
  appearance: none !important;
  font: inherit !important;
  font-weight: 600 !important;

  padding: 10px 14px !important;
  border-radius: 999px !important;

  border: 1px solid rgba(0,237,255,.36) !important;
  background: rgba(17,17,17,.35) !important;
  color: var(--c-white) !important;

  cursor: pointer !important;
  transition: transform .15s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
body.page-registry #btnOpenMapLarge:hover{
  border-color: rgba(0,237,255,.55) !important;
  box-shadow: 0 0 0 1px rgba(0,237,255,.18) !important;
  transform: translateY(-1px);
}
body.page-registry #btnOpenMapLarge:active{ transform: translateY(0); }

/* --------------------------------------------------------------------------
   REGISTRY — Emphasis: Inscribed name
-------------------------------------------------------------------------- */

.value--inscribed{
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;

  background: rgba(80, 190, 255, 0.10);
  border: 1px solid rgba(80, 190, 255, 0.28);

  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.1;
  font-size: clamp(18px, 2.1vw, 26px);
  color: rgba(235, 250, 255, 0.98);

  box-shadow:
    0 0 0 1px rgba(0,0,0,.35) inset,
    0 10px 24px rgba(0,0,0,.25);
}

/* --------------------------------------------------------------------------
   9) Print (registry prints cleanly)
-------------------------------------------------------------------------- */
@media print{
  body{
    background:#fff !important;
    color:#000 !important;
  }
  body::before, body::after{ display:none !important; }

  .site-header,
  .home-topbar,
  .actions,
  .map-block,
  footer{ display:none !important; }

  .card, .glass, .kv{
    background:#fff !important;
    border: 1px solid #ccc !important;
    box-shadow:none !important;
  }
  .kv__k{ color:#333 !important; }
  .kv__v{ color:#000 !important; }
  .kv__v code{
    color:#000 !important;
    background:#f2f2f2 !important;
    border-color:#ddd !important;
  }
}
