/* ============================================
   Nicole Ribeiro Designs — Editorial Aesthetic
   Refined, cinematic, architectural
   ============================================ */

:root {
  --bg: #0a0a0a;
  --bg-soft: #131110;
  --ink: #ede5d8;
  --ink-soft: #c4b9a8;
  --ink-mute: #8a7e6c;
  --metal-1: #d7d2c8;
  --metal-2: #a39989;
  --metal-3: #6b6358;
  --champagne: #c9b896;
  --champagne-soft: #9a8a6e;
  --line: rgba(237, 229, 216, 0.12);
  --line-strong: rgba(237, 229, 216, 0.28);

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: auto; /* JS smooth scroll handles this */ }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::selection { background: var(--champagne); color: var(--bg); }

/* ============================================
   LOADER
   ============================================ */
.loader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s var(--ease-out), visibility 0.8s;
}
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 2.5rem; padding: 2rem;
}

.loader-logo {
  width: 180px; height: auto;
  opacity: 0.95;
  filter: drop-shadow(0 0 24px rgba(201, 184, 150, 0.15));
}

.loader-progress {
  width: min(340px, 60vw); height: 1px;
  background: var(--line);
  overflow: hidden; position: relative;
}
.loader-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--metal-2), var(--metal-1), var(--metal-2));
  transition: width 0.3s var(--ease-out);
}

.loader-text {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.loader-text .pct { color: var(--metal-2); margin-left: 0.15em; }

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem 3rem;
  background: linear-gradient(180deg, rgba(10,10,10,0.6) 0%, transparent 100%);
  backdrop-filter: blur(0px);
  transition: backdrop-filter 0.4s, background 0.4s, padding 0.4s var(--ease-out);
}
.nav.scrolled {
  backdrop-filter: blur(20px) saturate(140%);
  background: rgba(10, 10, 10, 0.72);
  padding: 1rem 3rem;
  border-bottom: 1px solid var(--line);
}

.nav-brand img {
  height: 40px; width: auto;
  opacity: 0.95;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
}
.nav-brand:hover img { opacity: 1; transform: scale(1.03); }

.nav-links {
  display: flex; list-style: none; gap: 2.5rem;
  align-items: center;
}
.nav-links a {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 300;
  position: relative;
  padding: 0.4rem 0;
  transition: color 0.3s;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--champagne);
  transition: width 0.4s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--champagne); }
.nav-links a.active::after { width: 100%; background: var(--champagne); }

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 32px; height: 24px;
  flex-direction: column; justify-content: space-between;
  padding: 0;
}
.nav-toggle span {
  display: block; width: 100%; height: 1px;
  background: var(--ink); transition: transform 0.4s, opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

/* ============================================
   CANVAS BACKDROP
   ============================================ */
.canvas-wrap {
  position: fixed; inset: 0; z-index: 1;
  background: var(--bg);
  overflow: hidden;
}
#scene {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.45) 90%),
    linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 25%, transparent 70%, rgba(0,0,0,0.55) 100%);
}

.grain {
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.55'/></svg>");
  background-size: 200px;
}

/* ============================================
   SCROLL STAGE — content sections
   ============================================ */
.scroll-stage {
  position: relative; z-index: 2;
}

.scene {
  position: relative;
  min-height: 250vh;
  padding: 0 3rem;
}
.scene-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scene-spacer {
  height: 180vh;
}

/* ============================================
   HERO
   ============================================ */
.scene-hero {
  min-height: 100vh;
  align-items: center; justify-content: center;
  text-align: center;
  position: relative;
}
.scene-hero::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(10, 10, 10, 0.55) 0%, rgba(10, 10, 10, 0.25) 50%, transparent 80%);
  z-index: 0;
}
.hero-content {
  max-width: 900px;
  display: flex; flex-direction: column; align-items: center;
  gap: 2rem;
  opacity: 1;
  transition: opacity 0.6s var(--ease-out);
  position: relative;
  z-index: 1;
}

