/* ============================================================
   ARCHAN NAIR — SHARED STYLES
   Cream theme for main pages · Dark theme for experiments
============================================================ */

:root {
  /* Cream palette (main site) */
  --cream: #efe5d0;
  --cream-deep: #e8dcc2;
  --cream-soft: #f4ebd8;
  --ink: #1a1612;
  --ink-soft: #3d342a;
  --muted: rgba(26,22,18,0.55);
  --muted-light: rgba(26,22,18,0.35);
  --border: rgba(26,22,18,0.12);
  --border-soft: rgba(26,22,18,0.06);
  --gold: #9c7a3a;
  --gold-bright: #b8964a;
  --gold-dim: rgba(156,122,58,0.25);

  /* Dark palette (experiments) */
  --dark-bg: #0a0a0a;
  --dark-surface: #111111;
  --dark-border: rgba(255,255,255,0.08);
  --dark-text: #f0ece4;
  --dark-muted: rgba(240,236,228,0.45);

  /* Typography scale */
  --f-display: 'Fraunces', 'Cormorant Garamond', serif;
  --f-body: 'Tenor Sans', sans-serif;
  --f-mono: 'Space Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  letter-spacing: 0.01em;
}

body.dark {
  background: var(--dark-bg);
  color: var(--dark-text);
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.4;
}

body.dark::before {
  mix-blend-mode: normal;
  opacity: 0.35;
}

/* ==================== NAVIGATION ==================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.3s;
}

.nav.scrolled {
  background: rgba(239,229,208,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 18px 40px;
  border-bottom: 1px solid var(--border-soft);
}

body.dark .nav.scrolled {
  background: rgba(10,10,10,0.85);
  border-bottom: 1px solid var(--dark-border);
}

.nav-logo {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
}

body.dark .nav-logo { color: var(--dark-text); }

.nav-logo em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}

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

.nav-links a {
  font-family: var(--f-body);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}

body.dark .nav-links a { color: var(--dark-text); }

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform 0.3s;
}

body.dark .nav-toggle span { background: var(--dark-text); }

@media (max-width: 768px) {
  .nav { padding: 20px 20px; }
  .nav.scrolled { padding: 14px 20px; }
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--cream-soft);
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    transition: right 0.4s cubic-bezier(0.65, 0, 0.35, 1);
    gap: 28px;
  }
  body.dark .nav-links { background: var(--dark-surface); }
  .nav-links.open { right: 0; }
  .nav-toggle { display: block; z-index: 60; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { transform: translateY(-6px) rotate(-45deg); }
}

/* ==================== TYPOGRAPHY ==================== */

.eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
  display: inline-block;
}

.display-xl {
  font-family: var(--f-display);
  font-size: clamp(56px, 12vw, 180px);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--ink);
}

body.dark .display-xl { color: var(--dark-text); }

.display-xl em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}

.display-lg {
  font-family: var(--f-display);
  font-size: clamp(42px, 7vw, 96px);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.display-lg em { font-style: italic; color: var(--gold); }

.display-md {
  font-family: var(--f-display);
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.005em;
}

.display-md em { font-style: italic; color: var(--gold); }

.body-large {
  font-family: var(--f-display);
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: 0.005em;
  color: var(--ink-soft);
}

body.dark .body-large { color: var(--dark-text); opacity: 0.92; }

.body-text {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.body-text p { margin-bottom: 20px; }

.caption {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ==================== LAYOUT ==================== */

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
}

.container-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 40px;
}

.container-medium {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px;
}

section {
  padding: 120px 0;
  position: relative;
}

.divider-line {
  width: 1px;
  height: 60px;
  background: var(--border);
  margin: 0 auto;
}

body.dark .divider-line { background: var(--dark-border); }

.divider-dot {
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .container, .container-narrow, .container-medium { padding: 0 20px; }
  section { padding: 80px 0; }
}

/* ==================== BUTTONS ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  font-family: var(--f-body);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.65, 0, 0.35, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: -1;
}

.btn:hover {
  color: var(--cream);
  border-color: var(--ink);
}

.btn:hover::before { transform: translateY(0); }

.btn.gold {
  border-color: var(--gold);
  color: var(--gold);
}

.btn.gold::before { background: var(--gold); }
.btn.gold:hover { color: var(--cream); }

.btn.dark {
  border-color: var(--dark-text);
  color: var(--dark-text);
}
.btn.dark::before { background: var(--dark-text); }
.btn.dark:hover { color: var(--dark-bg); }

/* ==================== GLYPH ==================== */

.glyph {
  display: inline-block;
}

.glyph-lg {
  width: 80px;
  height: 120px;
}

/* ==================== SCROLL REVEAL ==================== */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ==================== FOOTER ==================== */

footer {
  padding: 80px 40px 40px;
  border-top: 1px solid var(--border);
  margin-top: 80px;
}

body.dark footer { border-top: 1px solid var(--dark-border); }

.footer-grid {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

@media (max-width: 768px) {
  footer { padding: 60px 20px 30px; }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

.footer-brand {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.footer-brand em { font-style: italic; color: var(--gold); }

.footer-tagline {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.6;
}

.footer-heading {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.footer-list {
  list-style: none;
}

.footer-list li { margin-bottom: 10px; }

.footer-list a {
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.02em;
}

body.dark .footer-list a { color: var(--dark-text); }

.footer-list a:hover { color: var(--gold); }

.footer-bottom {
  max-width: 1440px;
  margin: 0 auto;
  padding-top: 30px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

body.dark .footer-bottom { border-top: 1px solid var(--dark-border); }

.footer-copy {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ==================== UTILITIES ==================== */

.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.italic { font-style: italic; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mt-12 { margin-top: 48px; }
.mt-16 { margin-top: 64px; }

/* Image loading states */
.img-fade {
  opacity: 0;
  transition: opacity 0.8s ease;
}
.img-fade.loaded { opacity: 1; }

/* Selection */
::selection {
  background: var(--gold);
  color: var(--cream);
}

body.dark ::selection {
  background: var(--gold);
  color: var(--dark-bg);
}
