/* HK3G Software — public site
   Look: night ops console — ink, amber RF, teal ion line (same language as HK3G apps) */

:root {
  --ink: #070d12;
  --ink-2: #0e1620;
  --ink-3: #152232;
  --panel: rgba(14, 22, 32, 0.78);
  --line: rgba(232, 196, 120, 0.16);
  --line-strong: rgba(232, 196, 120, 0.4);
  --text: #e8eef4;
  --muted: #8fa3b5;
  --amber: #e8c478;
  --amber-hot: #f3d99a;
  --teal: #3db8a8;
  --teal-dim: rgba(61, 184, 168, 0.14);
  --signal: #6ee7c5;
  --danger: #d47a5a;
  --ok: #5dce8f;
  --radius: 3px;
  --max: 1160px;
  --font-display: "Oxanium", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --font-mono: "Azeret Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  background: var(--ink);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 90% 55% at 12% -8%, rgba(61, 184, 168, 0.2), transparent 55%),
    radial-gradient(ellipse 70% 45% at 92% 8%, rgba(232, 196, 120, 0.12), transparent 50%),
    linear-gradient(180deg, #050a0f 0%, #070d12 45%, #0b141c 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(232, 196, 120, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 196, 120, 0.045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 25%, black, transparent);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--amber);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--amber-hot);
}

/* —— Nav —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(7, 13, 18, 0.84);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  line-height: 1.15;
}

.brand-call {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: var(--amber);
}

.brand-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
  display: flex;
  gap: 0.15rem;
  align-items: center;
}

.nav-links a {
  display: block;
  padding: 0.45rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: var(--radius);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--teal-dim);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
  cursor: pointer;
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .nav-links {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.35rem;
    background: rgba(5, 10, 15, 0.97);
    backdrop-filter: blur(20px);
    padding: max(4rem, env(safe-area-inset-top)) 1.5rem max(2rem, env(safe-area-inset-bottom));
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    font-size: 1.35rem;
    padding: 0.95rem 1rem;
    text-align: center;
    border: 1px solid transparent;
  }

  .nav-links a[aria-current="page"] {
    border-color: var(--line-strong);
  }

  body.nav-open {
    overflow: hidden;
  }
}

/* —— Layout —— */
.section-inner,
.page-pad {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 4.5rem 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 0.6rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}

.section-lead {
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 1.75rem;
}

.page-hero {
  padding: 3.25rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--amber) 0%, #c9a05a 100%);
  color: #1a1208;
}

.btn-primary:hover {
  color: #0a0804;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--amber);
}

.btn-ghost:hover {
  border-color: var(--amber);
  color: var(--amber-hot);
}

.btn-teal {
  background: var(--teal-dim);
  border-color: rgba(61, 184, 168, 0.45);
  color: var(--signal);
}

/* —— Hero home —— */
.hero {
  position: relative;
  min-height: min(92vh, 760px);
  display: flex;
  align-items: flex-end;
  padding: 0 0 4rem;
  overflow: hidden;
}

.hero-wave {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-wave canvas {
  width: 100%;
  height: 100%;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 0.75rem;
}

.hero-call {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.2rem, 14vw, 7.5rem);
  line-height: 0.92;
  margin: 0 0 1rem;
  letter-spacing: 0.04em;
}

.hero-call span {
  color: var(--amber);
}

.hero-line {
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.12rem;
  margin: 0 0 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.hero-status {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.hero-status strong {
  color: var(--signal);
  font-weight: 500;
}

/* —— Live log —— */
.live-log {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
}

.live-log-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}

.live-log-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.live-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.live-badge::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(93, 206, 143, 0.6);
  animation: pulse 1.8s var(--ease) infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.live-log-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 28rem;
}

.live-log table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  table-layout: auto;
}

.live-log th,
.live-log td {
  padding: 0.55rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(232, 196, 120, 0.08);
  vertical-align: top;
}

.live-log th {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.65rem;
  position: sticky;
  top: 0;
  background: var(--ink-2);
  white-space: nowrap;
}

.live-log td.call {
  color: var(--amber);
  font-weight: 500;
  white-space: nowrap;
}

.live-log td.detail {
  white-space: normal;
  overflow-wrap: anywhere;
}

.live-log td.where {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 16rem;
}

.live-log td.lotw-yes {
  color: var(--ok);
  font-weight: 500;
}

.live-log td.lotw-no {
  color: var(--muted);
}

