/* HadrianQuest — dark editorial / retro-futurist */

:root {
  --bg: #08090b;
  --bg-2: #0c0e11;
  --panel: #101318;
  --panel-2: #14181e;
  --line: #1e232b;
  --line-soft: #171b21;
  --silver: #c9ced6;
  --silver-dim: #8b929c;
  --silver-faint: #5d646e;
  --white: #f2f4f7;
  --blue: #4d84ff;
  --blue-soft: #7aa2ff;
  --blue-deep: #1b3a7a;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--silver);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 78% -8%, rgba(77, 132, 255, 0.13), transparent 62%),
    radial-gradient(760px 460px at 4% 12%, rgba(77, 132, 255, 0.05), transparent 60%),
    radial-gradient(1100px 700px at 50% 108%, rgba(20, 26, 38, 0.9), transparent 70%);
}

.crt {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.35;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.022) 0px,
    rgba(255, 255, 255, 0.022) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: var(--blue);
  color: #04070d;
  padding: 12px 18px;
  font-weight: 600;
}
.skip:focus { left: 12px; top: 12px; }

a { color: var(--blue-soft); text-decoration: none; }
a:hover { color: var(--white); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--white);
}
.brand:hover { color: var(--white); }

.brand-mark {
  color: var(--blue);
  display: inline-flex;
  filter: drop-shadow(0 0 10px rgba(77, 132, 255, 0.45));
}

.brand-text {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.brand-accent { color: var(--blue); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.site-nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--silver-dim);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.site-nav a:hover {
  color: var(--white);
  border-bottom-color: var(--blue);
}

.nav-cta {
  color: var(--white) !important;
  border: 1px solid var(--line) !important;
  border-radius: 2px;
  padding: 9px 16px !important;
  background: var(--panel);
}
.nav-cta:hover {
  border-color: var(--blue) !important;
  background: rgba(77, 132, 255, 0.1);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--silver);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: relative;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 4.5px; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: clamp(72px, 12vw, 132px) 0 clamp(64px, 9vw, 104px);
  border-bottom: 1px solid var(--line-soft);
}

.hero-inner { max-width: 900px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--silver-faint);
  margin: 0 0 26px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(77, 132, 255, 0.55);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(77, 132, 255, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(77, 132, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(77, 132, 255, 0); }
}

h1 {
  margin: 0 0 28px;
  font-size: clamp(2.5rem, 7.2vw, 5.1rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  color: var(--white);
}
.h1-dim {
  color: transparent;
  -webkit-text-stroke: 1px #4a525e;
  text-stroke: 1px #4a525e;
}

.lede {
  font-size: clamp(1rem, 1.6vw, 1.14rem);
  color: var(--silver-dim);
  max-width: 62ch;
  margin: 0 0 38px;
}
.lede strong { color: var(--silver); font-weight: 600; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 56px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--blue);
  color: #04070d;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(77, 132, 255, 0.4), 0 10px 34px -14px rgba(77, 132, 255, 0.85);
}
.btn-primary:hover {
  background: #6b98ff;
  color: #04070d;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line);
  color: var(--silver);
}
.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--white);
  background: rgba(77, 132, 255, 0.08);
}

.btn-tag {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  opacity: 0.62;
  border-left: 1px solid currentColor;
  padding-left: 11px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line-soft);
  padding-top: 26px;
}
.hero-meta > div {
  padding-right: 44px;
  margin-right: 44px;
  border-right: 1px solid var(--line-soft);
}
.hero-meta > div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.hero-meta dt {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--silver-faint);
  margin-bottom: 6px;
}
.hero-meta dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--silver);
}

/* ---------- ticker ---------- */

.ticker {
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-2);
  padding: 13px 0;
}
.ticker-track {
  display: flex;
  gap: 26px;
  width: max-content;
  animation: slide 46s linear infinite;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--silver-faint);
  white-space: nowrap;
}
.ticker-track .sep { color: var(--blue-deep); }
@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- sections ---------- */

.section {
  padding: clamp(64px, 9vw, 110px) 0;
  position: relative;
}
.section-alt {
  background: linear-gradient(180deg, rgba(16, 19, 24, 0.55), rgba(8, 9, 11, 0));
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.section-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 20px;
}

.section-title {
  font-size: clamp(1.65rem, 3.6vw, 2.55rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--white);
  margin: 0 0 18px;
  max-width: 22ch;
}

.section-lede {
  color: var(--silver-dim);
  max-width: 60ch;
  margin: 0 0 44px;
}

