/* Home page — typography + motion + brand-red color unify (index only) */
body.home {
  --home-display: "Outfit", "Noto Sans KR", sans-serif;
  --home-body: "Noto Sans KR", "Outfit", sans-serif;
  --home-primary: var(--reonai-primary, #8e1e23);
  --home-primary-hover: var(--reonai-primary-hover, #a32a30);
  --home-ink: var(--reonai-text-primary, #1a1a1a);
  --home-muted: var(--reonai-text-secondary, #6b6b6b);
  --home-line: var(--reonai-border, #e5e5e5);
  --home-bg: var(--reonai-bg, #ffffff);
  --home-surface: var(--reonai-surface, #fafafa);
  font-family: var(--home-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--home-bg);
  color: var(--home-ink);
}

body.home h1,
body.home h2,
body.home h3,
body.home .home-paths__title,
body.home .home-hero__brand {
  font-family: var(--home-display);
}

body.home .home-hero,
body.home .home-continue,
body.home .home-paths,
body.home .home-notices,
body.home .home-footer {
  font-family: var(--home-body);
}

body.home .home-continue__title {
  font-family: var(--home-display);
}

/* ---- Nav ↔ hero continuity (home only) ----
   Transparent overlay on hero → solid after scroll.
   One composition instead of opaque chrome + separate hero. */
body.home #navbar-container {
  position: relative;
  z-index: 50;
  height: 0;
}

body.home #mainNav.fey-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    backdrop-filter 0.35s ease;
}

body.home #mainNav.fey-nav.scrolled {
  background: color-mix(in srgb, var(--home-bg, #fff) 92%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--home-line, #e5e5e5) 80%, transparent);
  box-shadow: 0 4px 18px rgba(26, 26, 26, 0.06);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

html.dark body.home #mainNav.fey-nav.scrolled {
  background: color-mix(in srgb, #121212 90%, transparent);
  border-bottom-color: rgba(243, 240, 235, 0.1);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

/* Soft top veil so nav links stay readable on hero wash */
body.home .home-hero__atmosphere::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5.5rem;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--reonai-bg, #fff) 55%, transparent) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

html.dark body.home .home-hero__atmosphere::before {
  background: linear-gradient(
    180deg,
    rgba(18, 18, 18, 0.65) 0%,
    transparent 100%
  );
}

/* Outfit + brand mark — match hero/home chrome */
body.home #mainNav .fey-nav-link,
body.home #mainNav .fey-cta-btn,
body.home #mainNav .fey-user-btn,
body.home #mainNav .fey-ai-toggle,
body.home #mainNav .fey-mobile-link {
  font-family: var(--home-display);
  letter-spacing: -0.02em;
}

body.home #mainNav .fey-logo > div {
  background: var(--home-primary, #8e1e23) !important;
  background-image: none !important;
  border-radius: 0.5rem;
  box-shadow: none;
}

body.home #mainNav .fey-cta-btn {
  background: var(--home-primary, #8e1e23);
  background-image: none;
  border-radius: 0.55rem;
  box-shadow: none;
}

body.home #mainNav .fey-cta-btn:hover {
  background: var(--home-primary-hover, #a32a30);
  box-shadow: none;
}

body.home #mainNav.fey-nav:not(.scrolled) .fey-nav-link:hover {
  background-color: color-mix(in srgb, var(--home-primary, #8e1e23) 10%, transparent);
}

/* Mobile: readable bar + 44px touch targets (hamburger is primary chrome) */
@media (max-width: 767px) {
  body.home #mainNav.fey-nav {
    padding-top: env(safe-area-inset-top, 0px);
  }

  body.home #mainNav.fey-nav:not(.scrolled) {
    background: color-mix(in srgb, var(--home-bg, #fff) 78%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--home-line, #e5e5e5) 65%, transparent);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
  }

  html.dark body.home #mainNav.fey-nav:not(.scrolled) {
    background: color-mix(in srgb, #121212 78%, transparent);
    border-bottom-color: rgba(243, 240, 235, 0.14);
  }

  body.home #mainNav .fey-logo {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: -4px;
  }

  body.home #mainNav .fey-logo > div {
    width: 2.25rem !important;
    height: 2.25rem !important;
  }

  body.home #mainNav .fey-hamburger {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 0.55rem;
    border: 1px solid color-mix(in srgb, var(--home-line, #e5e5e5) 85%, transparent);
    background: color-mix(in srgb, var(--home-bg, #fff) 70%, transparent);
  }

  body.home #mainNav.fey-nav:not(.scrolled) .fey-hamburger {
    border-color: color-mix(in srgb, var(--home-primary, #8e1e23) 28%, var(--home-line, #e5e5e5));
  }

  html.dark body.home #mainNav .fey-hamburger {
    border-color: rgba(243, 240, 235, 0.28);
    background: rgba(18, 18, 18, 0.45);
  }

  body.home #mainNav .fey-hamburger:hover,
  body.home #mainNav .fey-hamburger:focus-visible {
    background: color-mix(in srgb, var(--home-primary, #8e1e23) 10%, var(--home-bg, #fff));
  }

  body.home #mainNav .fey-hamburger-line {
    background-color: var(--home-ink, #1a1a1a);
  }

  html.dark body.home #mainNav .fey-hamburger-line {
    background-color: #f3f0eb;
  }

  body.home .home-hero__atmosphere::before {
    height: 5.25rem;
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--reonai-bg, #fff) 72%, transparent) 0%,
      transparent 100%
    );
  }

  html.dark body.home .home-hero__atmosphere::before {
    background: linear-gradient(
      180deg,
      rgba(18, 18, 18, 0.78) 0%,
      transparent 100%
    );
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home #mainNav.fey-nav {
    transition: none;
  }
}

/* CTA hierarchy: hero primary owns "start roast"; Hub FAB = help/wayfinding only */
body.home .hub-fab {
  background: var(--home-bg, #fff);
  color: var(--home-primary, #8e1e23);
  border: 1.5px solid var(--home-primary, #8e1e23);
  box-shadow: 0 4px 14px rgba(26, 26, 26, 0.08);
  font-weight: 600;
}

body.home .hub-fab:hover {
  background: color-mix(in srgb, var(--home-primary, #8e1e23) 8%, #fff);
}

body.home .hub-fab .ra-dot {
  background: var(--home-primary, #8e1e23);
  box-shadow: none;
}

.dark body.home .hub-fab,
body.home.dark .hub-fab,
html.dark body.home .hub-fab {
  background: transparent;
  color: #f3f0eb;
  border-color: rgba(243, 240, 235, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

html.dark body.home .hub-fab .ra-dot {
  background: #f3f0eb;
}

@media (max-width: 640px) {
  body.home .hub-fab {
    width: 3rem;
    height: 3rem;
    padding: 0;
    box-shadow: 0 4px 14px rgba(26, 26, 26, 0.1);
  }

  html.dark body.home .hub-fab {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  }
}

/* Home chrome: brand red only (no navy/accent gradients) */
body.home .home-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--home-primary);
  color: #fff;
  font-family: var(--home-display);
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

body.home a:focus-visible,
body.home button:focus-visible {
  outline: 2px solid var(--home-primary);
  outline-offset: 2px;
}

/* ---- Home footer (aligned to 42rem axis) ---- */
.home-footer {
  padding: 2.25rem 0 3rem;
  background: var(--home-bg);
  border-top: 1px solid var(--home-line);
  color: var(--home-muted);
}

.home-footer__wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

.home-footer__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.home-footer__brand-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.home-footer__name {
  font-family: var(--home-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--home-ink);
}

.home-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.15rem;
}

.home-footer__nav a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--home-primary);
  text-decoration: none;
}

.home-footer__nav a:hover {
  text-decoration: underline;
}

.home-footer__soon {
  margin: 0 0 1.25rem;
  font-size: 0.82rem;
  color: var(--home-muted);
}

.home-footer__legal-wrap {
  margin: 0 0 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--home-line);
}

.home-footer__legal-sum {
  list-style: none;
  cursor: pointer;
  display: none;
  align-items: center;
  min-height: 44px;
  font-family: var(--home-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--home-ink);
}

.home-footer__legal-sum::-webkit-details-marker {
  display: none;
}

.home-footer__legal-sum::after {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-left: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.1rem) rotate(45deg);
  transition: transform 0.2s ease;
}

.home-footer__legal-wrap[open] > .home-footer__legal-sum::after {
  transform: translateY(0.15rem) rotate(-135deg);
}

.home-footer__legal {
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--home-muted);
}

.home-footer__legal p {
  margin: 0 0 0.45rem;
}

.home-footer__legal p:last-child {
  margin-bottom: 0;
}

.home-footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.78rem;
  color: var(--home-muted);
}

.home-footer__ver {
  opacity: 0.75;
}

@media (max-width: 640px) {
  .home-footer {
    padding: 1.75rem 0 calc(2.25rem + env(safe-area-inset-bottom, 0px));
  }

  .home-footer__brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-footer__soon {
    margin-bottom: 0.85rem;
    font-size: 0.78rem;
    opacity: 0.85;
  }

  .home-footer__legal-sum {
    display: flex;
  }

  .home-footer__legal-wrap {
    margin-bottom: 0.85rem;
  }

  .home-footer__legal-wrap:not([open]) .home-footer__legal {
    display: none;
  }

  .home-footer__legal-wrap[open] .home-footer__legal {
    margin-top: 0.35rem;
    padding-bottom: 0.25rem;
  }

  .home-footer__legal {
    font-size: 0.78rem;
    line-height: 1.7;
  }

  .home-footer__meta {
    padding-bottom: 0.25rem;
  }
}

/* ---- Motion 1: scroll reveal (paths / notices) ---- */
.home-reveal {
  opacity: 0;
  transform: translateY(1.1rem);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--home-reveal-delay, 0s);
  will-change: opacity, transform;
}

.home-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.home-paths__head.home-reveal {
  --home-reveal-delay: 0s;
}

.home-paths__entry.home-reveal:nth-child(1) { --home-reveal-delay: 0.05s; }
.home-paths__entry.home-reveal:nth-child(2) { --home-reveal-delay: 0.12s; }
.home-paths__entry.home-reveal:nth-child(3) { --home-reveal-delay: 0.19s; }
.home-paths__entry.home-reveal:nth-child(4) { --home-reveal-delay: 0.26s; }

.home-notices.home-reveal {
  --home-reveal-delay: 0.05s;
}

/* ---- Motion 2: hero curve stroke draw ---- */
.home-hero__curve-line--bt,
.home-hero__curve-line--et,
.home-hero__curve-line--ror {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: home-curve-draw 1.6s 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.home-hero__curve-line--et {
  animation-delay: 0.5s;
  animation-duration: 1.7s;
}

.home-hero__curve-line--ror {
  animation-delay: 0.65s;
  animation-duration: 1.8s;
}

@keyframes home-curve-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---- Motion 3: icon / primary link micro-feedback ---- */
.home-paths__icon {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s ease;
  color: var(--home-primary);
}

.home-paths__entry:hover .home-paths__icon {
  transform: translateY(-2px);
  color: var(--home-primary-hover);
}

.home-paths__primary span[aria-hidden="true"] {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-paths__primary:hover span[aria-hidden="true"] {
  transform: translateX(4px);
}

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

  .home-hero__curve-line--bt,
  .home-hero__curve-line--et,
  .home-hero__curve-line--ror {
    animation: none !important;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }

  .home-paths__icon,
  .home-paths__primary span[aria-hidden="true"] {
    transition: none !important;
  }

  .home-paths__entry:hover .home-paths__icon {
    transform: none;
  }

  .home-paths__primary:hover span[aria-hidden="true"] {
    transform: none;
  }
}
