/* Leadfive shell — shared tokens, header, footer and buttons.
   Loaded by the top page (before home-aios.css) and by the v2 layout (before redesign.css).
   Source of truth: DESIGN.md. */

:root {
  --bg-base: #0a0a0f;
  --bg-elevated: #111118;
  --bg-overlay: #1a1a24;
  --bg-soft: #15151d;
  --text-primary: #f3f0e8;
  --text-secondary: #b9b6ad;
  --text-tertiary: #8b8982;
  --gold: #d6ad55;
  --gold-bright: #ecd28f;
  --gold-dim: rgba(214, 173, 85, 0.16);
  --gold-line: rgba(214, 173, 85, 0.42);
  --gold-glow: rgba(214, 173, 85, 0.28);
  --cta: #d6ad55;
  --cta-hover: #ecd28f;
  --green: #64c494;
  --line-subtle: rgba(243, 240, 232, 0.09);
  --line-default: rgba(243, 240, 232, 0.16);
  --line-strong: rgba(243, 240, 232, 0.28);
  --shadow-panel: 0 32px 90px rgba(0, 0, 0, 0.42);
  --font-display: "Cormorant Garamond", "Noto Serif JP", Georgia, serif;
  --font-body: "Noto Sans JP", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --shell: min(1200px, calc(100vw - 80px));
  --header-height: 76px;
  --z-header: 30;
  --z-menu: 40;
  --z-progress: 50;
  --z-skip: 60;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: var(--z-skip);
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: var(--bg-base);
  background: var(--gold-bright);
  border-radius: 6px;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Reading progress — scroll-driven animation with JS fallback */
.scroll-progress {
  position: fixed;
  z-index: var(--z-progress);
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  .scroll-progress {
    animation: progressGrow linear both;
    animation-timeline: scroll(root);
  }
}

@keyframes progressGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Header */
.site-header {
  position: fixed;
  z-index: var(--z-header);
  top: 0;
  right: 0;
  left: 0;
  height: var(--header-height);
  color: var(--text-primary);
  border-bottom: 1px solid transparent;
  transition: background-color 220ms ease, border-color 220ms ease, backdrop-filter 220ms ease;
}

.site-header.is-scrolled,
.site-header.is-menu-open,
.site-header.is-solid {
  background: rgba(10, 10, 15, 0.9);
  border-bottom-color: var(--line-subtle);
  backdrop-filter: blur(18px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--text-primary);
}

.brand__name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.global-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-left: auto;
}

.global-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: color 180ms ease;
}

.global-nav a::after {
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  height: 1px;
  background: var(--gold);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.global-nav a:hover {
  color: var(--text-primary);
}

.global-nav a:hover::after {
  transform: scaleX(1);
}

.header-cta {
  display: inline-flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-left: 30px;
  padding: 0 18px;
  color: var(--gold-bright);
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.header-cta:hover {
  color: var(--bg-base);
  background: var(--gold);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: 14px;
  padding: 0;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--line-default);
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1px;
  margin: 6px auto;
  background: currentColor;
  transition: transform 180ms ease;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* Buttons and links */
.button {
  display: inline-flex;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.button--primary {
  color: #12110d;
  background: var(--cta);
  border-color: var(--cta);
}

.button--primary:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  box-shadow: 0 12px 32px rgba(214, 173, 85, 0.28);
  transform: translateY(-3px);
}

.button--quiet {
  color: var(--text-secondary);
  background: rgba(10, 10, 15, 0.4);
  border-color: var(--line-default);
}

.button--quiet:hover {
  color: var(--text-primary);
  border-color: var(--gold-line);
  transform: translateY(-3px);
}

.text-link {
  display: inline-flex;
  gap: 22px;
  align-items: center;
  min-height: 44px;
  color: var(--gold-bright);
  border-bottom: 1px solid var(--gold-line);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  transition: gap 180ms ease, border-color 180ms ease;
}

.text-link:hover {
  gap: 28px;
  border-bottom-color: var(--gold-bright);
}

/* Footer */
.site-footer {
  padding: 78px 0 28px;
  color: var(--text-primary);
  background: #08080c;
}

.footer__main {
  display: grid;
  grid-template-columns: minmax(280px, 5fr) minmax(0, 7fr);
  gap: 8.333%;
  padding-bottom: 70px;
}

.footer__brand-block p {
  max-width: 360px;
  margin: 24px 0 0;
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.8;
}

.footer__nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
}

.footer__nav div {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer__nav h3 {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: 13px;
  transition: color 180ms ease;
}

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

.footer__bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--line-subtle);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 980px) {
  :root {
    --shell: min(1200px, calc(100vw - 48px));
    --header-height: 68px;
  }

  .global-nav {
    position: fixed;
    z-index: var(--z-menu);
    inset: var(--header-height) 0 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    margin: 0;
    padding: 18px 24px 32px;
    background: rgba(10, 10, 15, 0.97);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 220ms ease, transform 220ms ease, visibility 0s linear 220ms;
  }

  .global-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 220ms ease, transform 220ms ease, visibility 0s;
  }

  .global-nav a {
    min-height: 60px;
    padding: 0 4px;
    border-bottom: 1px solid var(--line-subtle);
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 0;
  }

  .global-nav a::after {
    display: none;
  }

  .header-cta {
    display: none;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .footer__main {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

@media (max-width: 640px) {
  :root {
    --shell: min(1200px, calc(100vw - 40px));
  }

  .footer__nav {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress {
    display: none;
    animation: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header.is-scrolled,
  .site-header.is-menu-open,
  .site-header.is-solid {
    backdrop-filter: none;
  }
}
