/* ==============================================
   ART FOR SINNERS — Sanctuaire Profane
   Design Tokens (Primitive → Semantic → Component)
   + Custom Styles
   ============================================== */

/* --- PRIMITIVE TOKENS --- */
:root {
  --color-black-950: #0C0C0E;
  --color-black-900: #161619;
  --color-black-850: #1E1E23;
  --color-ivory-100: #E8E2D9;
  --color-stone-500: #8A8580;
  --color-blood-700: #8B1A1A;
  --color-gold-600: #B8973A;
  --color-white: #FFFFFF;

  --font-display: 'Bodoni Moda', 'Didot', 'Georgia', serif;
  --font-body: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-accent: 'Cormorant Garamond', 'Georgia', serif;

  --radius-none: 0;

  /* --- SEMANTIC TOKENS --- */
  --surface-primary: var(--color-black-950);
  --surface-elevated: var(--color-black-900);
  --surface-subtle: var(--color-black-850);
  --text-primary: var(--color-ivory-100);
  --text-muted: var(--color-stone-500);
  --accent-primary: var(--color-blood-700);
  --accent-secondary: var(--color-gold-600);
  --border-default: var(--color-black-850);
  --border-accent: var(--color-gold-600);

  /* --- COMPONENT TOKENS --- */
  --btn-primary-bg: var(--accent-primary);
  --btn-primary-text: var(--text-primary);
  --btn-primary-hover: #A12020;
  --nav-bg: transparent;
  --nav-bg-scrolled: var(--surface-elevated);
  --nav-text: var(--text-primary);
  --nav-active: var(--accent-secondary);
  --card-bg: var(--surface-elevated);
  --card-border: var(--border-default);
  --gallery-mask-border: var(--border-accent);
  --input-bg: var(--surface-subtle);
  --input-border: var(--border-default);
  --input-focus-border: var(--accent-secondary);
  --marquee-text: var(--text-muted);
}

/* --- BASE RESET --- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background-color: var(--surface-primary);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--surface-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent-primary);
  color: var(--text-primary);
}

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

/* --- FOCUS --- */
:focus-visible {
  outline: 2px solid var(--accent-secondary);
  outline-offset: 3px;
}

/* --- TYPOGRAPHY HELPERS --- */
.font-display {
  font-family: var(--font-display);
}

.font-accent {
  font-family: var(--font-accent);
}

.heading-upper {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 400;
  line-height: 1.1;
}

/* --- HEADER --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 2.5rem;
  transition: background-color 0.5s ease, padding 0.5s ease, backdrop-filter 0.5s ease;
  background-color: transparent;
}

.site-header.scrolled {
  background-color: rgba(22, 22, 25, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--surface-primary) 0%,
    rgba(12, 12, 14, 0.88) 25%,
    rgba(12, 12, 14, 0.6) 55%,
    rgba(12, 12, 14, 0.45) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

/* Letter-by-letter animation */
.hero-title .letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  animation: letterReveal 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.hero-title .letter-space {
  display: inline-block;
  width: 0.3em;
}

@keyframes letterReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- GOTHIC ARCH CLIP PATH --- */
.gothic-arch {
  clip-path: polygon(
    0% 100%, 0% 42%,
    1% 35%, 3% 29%, 6% 23%, 10% 18%, 15% 13%, 21% 9%, 28% 5.5%, 36% 3%, 43% 1%, 50% 0%,
    57% 1%, 64% 3%, 72% 5.5%, 79% 9%, 85% 13%, 90% 18%, 94% 23%, 97% 29%, 99% 35%, 100% 42%,
    100% 100%
  );
}

/* Gold glow border on arch via drop-shadow */
.arch-glow {
  filter: drop-shadow(0 0 1px var(--gallery-mask-border)) drop-shadow(0 0 1px var(--gallery-mask-border));
  transition: filter 0.5s ease;
}

.arch-glow:hover {
  filter: drop-shadow(0 0 2px var(--gallery-mask-border)) drop-shadow(0 0 4px rgba(184, 151, 58, 0.3));
}