/* ---------- cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.card {
  background: var(--bg);
  padding: 32px 28px 30px;
  position: relative;
  transition: background 0.22s ease;
}
.card:hover { background: var(--panel); }

.card::after {
  content: "";
  position: absolute;
  left: 0; top: 0;
  height: 1px; width: 0;
  background: var(--blue);
  transition: width 0.35s ease;
}
.card:hover::after { width: 100%; }

.card-index {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  color: var(--silver-faint);
  margin: 0 0 18px;
}

.card h3 {
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--white);
  margin: 0 0 12px;
}

.card p {
  font-size: 0.92rem;
  color: var(--silver-dim);
  margin: 0 0 20px;
}

.card-link {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-soft);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.card-link span { transition: transform 0.2s ease; }
.card-link:hover span { transform: translateX(4px); }

.card-status {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--silver-faint);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 2px;
  display: inline-block;
}

/* ---------- split / terminal ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.split .cta-row { margin-bottom: 0; }
.split .section-lede { margin-bottom: 32px; }

.terminal {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: linear-gradient(180deg, #0b0d11, #080a0d);
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.015);
}
.t-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2a3038;
}
.t-dot:first-child { background: #3a4250; }
.terminal-title {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--silver-faint);
}

.terminal-body {
  margin: 0;
  padding: 22px 20px 26px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.95;
  color: var(--silver-dim);
  overflow-x: auto;
  white-space: pre;
}
.t-dim { color: var(--silver-faint); }
.t-live { color: var(--blue-soft); font-weight: 600; }
.t-pending { color: #b08a4a; }
.cursor { animation: blink 1.15s step-end infinite; color: var(--blue); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- archive ---------- */

.archive-panel {
  border: 1px solid var(--line-soft);
  background: rgba(16, 19, 24, 0.5);
}

.archive-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.archive-row:last-child { border-bottom: 0; }

.archive-key {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--silver-faint);
  min-width: 96px;
  padding-top: 3px;
}
.archive-val {
  font-size: 0.92rem;
  color: var(--silver);
  flex: 1;
  min-width: 200px;
}

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d0a862;
  border: 1px solid rgba(208, 168, 98, 0.35);
  background: rgba(208, 168, 98, 0.07);
  padding: 4px 11px;
  border-radius: 2px;
}

/* ---------- contact ---------- */

.contact {
  border-top: 1px solid var(--line-soft);
  background:
    radial-gradient(700px 320px at 50% 0%, rgba(77, 132, 255, 0.1), transparent 70%);
}
.contact-inner { text-align: center; }
.contact .section-title { margin-left: auto; margin-right: auto; max-width: none; }
.contact .section-lede { margin-left: auto; margin-right: auto; }

.mail {
  display: inline-block;
  font-family: var(--mono);
  font-size: clamp(1rem, 3.4vw, 1.9rem);
  letter-spacing: -0.01em;
  color: var(--white);
  padding: 14px 4px;
  border-bottom: 1px solid var(--blue-deep);
  transition: border-color 0.2s ease, color 0.2s ease;
  word-break: break-word;
}
.mail:hover {
  color: var(--blue-soft);
  border-bottom-color: var(--blue);
}

.contact-note {
  font-size: 0.8rem;
  color: var(--silver-faint);
  margin: 26px 0 0;
}

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line-soft);
  padding: 52px 0 44px;
  background: var(--bg-2);
}

.foot-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px 40px;
  align-items: start;
}

.foot-brand .brand-text { font-size: 0.86rem; }
.foot-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--silver-faint);
  margin: 10px 0 0;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}
.foot-nav a {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--silver-dim);
}
.foot-nav a:hover { color: var(--white); }

.foot-legal {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.76rem;
  color: var(--silver-faint);
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .foot-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(10, 12, 15, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 20px;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.78rem;
  }
  .site-nav .nav-cta {
    margin-top: 14px;
    text-align: center;
    border-bottom: 1px solid var(--line) !important;
  }

  .hero-meta > div {
    padding-right: 24px;
    margin-right: 24px;
  }
  .hero-meta > div:nth-child(3) {
    border-right: 0;
    margin-right: 0;
    padding-right: 0;
    flex-basis: 100%;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
  }

  .card { padding: 26px 22px; }
  .archive-row { padding: 16px 18px; }
  .btn { width: 100%; justify-content: center; }
  .cta-row { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .ticker-track { animation: none; }
}
