/* ════════════════════════════════════════════════════
   NISHAM PORTFOLIO — style.css
   Premium Editorial Vintage — Scandinavian Studio
   Warm paper tones · Serif typography · Analog textures
════════════════════════════════════════════════════ */

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

html {
  scroll-behavior: auto;
  font-size: 16px;
}

/* ─── CSS DESIGN TOKENS ─── */
:root {
  /* Warm paper palette */
  --cream:       #f5f0e8;
  --ivory:       #ede7d9;
  --parchment:   #e4dccf;
  --warm-beige:  #d4c9b8;
  --sand:        #c8bca8;
  --faded-tan:   #b8a99a;
  --warm-brown:  #8c7b6e;
  --deep-brown:  #5c4f44;
  --ink:         #2c2420;
  --ink-light:   #3d3330;
  --charcoal:    #4a413c;

  /* Backgrounds */
  --bg-primary:  #f2ece0;
  --bg-warm:     #ede6d6;
  --bg-deeper:   #e5ddd0;
  --bg-section:  #efe8d8;
  --bg-alt:      #e8dfd0;

  /* Text tones */
  --text-ink:    #2c2420;
  --text-body:   #4a413c;
  --text-muted:  #8c7b6e;
  --text-faint:  #b8a99a;

  /* Accent — aged copper/bronze */
  --accent:      #8b6914;
  --accent-warm: #a07830;
  --accent-pale: #c49a45;

  /* Typography */
  --font-serif:  'Cormorant Garamond', 'EB Garamond', 'Libre Baskerville', Georgia, serif;
  --font-body:   'DM Sans', system-ui, sans-serif;
  --font-display: 'Cormorant', 'Cormorant Garamond', Georgia, serif;

  /* Spacing rhythm */
  --space-xs:    8px;
  --space-s:     16px;
  --space-m:     32px;
  --space-l:     64px;
  --space-xl:    120px;
  --space-2xl:   180px;

  /* Easing */
  --ease-editorial: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-slow:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:        cubic-bezier(0.4, 0, 1, 1);

  /* Border tokens */
  --rule-thin:   rgba(92, 79, 68, 0.15);
  --rule-medium: rgba(92, 79, 68, 0.25);
  --rule-thick:  rgba(44, 36, 32, 0.7);
}

/* ─── BODY ─── */
body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-ink);
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Subtle warm paper texture via CSS */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)' opacity='0.04'/%3E%3C/svg%3E");
}

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

/* ─── FILM GRAIN & PAPER TEXTURE OVERLAYS ─── */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='0.18'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.paper-texture {
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  opacity: 0.06;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(92, 79, 68, 0.08) 2px,
      rgba(92, 79, 68, 0.08) 3px
    );
}

.vignette-overlay {
  position: fixed;
  inset: 0;
  z-index: 9996;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(26, 18, 12, 0.22) 100%
  );
}

/* ─── CUSTOM CURSOR ─── */
.cursor {
  width: 8px;
  height: 8px;
  background: var(--ink);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  z-index: 10001;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-slow), height 0.3s var(--ease-slow), background 0.3s;
  mix-blend-mode: multiply;
}

.cursor-follower {
  width: 32px;
  height: 32px;
  border: 1px solid var(--warm-brown);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  z-index: 10000;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.15s var(--ease-slow), width 0.3s, height 0.3s, opacity 0.3s;
  opacity: 0.6;
}

/* ─── NAVBAR ─── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  opacity: 0;
  animation: navFadeIn 1.2s 0.6s var(--ease-slow) forwards;
}

@keyframes navFadeIn { to { opacity: 1; } }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  background: rgba(242, 236, 224, 0.92);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border-bottom: 1px solid var(--rule-thin);
}

.nav-logo {
  display: flex;
  flex-direction: column;
  gap: 1px;
  cursor: none;
}

.nav-logo-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1;
}

.nav-logo-sub {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-center-rule {
  flex: 1;
  height: 1px;
  background: var(--rule-thin);
  margin: 0 40px;
  max-width: 200px;
}

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

.nav-link {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s;
  cursor: none;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-slow);
}

.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--rule-medium);
  padding: 10px 20px;
  transition: all 0.4s var(--ease-slow);
  cursor: none;
}

.nav-cta:hover {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.cta-arrow {
  font-size: 0.9rem;
  transition: transform 0.3s;
}

.nav-cta:hover .cta-arrow { transform: translate(2px, -2px); }

/* ─── BUTTONS ─── */
.btn-editorial {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: none;
  transition: all 0.4s var(--ease-slow);
  position: relative;
  overflow: hidden;
}

