/* 4ura public method pages — shared stylesheet.
 *
 * The static pages under public/ are served outside the Vite bundle, so they
 * cannot import src/css/**. This file mirrors the main site's design system
 * (see src/css/tokens.css, src/css/components/glass.css) by re-using the tokens
 * that public/tokens.css already publishes, and by copying the glass-2_5d
 * treatment verbatim. Load order on every page:
 *
 *   <link rel="stylesheet" href="<...>/tokens.css">
 *   <link rel="stylesheet" href="<...>/methods.css">
 *
 * When a token value changes in src/css/tokens.css, change it in
 * public/tokens.css — nothing here hard-codes a palette value.
 */

:root {
  /* Per-page accent hook. Pages stay on the site primary by default. */
  --page-accent: var(--primary);
  --page-accent-soft: rgba(34, 230, 240, 0.06);
  --page-accent-line: rgba(34, 230, 240, 0.28);
  --page-measure: 960px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------------------------------------------------------------- ground -- */
/* Same ground as the console. public/tokens.css points the backdrop at an
 * absolute "/hologram-bg-premium-v2.png", which 404s under the
 * /dev/4ura/dev-ops/ sub-path; the relative URL below works under both roots. */
body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.7;
  background-color: var(--ink-900);
  background-image:
    linear-gradient(to bottom, rgba(6, 11, 19, 0.55), rgba(6, 11, 19, 0.92)),
    url('../hologram-bg-premium-v2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
  background:
    radial-gradient(circle at 18% 16%, rgba(139, 124, 255, 0.18), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(34, 230, 240, 0.16), transparent 26%),
    radial-gradient(circle at 72% 88%, rgba(255, 121, 198, 0.14), transparent 28%);
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  text-wrap: balance;
}

a {
  color: var(--page-accent);
}

img,
svg {
  max-width: 100%;
}

::selection {
  background: rgba(34, 230, 240, 0.25);
}

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

/* ------------------------------------------------------------ nav strip -- */
.nav-strip {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  background: rgba(6, 8, 14, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-hairline);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  text-decoration: none;
}

.nav-logo span {
  color: var(--page-accent);
}

.nav-back,
.nav-lang {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--page-accent);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-back:hover,
.nav-lang:hover {
  background: var(--surface-2);
  border-color: var(--border-emphasis);
  box-shadow: 0 0 15px rgba(34, 230, 240, 0.15);
}

/* -------------------------------------------------------------- wrapper -- */
.wrapper {
  position: relative;
  z-index: 1;
  max-width: var(--page-measure);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 1.5rem) clamp(4rem, 8vw, 8rem);
}

.wrapper--wide {
  --page-measure: 1120px;
}

/* --------------------------------------------------------------- header -- */
.manuscript-header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.manuscript-kicker {
  display: inline-block;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-hairline);
  color: var(--page-accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.manuscript-title {
  margin-bottom: 1.5rem;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  background: linear-gradient(to bottom, #ffffff 0%, #b6d4fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.manuscript-lead {
  max-width: 62ch;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.manuscript-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--page-accent);
}

/* ------------------------------------------------------------ glass box -- */
/* Copied from src/css/components/glass.css (.glass-2_5d). */
.glass-box,
.toc-panel,
.info-card,
.warning-card,
.step-item,
.figure-block,
.data-table-wrapper,
.house-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-hairline);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 -1px 1px rgba(0, 0, 0, 0.3);
  border-radius: var(--r-lg);
}

/* ----------------------------------------------------------------- toc --- */
.toc-panel {
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.toc-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  list-style: none;
}

.toc-grid a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.toc-grid a:hover {
  color: var(--page-accent);
}

.toc-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--page-accent);
  opacity: 0.7;
}

/* -------------------------------------------------------------- article -- */
.article-body h2 {
  position: relative;
  margin: clamp(2.5rem, 6vw, 4rem) 0 1.5rem;
  padding-bottom: 0.5rem;
  scroll-margin-top: 100px;
  color: var(--text);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
}

.article-body h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  border-radius: 2px;
  background: var(--page-accent);
}

.article-body h3 {
  margin: 2.5rem 0 1rem;
  color: var(--page-accent);
  font-size: 1.4rem;
}

