/* ═══════════════════════════════════════════════════════════
   EDITION — Design System
   Japanese Cultural Assets Intelligence Platform
   Aesthetic: Sotheby's × Kinfolk × Nezu Museum
   ═══════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  /* Light (Gallery Mode — default) */
  --bg: #FAFAF8;
  --bg-alt: #F3F1ED;
  --surface: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-caption: #999999;
  --border: #E8E6E1;
  --border-light: #F0EDE8;
  --gold: #C5A572;
  --gold-dim: rgba(197,165,114,0.12);

  /* Typography scale */
  --font-serif: 'Cormorant Garamond', 'Noto Serif JP', Georgia, serif;
  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
  --fs-hero: clamp(3rem, 8vw, 6rem);
  --fs-h1: clamp(2.2rem, 5vw, 3.5rem);
  --fs-h2: clamp(1.6rem, 3.5vw, 2.4rem);
  --fs-h3: clamp(1.2rem, 2vw, 1.5rem);
  --fs-body: clamp(0.938rem, 1.1vw, 1.063rem);
  --fs-caption: 0.75rem;
  --fs-label: 0.688rem;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
  --space-2xl: 12rem;

  /* Layout */
  --max-w: 1200px;
  --max-w-narrow: 720px;
  --gutter: clamp(1.5rem, 4vw, 3rem);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration: 0.6s;
  --duration-fast: 0.3s;
}

/* Dark (Night Mode) */
[data-theme="dark"] {
  --bg: #0C0C0C;
  --bg-alt: #111111;
  --surface: #161616;
  --text-primary: #E8E6E1;
  --text-secondary: #8A8A8A;
  --text-caption: #5A5A5A;
  --border: #222222;
  --border-light: #1A1A1A;
  --gold: #D4B882;
  --gold-dim: rgba(212,184,130,0.1);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* ── Typography ── */
.serif { font-family: var(--font-serif); }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

.text-hero {
  font-family: var(--font-serif);
  font-size: var(--fs-hero);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.text-caption {
  font-size: var(--fs-caption);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-caption);
}

.text-label {
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-caption);
}

.text-body-secondary { color: var(--text-secondary); }
.text-gold { color: var(--gold); }

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container--narrow {
  max-width: var(--max-w-narrow);
}

.section {
  padding: var(--space-xl) 0;
}

.section--large {
  padding: var(--space-2xl) 0;
}

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.25rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  transition: background var(--duration-fast) ease, backdrop-filter var(--duration-fast) ease;
}

.header--scrolled {
  background: rgba(250,250,248,0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-light);
}

[data-theme="dark"] .header--scrolled {
  background: rgba(12,12,12,0.88);
}

.header__logo {
  font-family: var(--font-sans);
  font-size: 0.813rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__link {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  transition: color var(--duration-fast) ease;
  position: relative;
}

.header__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--duration-fast) var(--ease-out);
}

.header__link:hover {
  color: var(--text-primary);
}

.header__link:hover::after {
  width: 100%;
}

.header__theme-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: color var(--duration-fast) ease;
}

.header__theme-toggle:hover {
  color: var(--text-primary);
}

/* Header over hero — force light text */
.header--over-hero .header__logo,
.header--over-hero .header__link,
.header--over-hero .header__theme-toggle {
  color: rgba(250,250,248,0.7);
}

.header--over-hero .header__logo { color: #FAFAF8; }
.header--over-hero .header__link:hover { color: #FAFAF8; }

.header--over-hero.header--scrolled .header__logo,
.header--over-hero.header--scrolled .header__link,
.header--over-hero.header--scrolled .header__theme-toggle {
  color: var(--text-secondary);
}

.header--over-hero.header--scrolled .header__logo { color: var(--text-primary); }
.header--over-hero.header--scrolled .header__link:hover { color: var(--text-primary); }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--gutter) var(--space-xl);
  overflow: hidden;
}

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

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4);
  transition: transform 12s linear;
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.7) 0%,
    rgba(0,0,0,0.2) 40%,
    rgba(0,0,0,0.05) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  color: #FAFAF8;
}

.hero__title {
  font-family: var(--font-serif);
  font-size: var(--fs-hero);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  color: #FAFAF8;
}

.hero__subtitle {
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.8;
  color: rgba(250,250,248,0.7);
  max-width: 480px;
  margin-bottom: 2.5rem;
}

.hero__scroll-hint {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(250,250,248,0.4);
}

.hero__scroll-line {
  width: 48px;
  height: 1px;
  background: rgba(250,250,248,0.25);
  position: relative;
  overflow: hidden;
}

