/* ============================================================
   R.VILAR KNIVES — MAIN STYLESHEET
   Design System: "THE FORGE"
   ============================================================ */

/* ---- GOOGLE FONTS ---- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&family=DM+Mono:wght@300;400;500&family=Pinyon+Script&display=swap');

/* ---- DESIGN TOKENS ---- */
:root {
  --bg:           #0A0A0A;
  --surface:      #111111;
  --surface-2:    #1A1A1A;
  --steel:        #B8C4CE;
  --steel-dim:    #6B7B87;
  --ember:        #C9A84C;
  --ember-light:  #E2C97A;
  --white:        #F5F5F5;
  --divider:      #2A2A2A;
  --light-bg:     #FFFFFF;
  --light-surface:#FFFFFF;
  --text-dark:    #1A1A1A;
  --text-dark-dim:#5A5A5A;

  --font-brand:   'Cinzel', serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --font-hero:    'Monotype Corsiva', 'Pinyon Script', cursive;

  --ease-blade:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:     cubic-bezier(0.25, 0, 0, 1);

  --nav-height:   56px;
  --max-w:        1440px;
}

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

html {
  font-size: 16px;
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--steel);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

/* ---- NAVIGATION ---- */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--divider);
  z-index: 1000;
  transition: transform 0.4s var(--ease-blade);
}

#nav.nav-hidden {
  transform: translateY(-100%);
}

/* .scrolled is now a no-op — nav is always dark from the base style */

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
}

.nav-logo-text {
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--white);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--ember);
  transition: width 0.3s var(--ease-blade);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px; height: 1px;
  background: var(--steel);
  transition: transform 0.35s var(--ease-blade), opacity 0.3s ease, width 0.3s ease;
  transform-origin: center;
}

/* Hamburger → X when menu is open */
body.menu-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
body.menu-open .nav-toggle span:nth-child(2) {
  opacity: 0;
  width: 0;
}
body.menu-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile menu */
#mobile-menu {
  position: fixed;
  top: 0; right: -100%;
  width: 280px; height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--divider);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 40px;
  transition: right 0.4s var(--ease-blade);
}

#mobile-menu.open {
  right: 0;
}

#mobile-menu .nav-links {
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

#mobile-menu .nav-links a {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  color: var(--white);
}

#mobile-menu .nav-links .mobile-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ember);
  flex-shrink: 0;
}

#mobile-menu .nav-links .mobile-link-icon svg {
  width: 21px;
  height: 21px;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.menu-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 768px) {
  #nav {
    padding: 0 24px;
  }
  .nav-links:not(#mobile-menu .nav-links) {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
}

/* ---- FOOTER ---- */
#footer {
  background: #181818;
  border-top: 1px solid #2E2E2E;
  padding: 64px 40px 32px;
}

.footer-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--divider);
}

.footer-brand .logo-text {
  font-family: var(--font-brand);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--white);
  margin-bottom: 10px;
}

.footer-brand p {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--steel-dim);
  text-transform: uppercase;
}

.footer-social {
  display: flex;
  gap: 14px;
  margin-top: 16px;
}

.footer-social a {
  color: var(--steel-dim);
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.footer-social a:hover {
  color: var(--ember);
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 20px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col ul a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--steel);
  transition: color 0.2s ease;
}

.footer-col ul a:hover {
  color: var(--white);
}

.footer-col ul a .footer-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ember);
  flex-shrink: 0;
}

.footer-col ul a .footer-link-icon svg {
  width: 16px;
  height: 16px;
}

.footer-col p {
  font-size: 13px;
  color: var(--steel);
  line-height: 1.8;
}

.footer-col p a {
  color: var(--steel);
  transition: color 0.2s ease;
}

.footer-col p a:hover {
  color: var(--ember);
}

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

.footer-bottom p {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--steel-dim);
  text-transform: uppercase;
}

@media (max-width: 768px) {
  #footer { padding: 48px 24px 24px; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ---- UTILITY CLASSES ---- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
}

.ember { color: var(--ember); }
.mono  { font-family: var(--font-mono); }
.brand { font-family: var(--font-brand); }

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember);
  display: block;
  margin-bottom: 16px;
}

/* ---- CTA BUTTON ---- */
.btn-ember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ember);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 0;
  border: 1px solid var(--ember);
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn-ember::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ember-light);
  transform: translateX(-100%);
  transition: transform 0.4s var(--ease-blade);
}

.btn-ember:hover::before {
  transform: translateX(0);
}

.btn-ember span {
  position: relative;
  z-index: 1;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 13px 28px;
  border: 1px solid var(--divider);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.btn-ghost:hover {
  border-color: var(--ember);
  color: var(--ember);
}

/* ---- BACK TO TOP ---- */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  background: var(--ember);
  border: none;
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s var(--ease-blade), transform 0.35s var(--ease-blade), background 0.25s ease;
  pointer-events: none;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#back-to-top:hover {
  background: var(--ember-light);
}

@media (hover: none) {
  #back-to-top { cursor: pointer; }
}

@media (max-width: 768px) {
  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* ---- PAGE TRANSITION OVERLAY ---- */
#page-transition {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9000;
  pointer-events: none;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.55s var(--ease-blade);
}

#page-transition.slide-in {
  clip-path: inset(0 0% 0 0);
  pointer-events: all;
}

#page-transition.slide-out {
  clip-path: inset(0 0 0 100%);
  transition: clip-path 0.45s var(--ease-blade);
}