.live-log-empty,
.live-log-err {
  padding: 1.5rem 1rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.live-log-note {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* —— Bio / split —— */
.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
}

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

/* —— Premium mobile / tablet —— */
@media (max-width: 820px) {
  body {
    font-size: 1rem;
  }

  .hero {
    min-height: auto;
    padding: 2.5rem 0 2rem;
    align-items: flex-start;
  }

  .hero-content {
    text-align: left;
  }

  .hero-call {
    font-size: clamp(3rem, 18vw, 4.5rem);
    margin-bottom: 0.75rem;
  }

  .hero-line {
    font-size: 1rem;
    max-width: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 2.85rem;
    justify-content: center;
  }

  .hero-status {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .section {
    padding: 2.75rem 0;
  }

  .section-inner,
  .page-pad {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .page-hero {
    padding: 2rem 0 1.25rem;
  }

  .section-title {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .app-tile {
    min-height: 0;
  }

  .app-tile .app-actions {
    flex-direction: column;
  }

  .app-tile .btn {
    width: 100%;
    justify-content: center;
    min-height: 2.75rem;
  }

  .live-log-table-wrap {
    max-height: none;
    overflow: visible;
  }

  .live-log table {
    font-size: 0.7rem;
  }

  .live-log table,
  .live-log thead,
  .live-log tbody,
  .live-log th,
  .live-log td,
  .live-log tr {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .live-log thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .live-log tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "call lotw"
      "detail detail"
      "where where";
    gap: 0.12rem 0.5rem;
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .live-log tbody tr:nth-child(odd) {
    background: rgba(0, 0, 0, 0.18);
  }

  .live-log td {
    border: 0;
    padding: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: none;
  }

  .live-log td.call {
    grid-area: call;
    font-size: 0.88rem;
    line-height: 1.25;
    min-width: 0;
  }

  .live-log td.lotw {
    grid-area: lotw;
    justify-self: end;
    align-self: start;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .live-log td.detail {
    grid-area: detail;
    color: var(--muted);
    font-size: 0.66rem;
    line-height: 1.35;
  }

  .live-log td.where {
    grid-area: where;
    color: var(--muted);
    font-size: 0.66rem;
    line-height: 1.35;
    max-width: none;
  }

  .sentinel-frame-wrap iframe {
    height: calc(100dvh - 12rem);
    min-height: 28rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .file-list li {
    flex-direction: column;
    align-items: stretch;
  }

  .file-list .btn {
    width: 100%;
    justify-content: center;
  }

  .article {
    padding: 1.75rem 1rem 3rem;
  }
}

@media (max-width: 480px) {
  .hero-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }

  .brand-meta {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.prose p {
  color: var(--muted);
}

.prose strong {
  color: var(--text);
}

.meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.meta-list li:last-child {
  border-bottom: 0;
}

.meta-list span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.meta-list strong {
  color: var(--amber);
  font-weight: 600;
}

/* —— Software catalog —— */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.app-tile {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 12rem;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.app-tile:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.app-tile h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.app-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.app-tile .app-status {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}

.app-tile .app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.download-panel {
  margin-top: 2.5rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  padding: 1.25rem;
}

.download-panel h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.download-panel p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.file-list a {
  text-decoration: none;
}

/* —— Sentinel —— */
.sentinel-shell {
  display: grid;
  gap: 1.25rem;
}

.sentinel-frame-wrap {
  border: 1px solid var(--line);
  background: #000;
  min-height: 70vh;
  position: relative;
}

.sentinel-frame-wrap iframe {
  width: 100%;
  height: min(78vh, 900px);
  border: 0;
  display: block;
  background: #0a0a0a;
}

.sentinel-fallback {
  padding: 1.5rem;
  color: var(--muted);
}

/* —— Blog —— */
.post-list {
  display: grid;
  gap: 1rem;
}

.post-item {
  border-left: 2px solid var(--teal);
  padding: 0.85rem 0 0.85rem 1.1rem;
}

.post-item time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.post-item h2 {
  margin: 0.25rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.post-item h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-item h2 a:hover {
  color: var(--amber);
}

.post-item p {
  margin: 0;
  color: var(--muted);
}

.article {
  max-width: 42rem;
  padding: 2.5rem 1.25rem 4rem;
  margin: 0 auto;
}

.article h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0.5rem 0 1rem;
}

.article time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.article .body {
  color: var(--muted);
}

.article .body h2 {
  color: var(--text);
  font-family: var(--font-display);
  margin-top: 2rem;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.25rem 2.5rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner a {
  text-decoration: none;
  color: var(--muted);
}

.footer-inner a:hover {
  color: var(--amber);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
}

/* —— Motion —— */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .live-badge::before {
    animation: none;
  }

  .btn:hover {
    transform: none;
  }
}