.hero__scroll-line::after {
  content: '';
  position: absolute;
  left: -100%;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--gold);
  animation: scrollLine 2.5s var(--ease-in-out) infinite;
}

@keyframes scrollLine {
  0% { left: -100%; }
  50% { left: 0; }
  100% { left: 100%; }
}

/* ── Category Grid ── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.category-card {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  cursor: pointer;
}

.category-card__image {
  position: absolute;
  inset: 0;
}

.category-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration) var(--ease-out);
}

.category-card:hover .category-card__image img {
  transform: scale(1.06);
}

.category-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.65) 0%,
    rgba(0,0,0,0.1) 50%,
    rgba(0,0,0,0) 100%
  );
  transition: background var(--duration-fast) ease;
}

.category-card:hover .category-card__overlay {
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.75) 0%,
    rgba(0,0,0,0.2) 50%,
    rgba(0,0,0,0.05) 100%
  );
}

.category-card__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  transform: translateY(8px);
  transition: transform var(--duration-fast) var(--ease-out);
}

.category-card:hover .category-card__content {
  transform: translateY(0);
}

.category-card__title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: #FAFAF8;
  margin-bottom: 0.25rem;
}

.category-card__subtitle {
  font-size: var(--fs-caption);
  letter-spacing: 0.1em;
  color: rgba(250,250,248,0.6);
}

.category-card__count {
  font-size: var(--fs-label);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 0.5rem;
  opacity: 0;
  transform: translateY(6px);
  transition: all var(--duration-fast) var(--ease-out);
}

.category-card:hover .category-card__count {
  opacity: 1;
  transform: translateY(0);
}

/* ── Editorial Section ── */
.editorial {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.editorial--reverse {
  direction: rtl;
}

.editorial--reverse > * {
  direction: ltr;
}

.editorial__image {
  aspect-ratio: 3/4;
  overflow: hidden;
}

.editorial__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editorial__text {
  padding: var(--space-lg);
}

.editorial__eyebrow {
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.editorial__heading {
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.editorial__body {
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 2rem;
}

.editorial__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  transition: gap var(--duration-fast) var(--ease-out);
}

.editorial__link:hover {
  gap: 1rem;
}

.editorial__link-arrow {
  transition: transform var(--duration-fast) var(--ease-out);
}

/* ── Section Divider ── */
.divider {
  width: 48px;
  height: 1px;
  background: var(--border);
  margin: var(--space-xl) auto;
}

.divider--gold {
  background: var(--gold);
  width: 32px;
}

/* ── About / Mission ── */
.mission {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.mission__heading {
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  font-weight: 300;
  line-height: 1.3;
  margin-bottom: 2rem;
}

.mission__body {
  color: var(--text-secondary);
  line-height: 2;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-lg) var(--gutter);
}

.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__brand {
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-caption);
}

.footer__links {
  display: flex;
  gap: 2rem;
}

.footer__link {
  font-size: var(--fs-caption);
  color: var(--text-caption);
  letter-spacing: 0.05em;
  transition: color var(--duration-fast) ease;
}

.footer__link:hover {
  color: var(--text-primary);
}

.footer__copy {
  font-size: var(--fs-label);
  color: var(--text-caption);
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

/* ── Discover Page ── */
.page-header {
  padding: 10rem var(--gutter) var(--space-lg);
  text-align: center;
}

.page-header__title {
  font-family: var(--font-serif);
  font-size: var(--fs-h1);
  font-weight: 300;
  margin-bottom: 1rem;
}

.page-header__desc {
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* ── Category Detail Page ── */
.cat-hero {
  position: relative;
  height: 70vh;
  min-height: 480px;
  overflow: hidden;
}

.cat-hero__bg {
  position: absolute;
  inset: 0;
}

.cat-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.35);
}

.cat-hero__content {
  position: absolute;
  bottom: var(--space-lg);
  left: var(--gutter);
  z-index: 1;
  color: #FAFAF8;
}

.cat-hero__eyebrow {
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.cat-hero__title {
  font-family: var(--font-serif);
  font-size: var(--fs-h1);
  font-weight: 300;
  color: #FAFAF8;
  margin-bottom: 0.5rem;
}

.cat-hero__subtitle {
  font-size: var(--fs-body);
  color: rgba(250,250,248,0.6);
}

/* Category article */
.cat-article {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  padding: var(--space-xl) var(--gutter);
}

.cat-article h2 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.cat-article p {
  color: var(--text-secondary);
  line-height: 2;
  margin-bottom: 1.5rem;
}

.cat-article__lineage {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 2rem;
  margin: var(--space-md) 0;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 2;
  color: var(--text-secondary);
}

.cat-article__lineage strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* Related categories */
.related {
  border-top: 1px solid var(--border);
  padding: var(--space-lg) 0;
}

.related__title {
  text-align: center;
  margin-bottom: var(--space-md);
}

.related__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.related__card {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
}

.related__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration) var(--ease-out);
}

