/*
  Archon DS — static site styles

  Goals:
  - Keep everything self-contained (no external fonts/CDNs).
  - Be readable and responsive on mobile/desktop.
  - Provide a modern layout without a build step.
*/

:root {
  --bg: #0b1220;
  --bg-elev: rgba(255, 255, 255, 0.06);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.72);
  --border: rgba(255, 255, 255, 0.12);

  --brand: #5fe0d1;
  --brand-2: #82a6ff;
  --danger: #ff7b7b;

  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  --radius: 18px;

  --max: 1100px;
}

/*
  Theme switching:
  - Default to system, but allow explicit `data-theme="light"` override.
  - Keep contrast high for readability.
*/
html[data-theme="light"] {
  --bg: #f7fafc;
  --bg-elev: rgba(4, 24, 38, 0.06);
  --text: rgba(4, 24, 38, 0.92);
  --muted: rgba(4, 24, 38, 0.72);
  --border: rgba(4, 24, 38, 0.14);

  --brand: #0aa0a1;
  --brand-2: #335dff;

  --shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(
      1400px 900px at 70% -10%,
      rgba(130, 166, 255, 0.25),
      transparent 60%
    ),
    radial-gradient(
      900px 600px at 10% 10%,
      rgba(95, 224, 209, 0.22),
      transparent 55%
    ),
    var(--bg);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Ubuntu,
    Cantarell,
    Noto Sans,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Accessibility: visible focus without being distracting. */
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 70%, white 30%);
  outline-offset: 3px;
  border-radius: 10px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  z-index: 9999;
}
.skip-link:focus {
  left: 10px;
}

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

/* Header / nav */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  position: relative;
  width: 64px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  flex: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  background: transparent;
  border: 0;
  box-shadow: var(--shadow);
}

.brand-mark .brand-text {
  position: absolute;
  inset: 0;
  transform-origin: 68% 78%;
  animation: brand-text-rotate 18s linear infinite;
  will-change: transform;
}

@keyframes brand-text-rotate {
  from {
    transform: rotate(-3deg);
  }
  to {
    transform: rotate(3deg);
  }
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    120deg,
    transparent 42%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 58%
  );
  transform: translateX(-70%) rotate(8deg);
  animation: brand-sheen 4.2s ease-in-out infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}

@keyframes brand-sheen {
  0%,
  55% {
    transform: translateX(-70%) rotate(8deg);
    opacity: 0;
  }
  70% {
    opacity: 0.9;
  }
  100% {
    transform: translateX(70%) rotate(8deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark .brand-text {
    animation: none;
  }
  .brand-mark::after {
    animation: none;
    opacity: 0;
  }
}

.brand .name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand .name strong {
  font-size: 14px;
  letter-spacing: 0.2px;
}
.brand .name span {
  font-size: 12px;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links a {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
  transition:
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
}
.nav-links a[aria-current="true"] {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg-elev);
}
.nav-links a:hover {
  color: var(--text);
  border-color: var(--border);
  background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 0 0 transparent;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.primary {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--brand) 80%, white 20%),
    color-mix(in srgb, var(--brand-2) 80%, white 20%)
  );
  border-color: transparent;
  color: color-mix(in srgb, var(--bg) 15%, black 85%);
  font-weight: 650;
}

.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
}
.icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

/* Mobile nav (simple and robust; JS toggles `body.nav-open`). */
.nav-toggle {
  display: none;
}
@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  body.nav-open .nav-links {
    display: flex;
    width: 100%;
    padding: 10px 0 6px;
    justify-content: flex-start;
  }
  .nav {
    flex-wrap: wrap;
  }
  .nav-actions {
    min-width: auto;
  }
}

/* Main sections */
main {
  padding: 28px 0 70px;
}
section {
  padding: 42px 0;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.section-title h2 {
  font-size: 20px;
  margin: 0;
}
.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Hero */
.hero {
  position: relative;
  overflow: clip;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
  box-shadow: var(--shadow);
}

/* Decorative background from existing graphic; kept subtle so content is not "a picture". */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      900px 520px at 30% 10%,
      rgba(95, 224, 209, 0.18),
      transparent 55%
    ),
    radial-gradient(
      1000px 680px at 80% 0%,
      rgba(130, 166, 255, 0.18),
      transparent 58%
    ),
    url("../images/archon_web_intro.png");
  background-size: cover, cover, cover;
  background-position: center, center, center;
  opacity: 0.26;
  filter: saturate(1.05) contrast(1.05);
  transform: scale(1.05);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  padding: 34px 24px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 26px;
  align-items: center;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -0.02em;
}
.hero p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 16px;
  max-width: 62ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  padding: 16px;
}
.hero-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}
.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kpis .kpi {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 10px 12px;
}
.kpis .kpi strong {
  display: block;
  font-size: 14px;
}
.kpis .kpi span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

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

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.card {
  grid-column: span 6;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
  padding: 16px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}
.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}
.card li {
  margin: 6px 0;
}

.card.accent {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-elev) 55%, transparent),
    color-mix(in srgb, var(--bg) 65%, transparent)
  );
}

@media (max-width: 860px) {
  .card {
    grid-column: span 12;
  }
}

/* Collapsible blocks (used for the original reference diagram). */
details.card {
  padding: 0;
}
details.card > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px;
  user-select: none;
}
details.card > summary::-webkit-details-marker {
  display: none;
}
details.card > summary span {
  color: var(--muted);
  font-size: 13px;
}
details.card[open] > summary {
  border-bottom: 1px solid var(--border);
}
details.card .details-body {
  padding: 16px;
}
details.card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: white;
}

/* Inline "pill" tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--muted);
  font-size: 12px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  color: var(--muted);
  font-size: 13px;
}
.footer-inner {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.contact {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.contact a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
.contact img {
  width: 18px;
  height: 18px;
}

/*
  Subtle reveal animation:
  - JS adds `reveal--visible` when elements enter the viewport.
  - Respect reduced motion.
*/
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 280ms ease,
    transform 280ms ease;
}
.reveal.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