.article-body h4 {
  color: var(--text);
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.article-body p {
  margin-bottom: 1.8rem;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.8rem 1.25rem;
  color: var(--text-muted);
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body strong {
  color: var(--text);
  font-weight: 600;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.4em;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--cyan-300);
}

/* ---------------------------------------------------------------- cards -- */
.info-card,
.warning-card,
.step-item {
  position: relative;
  padding: clamp(1.25rem, 3vw, 2rem);
  margin: 2.5rem 0;
}

.info-card::before {
  content: attr(data-badge);
  position: absolute;
  top: -10px;
  right: 20px;
  padding: 2px 10px;
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  background: var(--ink-900);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: var(--page-accent);
}

.info-card:not([data-badge])::before {
  content: none;
}

.info-card h4,
.warning-card h4,
.step-item h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.warning-card {
  border-color: rgba(255, 184, 108, 0.25);
}

.warning-card h4 {
  color: var(--warning);
}

.step-list {
  list-style: none;
  margin: 2rem 0;
}

.step-item {
  margin: 0 0 1.5rem;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.step-item:hover {
  border-color: var(--border-emphasis);
  transform: translateX(5px);
}

.step-number {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--page-accent);
}

/* -------------------------------------------------------------- figures -- */
.figure-block {
  margin: clamp(2rem, 5vw, 3.5rem) 0;
  overflow: hidden;
}

.figure-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 4rem) 2rem;
  background: radial-gradient(circle, rgba(34, 230, 240, 0.12) 0%, transparent 70%);
}

.figure-frame img {
  max-width: 180px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(34, 230, 240, 0.3));
  animation: subtle-spin 120s linear infinite;
}

@keyframes subtle-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.figure-caption {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-hairline);
  background: var(--surface-1);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* --------------------------------------------------------------- tables -- */
.data-table-wrapper {
  overflow-x: auto;
  margin: clamp(2rem, 5vw, 3rem) 0;
}

.data-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}

.data-table th {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--page-accent-soft);
  color: var(--page-accent);
  font-weight: 700;
}

.data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-muted);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--surface-1);
  color: var(--text);
}

/* --------------------------------------------------------------- quotes -- */
.manuscript-quote {
  margin: clamp(2rem, 5vw, 3rem) 0;
  padding: 1rem 2rem;
  border-left: 4px solid var(--page-accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--page-accent-soft);
  color: var(--page-accent);
  font-size: 1.2rem;
  font-style: italic;
}

/* ----------------------------------------------------------- references -- */
.ref-links {
  margin-top: clamp(3rem, 8vw, 5rem);
  padding-top: clamp(2rem, 5vw, 3rem);
  border-top: 1px solid var(--border-hairline);
}

.ref-links h3 {
  margin-bottom: 1.5rem;
  color: var(--text);
  font-size: 1.3rem;
}

.ref-list {
  list-style: none;
}

.ref-list li {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.ref-list a {
  color: var(--page-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.ref-list a:hover {
  color: var(--text);
}

/* -------------------------------------------------------- houses layout -- */
.band {
  margin-top: clamp(2rem, 5vw, 4rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--border-hairline);
}

.band h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.band > p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.houses-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.house-wheel {
  width: min(100%, 420px);
  margin: 0 auto;
  aspect-ratio: 1;
}

.house-wheel svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 32px 56px rgba(0, 0, 0, 0.42));
}

.house-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.house-card {
  min-width: 0;
  padding: 1rem;
  border-radius: var(--r-md);
}

.house-card strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.house-card span {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.method-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.method-list li {
  padding-left: 1rem;
  border-left: 3px solid var(--page-accent);
  color: var(--text-muted);
}

.demo-panel {
  max-width: 620px;
  margin: 0 auto;
  padding: 1rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-md);
  background: radial-gradient(ellipse at top right, color-mix(in srgb, var(--violet) 12%, transparent), transparent 65%), var(--celestial-panel);
  border-top-color: var(--celestial-rim);
  box-shadow: var(--celestial-shadow);
  min-height: 110px;
  color: var(--text);
  line-height: 1.7;
}

.demo-wheel {
  max-width: 420px;
  margin: 1rem auto;
}

/* --------------------------------------------------------------- footer -- */
.page-footer {
  position: relative;
  z-index: 1;
  max-width: var(--page-measure);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 1.5rem);
  border-top: 1px solid var(--border-hairline);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.page-footer p {
  margin-bottom: 0.5rem;
}

.page-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.page-footer-links a {
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
}

.page-footer-links a:hover {
  color: var(--page-accent);
}

/* ----------------------------------------------------------- responsive -- */
@media (max-width: 820px) {
  .houses-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-strip {
    padding: 0.75rem 1rem;
  }

  .manuscript-meta {
    gap: 0.75rem 1.25rem;
    font-size: 0.85rem;
  }

  .article-body p {
    font-size: 1rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.75rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .figure-frame img {
    animation: none;
  }

  .step-item {
    transition: none;
  }

  .step-item:hover {
    transform: none;
  }
}

.demo-detail-title { color: var(--text-muted); }