.related__card:hover img {
  transform: scale(1.05);
}

.related__card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.related__card-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: #FAFAF8;
}

/* ── Asset Grid ── */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.asset-card {
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out);
}

.asset-card:hover {
  transform: translateY(-4px);
}

.asset-card__image {
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--bg-alt);
  margin-bottom: 1rem;
}

.asset-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration) var(--ease-out);
}

.asset-card:hover .asset-card__image img {
  transform: scale(1.04);
}

.asset-card__info {
  padding: 0 0.25rem;
}

.asset-card__title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 0.375rem;
}

.asset-card__meta {
  font-size: var(--fs-caption);
  color: var(--text-caption);
  letter-spacing: 0.04em;
}

/* ── Detail Panel (Slide-in) ── */
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0);
  transition: background 0.4s ease;
  display: flex;
  justify-content: flex-end;
}

.panel-backdrop--open {
  background: rgba(0,0,0,0.5);
}

.panel {
  width: min(560px, 92vw);
  height: 100vh;
  background: var(--surface);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out);
  position: relative;
  border-left: 1px solid var(--border);
}

.panel-backdrop--open .panel {
  transform: translateX(0);
}

.panel__close {
  position: sticky;
  top: 1rem;
  float: right;
  margin: 1rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-secondary);
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  z-index: 10;
  transition: color var(--duration-fast) ease;
}

.panel__close:hover {
  color: var(--text-primary);
}

.panel__image {
  width: 100%;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--bg-alt);
}

.panel__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-alt);
}

.panel__content {
  padding: 2rem;
}

.panel__title {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.375rem;
}

.panel__title-jp {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.panel__meta {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.panel__meta-row {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  font-size: 0.813rem;
}

.panel__meta-row span:first-child {
  color: var(--text-caption);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: var(--fs-label);
}

.panel__meta-row span:last-child {
  color: var(--text-secondary);
  text-align: right;
  max-width: 60%;
}

.panel__desc {
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 1.5rem;
}

.panel__sig {
  color: var(--text-caption);
  font-size: 0.875rem;
  line-height: 1.8;
  padding: 1.25rem;
  background: var(--bg-alt);
  border-left: 2px solid var(--gold);
  margin-bottom: 1.5rem;
}

.panel__source {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.panel__source a {
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  transition: opacity var(--duration-fast) ease;
}

.panel__source a:hover {
  opacity: 0.7;
}

/* ── Scroll Animations ── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--duration) var(--ease-out),
              transform var(--duration) var(--ease-out);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }

/* ── Page Transition ── */
#app {
  opacity: 1;
  transition: opacity 0.25s ease;
}

#app.transitioning {
  opacity: 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .editorial {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .editorial--reverse { direction: ltr; }
  .editorial__text { padding: var(--space-md) 0; }
  .related__grid { grid-template-columns: repeat(2, 1fr); }
  .asset-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }
  .category-card { aspect-ratio: 3/4; }
  .header__nav { gap: 1rem; }
  .header__link { display: none; }
  .header__link:last-of-type { display: block; }
  .footer__inner { flex-direction: column; gap: 1.5rem; }
  .footer__links { gap: 1.5rem; }
  .related__grid { grid-template-columns: 1fr 1fr; }
  .asset-grid { grid-template-columns: 1fr; }
  .panel { width: 100vw; }
}

/* ── Mobile nav ── */
.mobile-nav-toggle {
  display: none;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.mobile-nav-toggle span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--text-primary);
  transition: all var(--duration-fast) ease;
}

@media (max-width: 640px) {
  .mobile-nav-toggle { display: flex; }
}

/* ═══════════════════════════════════════════════════════════
   Authentication Page
   ═══════════════════════════════════════════════════════════ */

.auth-page {
  padding-top: var(--header-h);
}

/* ── Auth Hero ── */
.auth-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: var(--space-xl) var(--gutter);
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.auth-hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  pointer-events: none;
  animation: authPulse 8s ease-in-out infinite;
}

.auth-hero::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  pointer-events: none;
  animation: authPulse 8s ease-in-out infinite 2s;
}

@keyframes authPulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.08); }
}

.auth-hero__content {
  text-align: center;
  max-width: 720px;
  position: relative;
  z-index: 1;
}