.hero-mark {
  margin-bottom: 0.5rem;
  animation: fadeUp 1.4s var(--ease-out) 0.2s backwards;
}
.hero-mark img {
  width: 280px; height: auto;
  filter: drop-shadow(0 0 60px rgba(201, 184, 150, 0.25)) drop-shadow(0 0 24px rgba(0, 0, 0, 0.4));
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.8rem, 6.5vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}
.hero-title .line {
  display: block;
  opacity: 0;
  animation: fadeUp 1.2s var(--ease-out) forwards;
}
.hero-title .line:nth-child(1) { animation-delay: 0.6s; }
.hero-title .line:nth-child(2) { animation-delay: 0.85s; }
.hero-title .italic {
  font-style: italic;
  color: var(--metal-1);
  background: linear-gradient(90deg, var(--metal-2) 0%, var(--metal-1) 50%, var(--metal-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0 0.25em 0.05em;
  display: inline-block;
}

.hero-sub {
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 300;
  margin-top: -0.5rem;
  opacity: 0;
  animation: fadeUp 1.2s var(--ease-out) 1.1s forwards;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.hero-contact {
  display: flex; align-items: center; gap: 2rem;
  flex-wrap: wrap; justify-content: center;
  margin-top: 1.5rem;
  padding: 1.5rem 2.5rem;
  background: rgba(10, 10, 10, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  opacity: 0;
  animation: fadeUp 1.2s var(--ease-out) 1.4s forwards;
}
.hero-contact-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.4rem;
  transition: transform 0.4s var(--ease-out);
}
.hero-contact-item:hover { transform: translateY(-2px); }
.hero-contact-item .label {
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--champagne);
}
.hero-contact-item .value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.hero-divider {
  width: 1px; height: 32px;
  background: var(--line-strong);
}

.scroll-hint {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.8rem;
  margin-top: 2.5rem;
  opacity: 0;
  animation: fadeUp 1.2s var(--ease-out) 1.7s forwards;
}
.scroll-hint-text {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.scroll-hint-line {
  width: 1px; height: 60px;
  background: linear-gradient(180deg, var(--ink-mute), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-hint-line::before {
  content: '';
  position: absolute; top: -100%; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, transparent, var(--champagne));
  animation: scrollLine 2.2s var(--ease-in-out) infinite;
}

@keyframes scrollLine {
  0% { transform: translateY(0); }
  100% { transform: translateY(400%); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   CONTENT BLOCKS (over canvas)
   ============================================ */
.content-block {
  position: sticky;
  top: 50vh;
  transform: translateY(-50%);
  max-width: 620px;
  padding: 3rem 3.5rem;
  background: rgba(10, 10, 10, 0.62);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--line);
  opacity: 0;
  transition: opacity 1s var(--ease-out);
}
.content-block.in-view {
  opacity: 1;
}

/* Decorative corner accents */
.content-block::before,
.content-block::after {
  content: '';
  position: absolute;
  width: 28px; height: 28px;
  border: 1px solid var(--metal-2);
  opacity: 0.65;
}
.content-block::before {
  top: -1px; left: -1px;
  border-right: none; border-bottom: none;
}
.content-block::after {
  bottom: -1px; right: -1px;
  border-left: none; border-top: none;
}

.content-block-left { margin-right: auto; margin-left: 4vw; }
.content-block-right { margin-left: auto; margin-right: 4vw; }
.content-block-center { margin-left: auto; margin-right: auto; max-width: 760px; text-align: center; }

.section-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--champagne);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: 2rem;
  color: var(--ink);
}
.section-title span {
  display: block;
}
.section-title .italic {
  font-style: italic;
  background: linear-gradient(90deg, var(--metal-2), var(--metal-1) 50%, var(--metal-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0 0.25em 0.05em;
  display: inline-block;
}

.section-body p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}

.section-quote {
  margin-top: 2rem !important;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem !important;
  line-height: 1.55 !important;
  color: var(--ink) !important;
}

.section-intro {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

/* ============================================
   SERVICES GRID
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.service-card {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  transition: transform 0.5s var(--ease-out);
}
.service-card:hover { transform: translateX(4px); }

.service-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--champagne);
  display: block;
  margin-bottom: 0.5rem;
}
.service-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.service-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-mute);
}

/* ============================================
   PROJECTS PREVIEW
   ============================================ */
.projects-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 2.5rem 0;
  text-align: left;
}
.category {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.category h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--champagne);
  margin-bottom: 0.6rem;
  font-style: italic;
}
.category p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-mute);
}

/* ============================================
   CTA LINK
   ============================================ */
.cta-link {
  display: inline-flex; align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0.9rem 0;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  transition: gap 0.4s var(--ease-out), color 0.3s, border-color 0.3s;
}
.cta-link:hover {
  gap: 1.6rem;
  color: var(--champagne);
  border-color: var(--champagne);
}
.cta-link svg {
  width: 40px; height: 12px;
  transition: transform 0.4s var(--ease-out);
}

/* ============================================
   CONTACT
   ============================================ */
.contact-details {
  display: flex; flex-direction: column;
  gap: 1.25rem;
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.contact-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 1.5rem;
}
.contact-label {
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.contact-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: 0.02em;
  transition: color 0.3s;
}
a.contact-value:hover { color: var(--champagne); }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  position: relative; z-index: 3;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 4rem 3rem 1.5rem;
  margin-top: 0;
}
.footer-inner {
  max-width: 1400px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--line);
}
.footer-brand {
  display: flex; flex-direction: column; gap: 1.5rem;
}
.footer-brand img { width: 80px; height: auto; }
.footer-brand p {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink);
  line-height: 1.4;
}
.footer-brand p span {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-style: normal;
  display: inline-block;
  margin-top: 0.4rem;
}