/* Scroll-reveal inside arch: image slides up */
.arch-image-wrapper {
  overflow: hidden;
  position: relative;
}

.arch-image-wrapper img {
  transition: transform 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateY(25%);
}

.arch-image-wrapper.revealed img {
  transform: translateY(0);
}

/* --- GOLD DECORATIVE LINES --- */
.gold-line-v {
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--accent-secondary), transparent);
  margin: 0 auto;
}

.gold-line-h {
  height: 1px;
  width: 100%;
  background: linear-gradient(to right, transparent, var(--accent-secondary), transparent);
}

/* --- PORTFOLIO HORIZONTAL SCROLL --- */
.portfolio-scroll {
  display: flex;
  gap: 3rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 3rem 8vw;
  scrollbar-width: none;
}

.portfolio-scroll::-webkit-scrollbar {
  display: none;
}

.portfolio-item {
  flex: 0 0 auto;
  scroll-snap-align: center;
  position: relative;
  cursor: pointer;
}

/* Piece info overlay on hover */
.piece-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 1.5rem 1.5rem;
  background: linear-gradient(to top, rgba(12, 12, 14, 0.92) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
  clip-path: polygon(0% 100%, 0% 42%, 100% 42%, 100% 100%);
}

.portfolio-item:hover .piece-info,
.portfolio-item:focus-within .piece-info {
  opacity: 1;
}

/* --- MARQUEE --- */
.marquee-container {
  overflow: hidden;
  width: 100%;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 40s linear infinite;
}

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-track:hover {
  animation-play-state: paused;
}

/* --- PROCESS SECTION --- */
.process-step {
  position: relative;
}

.process-step::after {
  content: '';
  position: absolute;
  top: 24px;
  right: -1.5rem;
  width: 3rem;
  height: 1px;
  background: linear-gradient(to right, var(--accent-secondary), transparent);
}

.process-step:last-child::after {
  display: none;
}

/* --- SCROLL REVEAL --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Stagger children */
.stagger > * { transition-delay: calc(var(--i, 0) * 0.12s); }

/* --- MOBILE MENU --- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: rgba(12, 12, 14, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.mobile-menu[aria-hidden="false"] {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 1.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.mobile-menu a:hover,
.mobile-menu a:focus-visible {
  color: var(--accent-secondary);
}

/* --- CTA BUTTON --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 2rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--btn-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 26, 26, 0.3);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background-color: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 2rem;
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.btn-outline:hover {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
  transform: translateY(-2px);
}

/* --- HAMBURGER --- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  z-index: 201;
}

.hamburger span {
  display: block;
  height: 1.5px;
  width: 100%;
  background-color: var(--text-primary);
  transition: transform 0.35s ease, opacity 0.35s ease;
  transform-origin: center;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* --- ARCH DECORATIVE SHAPES (section dividers) --- */
.arch-divider {
  width: 40px;
  height: 56px;
  margin: 0 auto;
  clip-path: polygon(
    0% 100%, 0% 42%,
    6% 29%, 15% 18%, 28% 9%, 43% 3%, 50% 0%,
    57% 3%, 72% 9%, 85% 18%, 94% 29%, 100% 42%,
    100% 100%
  );
  border: 1px solid var(--accent-secondary);
  background: transparent;
}

/* Using outline via SVG instead */

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .portfolio-scroll { gap: 2rem; padding: 2rem 6vw; }
  .process-step::after { display: none; }
}

@media (max-width: 768px) {
  .site-header { padding: 1rem 1.25rem; }
  .site-header.scrolled { padding-top: 0.75rem; padding-bottom: 0.75rem; }
  .hamburger { display: flex; }
  .nav-links { display: none; }
  .portfolio-scroll { gap: 1.5rem; padding: 2rem 4vw; }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html { scroll-behavior: auto; }

  .reveal, .reveal-left, .reveal-right {
    opacity: 1;
    transform: none;
  }

  .hero-title .letter {
    opacity: 1;
    transform: none;
  }

  .arch-image-wrapper img {
    transform: none;
  }
}