.auth-hero__title {
  font-family: var(--font-serif);
  font-size: var(--fs-hero);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.auth-hero__desc {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--text-secondary);
  line-height: 1.9;
  max-width: 540px;
  margin: 0 auto;
}

/* ── Philosophy Section ── */
.auth-philosophy {
  padding: var(--space-xl) var(--gutter);
  background: var(--bg-alt);
}

.auth-philosophy__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-xl);
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
}

.auth-philosophy__visual {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.auth-stat {
  padding: 2rem;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  transition: border-color var(--duration) ease;
}

.auth-stat:hover {
  border-color: var(--gold);
}

.auth-stat__number {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 300;
  color: var(--gold);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.auth-stat__label {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ── Layers Section ── */
.auth-layers {
  padding: var(--space-xl) var(--gutter);
  background: var(--bg);
}

.auth-layers__stack {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-layer {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 2rem;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-light);
}

.auth-layer:last-child {
  border-bottom: none;
}

.auth-layer__marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.auth-layer__number {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
}

.auth-layer__line {
  width: 1px;
  flex: 1;
  min-height: 40px;
  background: linear-gradient(to bottom, var(--gold), transparent);
}

.auth-layer__content {
  padding-bottom: 0.5rem;
}

.auth-layer__title {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.auth-layer__subtitle {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.auth-layer__desc {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

.auth-layer__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-layer__tags span {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--duration-fast) ease;
}

.auth-layer__tags span:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Scientific Methods */
.auth-layer__methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.auth-method {
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  background: var(--bg-alt);
  transition: border-color var(--duration) ease;
}

.auth-method:hover {
  border-color: var(--gold);
}

.auth-method__name {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.auth-method__desc {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Threats Section ── */
.auth-threats {
  padding: var(--space-xl) var(--gutter);
  background: var(--bg-alt);
}

.auth-threats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.auth-threat-card {
  padding: 2.5rem 2rem;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--duration) ease;
  position: relative;
  overflow: hidden;
}

.auth-threat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration) ease;
}

.auth-threat-card:hover::before {
  transform: scaleX(1);
}

.auth-threat-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.auth-threat-card__level {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
  font-weight: 600;
}

.auth-threat-card__title {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  font-weight: 400;
  margin-bottom: 1rem;
}

.auth-threat-card__desc {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.auth-threat-card__defense {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-caption);
  line-height: 1.6;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

/* ── Auth CTA ── */
.auth-cta {
  padding: var(--space-xl) var(--gutter);
  background: var(--bg);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .auth-philosophy__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .auth-philosophy__visual {
    grid-template-columns: repeat(3, 1fr);
  }
  .auth-threats__grid {
    grid-template-columns: 1fr;
  }
  .auth-layer__methods {
    grid-template-columns: 1fr;
  }
  .auth-layer {
    grid-template-columns: 48px 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .auth-philosophy__visual {
    grid-template-columns: 1fr;
  }
}

/* ── Auth Promo (Homepage) ── */
.auth-promo {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: var(--space-xl);
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
}

.auth-promo__metrics {
  display: grid;
  gap: 1.5rem;
}

.auth-promo__metric {
  padding: 1.5rem 2rem;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  transition: border-color var(--duration) ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 140px;
}

.auth-promo__metric:hover {
  border-color: var(--gold);
}

.auth-promo__metric-value {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 300;
  color: var(--gold);
  line-height: 1.2;
  width: 100%;
}

.auth-promo__metric-label {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: auto;
  padding-top: 0.75rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .auth-promo {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .auth-promo__metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .auth-promo__metrics {
    grid-template-columns: 1fr;
  }
}

/* ── Discover Search ── */
.discover-search {
  max-width: 480px;
  margin: 2rem auto 0;
}

.discover-search__input {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color var(--duration) ease;
}

.discover-search__input::placeholder {
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.discover-search__input:focus {
  border-color: var(--gold);
}

/* ── Price Intelligence: Details/Summary ── */
details summary::-webkit-details-marker,
details summary::marker {
  display: none;
  content: '';
}

details summary {
  user-select: none;
}

details summary:hover {
  background: var(--bg-alt) !important;
}

details[open] > summary {
  border-bottom: 1px solid var(--border);
}

details summary::after {
  content: '▸';
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  margin-left: 0.5rem;
}

details[open] summary::after {
  transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════════════════
   KANTEISHI Page
   ═══════════════════════════════════════════════════════════ */

/* ── KANTEISHI Hero ── */
.kanteishi-hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem var(--gutter) 4rem;
  overflow: hidden;
}

.kanteishi-hero__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(197,165,114,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 30%, rgba(197,165,114,0.04) 0%, transparent 50%),
              var(--bg);
}

[data-theme="dark"] .kanteishi-hero__bg {
  background: radial-gradient(ellipse at 30% 50%, rgba(212,184,130,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 30%, rgba(212,184,130,0.03) 0%, transparent 50%),
              #0C0C0C;
}

.kanteishi-hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
}

.kanteishi-hero__title {
  margin-bottom: 2rem;
}

.kanteishi-hero__title-main {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--gold);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.kanteishi-hero__title-sub {
  display: block;
  font-family: var(--font-sans);
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.kanteishi-hero__desc {
  font-size: var(--fs-body);
  color: var(--text-secondary);
  line-height: 1.9;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.kanteishi-hero__pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-caption);
}

.kanteishi-hero__pulse-dot {
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74,222,128,0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(74,222,128,0); }
}

/* ── KANTEISHI Stat Cards ── */
.kanteishi-stat {
  padding: 2rem;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  transition: border-color var(--duration) ease, transform var(--duration-fast) ease;
}

.kanteishi-stat:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.kanteishi-stat__value {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 300;
  color: var(--gold);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.kanteishi-stat__label {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ── Auction House Bars ── */
.kanteishi-houses {
  display: grid;
  gap: 1.5rem;
}

.kanteishi-house {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color var(--duration) ease;
}

.kanteishi-house:hover {
  border-color: var(--gold);
}

.kanteishi-house__name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
}

.kanteishi-house__bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.kanteishi-house__bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light, #d4b882));
  border-radius: 3px;
  transition: width 1.5s var(--ease-out);
}

.kanteishi-house__count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── Capability Cards ── */
.kanteishi-capabilities {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.kanteishi-cap {
  padding: 2.5rem 2rem;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--duration) ease;
  position: relative;
  overflow: hidden;
}

.kanteishi-cap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration) ease;
}

.kanteishi-cap:hover::before {
  transform: scaleX(1);
}

.kanteishi-cap:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.kanteishi-cap__icon {
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.kanteishi-cap__title {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.kanteishi-cap__desc {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ── Code Block ── */
.kanteishi-code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  overflow-x: auto;
}

[data-theme="dark"] .kanteishi-code {
  background: #111111;
}

.kanteishi-code pre {
  margin: 0;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── KANTEISHI Responsive ── */
@media (max-width: 768px) {
  .kanteishi-capabilities {
    grid-template-columns: 1fr;
  }
  .kanteishi-house {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .kanteishi-house__bar {
    order: 3;
  }
}

/* ═══════════════════════════════════════════════════════════
   Mobile Navigation
   ═══════════════════════════════════════════════════════════ */

/* Accent link (KANTEISHI) */
.header__link--accent {
  color: var(--gold) !important;
  font-weight: 500;
}

.header__link--accent::after {
  background: var(--gold);
}

/* Mobile toggle */
.mobile-nav-toggle {
  display: none;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 1002;
  position: relative;
}

.mobile-nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text-primary);
  transition: all var(--duration-fast) ease;
  transform-origin: center;
}

.header--over-hero .mobile-nav-toggle span {
  background: rgba(250,250,248,0.8);
}

.header--over-hero.header--scrolled .mobile-nav-toggle span {
  background: var(--text-primary);
}

.mobile-nav-toggle--open span:nth-child(1) {
  transform: rotate(45deg) translateY(5px);
}

.mobile-nav-toggle--open span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle--open span:nth-child(3) {
  transform: rotate(-45deg) translateY(-5px);
}

@media (max-width: 640px) {
  .mobile-nav-toggle {
    display: flex;
  }

  .header__nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: var(--surface);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transform: translateX(100%);
    transition: transform var(--duration-fast) var(--ease-out);
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
    z-index: 1001;
    border-left: 1px solid var(--border);
  }

  [data-theme="dark"] .header__nav {
    box-shadow: -4px 0 24px rgba(0,0,0,0.4);
  }

  .header__nav--open {
    transform: translateX(0);
  }

  .header__link {
    display: block !important;
    font-size: 0.9rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
  }

  /* Override hero color for mobile nav links */
  .header--over-hero .header__nav .header__link,
  .header--over-hero .header__nav .header__lang-toggle,
  .header--over-hero .header__nav .header__theme-toggle {
    color: var(--text-secondary) !important;
  }

  .header--over-hero .header__nav .header__link:hover {
    color: var(--text-primary) !important;
  }

  .header--over-hero .header__nav .header__link--accent {
    color: var(--gold) !important;
  }
}