.footer h4 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--champagne);
  margin-bottom: 1.5rem;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 0.75rem; }
.footer ul a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  transition: color 0.3s, padding-left 0.4s var(--ease-out);
  display: inline-block;
}
.footer ul a:hover {
  color: var(--ink);
  padding-left: 6px;
}

.footer-cta {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.8rem 1.5rem;
  border: 1px solid var(--metal-2);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink) !important;
  transition: background 0.4s, color 0.4s, transform 0.4s var(--ease-out);
}
.footer-cta:hover {
  background: var(--ink);
  color: var(--bg) !important;
  transform: translateY(-2px);
  padding-left: 1.5rem !important;
}

.footer-bottom {
  max-width: 1400px; margin: 0 auto;
  padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.78rem;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
}
.footer-credit {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-soft);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .nav { padding: 1.25rem 1.5rem; }
  .nav.scrolled { padding: 0.85rem 1.5rem; }
  .scene { padding: 4rem 1.5rem; }
  .content-block { padding: 2.5rem 2rem; }
  .content-block-left, .content-block-right { margin: 0 auto; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed; top: 0; right: -100%;
    flex-direction: column;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(24px);
    width: 100%; height: 100vh;
    justify-content: center;
    gap: 2.5rem;
    transition: right 0.5s var(--ease-out);
    border-left: 1px solid var(--line);
    z-index: 100;
  }
  .nav-links.open { right: 0; }
  .nav-links a { font-size: 1rem; }
  .nav-toggle { display: flex; z-index: 101; }
  .nav { padding: 1rem 1.25rem; }
  .nav.scrolled { padding: 0.75rem 1.25rem; }

  .scene { padding: 0 1rem; min-height: 200vh; }
  .scene-hero { min-height: 100vh; padding: 4rem 1rem; }
  .scene-spacer { height: 130vh; }

  .hero-mark img { width: 200px; }
  .hero-contact { flex-direction: column; gap: 1.25rem; padding: 1.25rem 1.5rem; }
  .hero-divider { width: 80px; height: 1px; }

  .content-block {
    padding: 2rem 1.5rem;
    max-width: 92vw;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .services-grid { grid-template-columns: 1fr; gap: 0.5rem; }
  .projects-categories { grid-template-columns: 1fr; gap: 1.25rem; }

  .footer { padding: 3rem 1.25rem 1.25rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 2.5rem; padding-bottom: 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}

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