.btn-editorial::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.4s var(--ease-slow);
}

.btn-editorial:hover { color: var(--cream); }
.btn-editorial:hover::before { transform: translateY(0); }
.btn-editorial span { position: relative; z-index: 1; }

.btn-editorial-filled {
  background: var(--ink);
  color: var(--cream);
}

.btn-editorial-filled::before { background: var(--deep-brown); }

.btn-arrow { font-size: 1rem; }
.full-width { width: 100%; justify-content: center; }

/* ─── SCROLL SEQUENCE ─── */
.scroll-sequence {
  height: 500vh;
  position: relative;
}

.sticky-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--bg-warm);
}

#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.35;
}

/* ─── PHASES ─── */
.phase {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.phase-content {
  position: relative;
  z-index: 5;
  max-width: 960px;
  padding: 0 60px;
}

.center-content { text-align: center; margin: 0 auto; }
.right-content   { margin-left: auto; text-align: right; }
.left-content    { margin-right: auto; text-align: left; }

.phase-kicker {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
  display: block;
}

.phase-headline {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.08;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

.phase-headline em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}

.phase-sub {
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.9;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.phase-pullquote {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 20px;
}

.phase-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  font-size: 0.8rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

/* ─── HERO PHASE ─── */
#phase-hero {
  background: linear-gradient(160deg, var(--ivory) 0%, var(--parchment) 50%, var(--warm-beige) 100%);
}

.hero-paper-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 25% 35%, rgba(185, 160, 110, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 70%, rgba(140, 110, 70, 0.08) 0%, transparent 50%);
}

.hero-masthead {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  justify-content: center;
}

.masthead-rule {
  flex: 1;
  height: 1px;
  background: var(--rule-medium);
  max-width: 80px;
}

.masthead-label {
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 7.5rem);
  line-height: 0.98;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 36px;
  text-align: center;
}

.hero-headline .line { display: block; }
.hero-headline .italic { font-style: italic; color: var(--accent); }

.hero-dek {
  text-align: center;
  margin-bottom: 44px;
}

.hero-dek p {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

.hero-footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.hero-scroll-hint {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero-reel-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-medium);
  padding-bottom: 3px;
  cursor: none;
  transition: letter-spacing 0.4s var(--ease-slow), border-color 0.3s;
}

.hero-reel-link:hover {
  letter-spacing: 0.26em;
  border-color: var(--ink);
}

.reel-icon {
  font-size: 0.6rem;
  color: var(--accent);
}

/* Decorative side elements */
.hero-side-text {
  position: absolute;
  left: 48px;
  bottom: 80px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  z-index: 4;
}

.hero-folio {
  position: absolute;
  right: 48px;
  bottom: 80px;
  z-index: 4;
}

.folio-number {
  font-family: var(--font-serif);
  font-size: 0.65rem;
  color: var(--text-faint);
  letter-spacing: 0.14em;
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
}

.scroll-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, transparent, var(--warm-brown), transparent);
  margin: 0 auto;
  animation: scrollPulse 2.5s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.25; transform: scaleY(0.8); }
  50%       { opacity: 0.8;  transform: scaleY(1); }
}

/* ─── AWAKEN PHASE ─── */
#phase-awaken {
  background: linear-gradient(150deg, var(--parchment) 0%, var(--ivory) 100%);
}

.editorial-grid-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.eg-line {
  position: absolute;
  background: var(--rule-thin);
}

.eg-line.h { width: 100%; height: 1px; top: 50%; }
.eg-line.v { height: 100%; width: 1px; left: 50%; }

