/* =========================================================================
   layout.css — header, hero, section frames, menu stage, footer
   ========================================================================= */

/* ---------- header ------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(212, 160, 23, 0.12);
  background: rgba(4, 4, 4, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--header-h);
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  flex: none;
}

.brand-mark {
  display: block;
  height: 2rem;
  width: auto;
  aspect-ratio: 1400 / 490;
  background: url("../img/corex-logo.webp") center / contain no-repeat;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.nav a:hover {
  color: var(--fg);
  background: rgba(212, 160, 23, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg);
  cursor: pointer;
}

@media (max-width: 767px) {
  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 60;
    flex-direction: column;
    align-items: stretch;
    gap: 0.125rem;
    padding: 0.75rem var(--gutter) 1rem;
    border-bottom: 1px solid var(--line-gold);
    background: #08080a;
    box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.9);
    display: none;
  }

  .nav[data-open] {
    display: flex;
  }

  .nav a {
    padding: 0.7rem 0.75rem;
    font-size: 0.95rem;
  }

  .nav a:hover {
    background: rgba(212, 160, 23, 0.1);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .header-actions .btn--ghost {
    display: none;
  }
}

/* ---------- hero --------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.hero-bg .aurora--a {
  left: 50%;
  top: -20%;
  width: 900px;
  height: 900px;
  transform: translateX(-50%);
}

.hero-bg .aurora--b {
  left: 10%;
  top: 20%;
  width: 700px;
  height: 700px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: var(--page);
  margin-inline: auto;
  padding: 2.5rem var(--gutter) 5rem;
  text-align: center;
}

@media (min-width: 640px) {
  .hero-inner {
    padding-top: 3.5rem;
  }
}

.hero-title {
  margin-top: 2rem;
  max-width: 48rem;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 1rem + 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.hero-title span {
  display: block;
}

.hero-title em {
  display: block;
  font-style: italic;
  background: linear-gradient(180deg, #ffffff 6%, var(--gold-200) 52%, var(--gold-400) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin-top: 1.25rem;
  max-width: 36rem;
  font-size: 1rem;
  color: var(--muted);
}

@media (min-width: 640px) {
  .hero-sub {
    font-size: 1.125rem;
  }
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

@media (min-width: 640px) {
  .hero-actions {
    flex-direction: row;
  }
}

.hero-pill {
  margin-top: 4rem;
}

/* ---------- 3D logo ------------------------------------------------------ */
@property --rx {
  syntax: "<angle>";
  inherits: true;
  initial-value: 0deg;
}

@property --ry {
  syntax: "<angle>";
  inherits: true;
  initial-value: 0deg;
}

@property --px {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}

@property --py {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}

.logo3d-enter {
  width: 100%;
  max-width: min(760px, 92vw);
  margin-inline: auto;
  animation: logo-enter 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.logo-card {
  position: relative;
  perspective: 1100px;
  animation: card-idle 8s ease-in-out infinite;
  transition:
    --rx 0.6s ease,
    --ry 0.6s ease,
    --px 0.6s ease,
    --py 0.6s ease;
}

.logo-card[data-active] {
  animation: none;
  transition:
    --rx 0.15s ease-out,
    --ry 0.15s ease-out,
    --px 0.15s ease-out,
    --py 0.15s ease-out;
}

.logo3d-float {
  transform-style: preserve-3d;
  animation: logo-float 6s ease-in-out infinite;
}

.logo-card-tilt {
  position: relative;
  aspect-ratio: 1400 / 490;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  will-change: transform;
}

.logo3d-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: url("../img/corex-side.webp") center / contain no-repeat;
  transform: translateZ(calc(var(--z) * 1px));
}

.logo3d-face {
  background-image: url("../img/corex-logo.webp");
}

.logo-card-foil,
.logo-card-glare {
  -webkit-mask: url("../img/corex-logo.webp") center / contain no-repeat;
  mask: url("../img/corex-logo.webp") center / contain no-repeat;
}

.logo-card-foil {
  background: repeating-linear-gradient(
      115deg,
      #ffdf8a 0%,
      #fff8e6 7%,
      #e9bb54 14%,
      #ffffff 21%,
      #ffd77a 28%,
      #ffdf8a 35%
    )
    0 0 / 260% 260%;
  background-position: var(--px) var(--py);
  mix-blend-mode: color-dodge;
  opacity: 0.28;
}

.logo-card-glare {
  background: radial-gradient(
    circle at var(--px) var(--py),
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 236, 190, 0.35) 18%,
    transparent 48%
  );
  mix-blend-mode: overlay;
}

.logo-card-shadow {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -2.5rem;
  height: 2.5rem;
  pointer-events: none;
  filter: blur(20px);
  transform: translateX(calc((var(--px) - 50%) * 0.25));
  background: radial-gradient(50% 50%, rgba(212, 160, 23, 0.6), transparent 70%);
}

/* ---------- section header block ---------------------------------------- */
.section-head {
  max-width: 42rem;
  margin-inline: auto;
  text-align: center;
}

.section-head .rule-glow {
  max-width: 28rem;
  margin: 0 auto 2.5rem;
}

.section-head .section-sub {
  margin-inline: auto;
}

/* ---------- footer ------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid rgba(212, 160, 23, 0.12);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: var(--page);
  margin-inline: auto;
  padding: 2.5rem var(--gutter);
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-brand {
  height: 1.75rem;
  width: auto;
  aspect-ratio: 1400 / 490;
  background: url("../img/corex-logo.webp") center / contain no-repeat;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-nav a:hover {
  color: var(--fg);
}

.footer-legal {
  border-top: 1px solid var(--line-soft);
}

.footer-legal p {
  max-width: var(--page);
  margin-inline: auto;
  padding: 1.25rem var(--gutter) 2rem;
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--dim);
}

/* ---------- page shell --------------------------------------------------- */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