/* ─── WEB PHASE ─── */
#phase-web {
  background: linear-gradient(140deg, var(--ivory) 0%, var(--parchment) 100%);
}

.editorial-spread {
  position: absolute;
  left: 5%;
  top: 50%;
  transform: translateY(-50%);
  width: 44%;
  z-index: 3;
}

.spread-image-col { display: flex; flex-direction: column; gap: 24px; }

.spread-img-frame {
  border: 1px solid var(--rule-medium);
  padding: 0;
  position: relative;
}

.spread-img-inner {
  padding: 28px;
  background: rgba(44, 36, 32, 0.04);
  border-bottom: 1px solid var(--rule-thin);
}

.code-visual {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  line-height: 1.9;
  color: var(--text-body);
}

.ev-line { display: block; }
.ev-indent { padding-left: 20px; }
.ev-key { color: var(--accent); }
.ev-var { color: var(--ink); font-style: italic; }
.ev-str { color: var(--warm-brown); }
.ev-val { color: var(--deep-brown); }
.ev-op  { color: var(--text-muted); }

.frame-caption {
  padding: 10px 16px;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.spread-tech-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tech-item {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--rule-thin);
  padding-bottom: 6px;
}

/* ─── BRAND PHASE ─── */
#phase-brand {
  background: linear-gradient(160deg, var(--parchment) 0%, var(--warm-beige) 100%);
}

.brand-editorial {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.be-monogram {
  font-family: var(--font-display);
  font-size: 7rem;
  font-weight: 300;
  color: transparent;
  -webkit-text-stroke: 1px rgba(92, 79, 68, 0.35);
  line-height: 1;
  letter-spacing: -0.04em;
}

.be-rings {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.be-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--rule-thin);
  animation: ringRotate 20s linear infinite;
}

.be-ring.r1 { width: 240px; height: 240px; animation-duration: 22s; }
.be-ring.r2 { width: 160px; height: 160px; animation-duration: 15s; animation-direction: reverse; }
.be-ring.r3 { width: 80px;  height: 80px;  animation-duration: 10s; border-color: var(--rule-medium); }

@keyframes ringRotate { to { transform: rotate(360deg); } }

.be-caption {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ─── MARKETING PHASE ─── */
#phase-marketing {
  background: linear-gradient(150deg, var(--ivory) 0%, var(--parchment) 100%);
}

.data-editorial {
  position: absolute;
  left: 6%;
  top: 50%;
  transform: translateY(-50%);
  width: 42%;
  z-index: 3;
}

.de-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  padding: 20px;
  background: rgba(44, 36, 32, 0.03);
  border: 1px solid var(--rule-thin);
  border-bottom: 2px solid var(--rule-thick);
  margin-bottom: 20px;
}

.de-bar {
  flex: 1;
  height: var(--h);
  background: linear-gradient(to top, var(--deep-brown), var(--warm-brown));
  position: relative;
  min-height: 16px;
  opacity: 0.7;
}

.de-bar span {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}

.de-metrics {
  display: flex;
  gap: 16px;
}

.de-metric {
  flex: 1;
  padding: 14px;
  border: 1px solid var(--rule-thin);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dm-val {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--ink);
}

.dm-label {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── REVEAL PHASE ─── */
#phase-reveal {
  background: linear-gradient(160deg, var(--parchment) 0%, var(--ivory) 50%, var(--cream) 100%);
}

.reveal-editorial {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.re-ornament {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.re-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--rule-thin);
}

.re-ring.r1 { width: 560px; height: 560px; animation: ringRotate 30s linear infinite; }
.re-ring.r2 { width: 340px; height: 340px; animation: ringRotate 20s linear infinite reverse; border-color: var(--rule-medium); }

.reveal-edition {
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 20px;
}

.reveal-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 300;
  color: var(--ink);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.reveal-tagline {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.reveal-rule {
  width: 60px;
  height: 1px;
  background: var(--rule-medium);
  margin: 0 auto 40px;
}

.reveal-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
}
