/* =====================================================
   Nicholas Mokhtarian — Portfolio
   Shared base stylesheet (refined editorial system)
   ===================================================== */

:root {
  /* Carbon palette (default) */
  --bg: #0f0f10;
  --bg-tint: #181818;
  --bg-card: #1c1c1d;
  --ink: #f1ede3;
  --ink-soft: #aeaea4;
  --ink-mute: #6e6e66;
  --line: #2c2c2d;
  --line-soft: #222223;
  --accent: #ff6a3d;
  --accent-soft: #ff9876;

  /* Type stack — overridable via Tweaks */
  --font-sans: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Fraunces', 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

/* Paper palette (light alt) */
[data-palette="paper"] {
  --bg: #f1ede3;
  --bg-tint: #f8f5ed;
  --bg-card: #ffffff;
  --ink: #14140f;
  --ink-soft: #54544e;
  --ink-mute: #8d8d85;
  --line: #d2cdc1;
  --line-soft: #e2ddd0;
  --accent: #c84118;
  --accent-soft: #e08164;
}

/* Carbon palette (explicit) */
[data-palette="carbon"] {
  --bg: #0f0f10;
  --bg-tint: #181818;
  --bg-card: #1c1c1d;
  --ink: #f1ede3;
  --ink-soft: #aeaea4;
  --ink-mute: #6e6e66;
  --line: #2c2c2d;
  --line-soft: #222223;
  --accent: #ff6a3d;
  --accent-soft: #ff9876;
}

/* Bone (cool near-white) */
[data-palette="bone"] {
  --bg: #f5f4ef;
  --bg-tint: #fbfaf6;
  --bg-card: #ffffff;
  --ink: #0e0e10;
  --ink-soft: #4a4a4d;
  --ink-mute: #8a8a8c;
  --line: #d4d2c9;
  --line-soft: #e6e4dc;
  --accent: #1b3aa8;
  --accent-soft: #6378c8;
}

/* Olive (warm muted green) */
[data-palette="olive"] {
  --bg: #ecebde;
  --bg-tint: #f4f3e8;
  --bg-card: #fcfbf2;
  --ink: #1d1f17;
  --ink-soft: #54564a;
  --ink-mute: #8d8e80;
  --line: #cccbb9;
  --line-soft: #ddddc9;
  --accent: #3a5a32;
  --accent-soft: #6c8862;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg) !important;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  transition: background 0.4s ease, color 0.4s ease;
}
html { background: var(--bg) !important; }

/* Subtle paper grain — screen blend for dark default, multiply for light alts */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}
[data-palette="paper"] body::before,
[data-palette="bone"]  body::before,
[data-palette="olive"] body::before {
  mix-blend-mode: multiply;
  opacity: 0.07;
}

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

/* ========================================
   Nav
   ======================================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 40px;
  z-index: 100;
  font-size: 13px;
  letter-spacing: 0.01em;
  background: transparent;
  backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease, padding 0.3s ease;
}
.nav.scrolled,
.nav.solid {
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  padding: 16px 40px;
}

.nav-left { display: flex; align-items: center; gap: 14px; }
.nav-center { text-align: center; }
.nav-right { display: flex; justify-content: flex-end; align-items: center; gap: 28px; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.theme-toggle:hover {
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  border-color: var(--ink-soft);
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }
[data-palette="olive"] .theme-toggle .icon-sun,
[data-palette="paper"] .theme-toggle .icon-sun,
[data-palette="bone"]  .theme-toggle .icon-sun { display: none; }
[data-palette="olive"] .theme-toggle .icon-moon,
[data-palette="paper"] .theme-toggle .icon-moon,
[data-palette="bone"]  .theme-toggle .icon-moon { display: block; }

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.wordmark-mark {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-1px);
}

.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.nav-status .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #2f9a4f;
  box-shadow: 0 0 0 3px color-mix(in oklab, #2f9a4f 22%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.nav-right a {
  color: var(--ink);
  position: relative;
  padding-bottom: 2px;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.nav-right a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav-right a:hover::after,
.nav-right a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ========================================
   Footer
   ======================================== */
footer {
  border-top: 1px solid var(--line);
  padding: 64px 40px 40px;
  margin-top: 140px;
  position: relative;
  z-index: 2;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  max-width: 1480px;
  margin: 0 auto;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line-soft);
}
.footer-brand h3 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.footer-brand p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 320px;
}
.footer-col h4 {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 14px;
  font-weight: 500;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col a {
  font-size: 14px;
  color: var(--ink);
  transition: color 0.3s;
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  max-width: 1480px;
  margin: 28px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  footer { padding: 48px 24px 32px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ========================================
   Project Page Layout
   ======================================== */
.project-page {
  padding: 130px 40px 60px;
  max-width: 1320px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 56px;
  transition: color 0.3s ease;
}
.back-link:hover { color: var(--ink); }
.back-link svg { width: 14px; height: 14px; }

.project-header {
  margin-bottom: 72px;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 36px;
}
.project-header .ix {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.project-header h1 {
  font-family: var(--font-sans);
  font-size: clamp(44px, 6.4vw, 92px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.94;
}
.project-header h1 .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.015em;
}
.project-header-meta {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 19px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.project-content {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 72px;
  align-items: start;
}

.project-image { position: relative; text-align: center; }
.project-image img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 78vh;
  border-radius: 2px;
  margin: 0 auto;
  display: block;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.04),
    0 12px 32px -10px rgba(20, 20, 25, 0.14);
}

.project-sidebar {
  position: sticky;
  top: 130px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.project-details { border-top: 1px solid var(--line); }
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.detail-label {
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 10px;
}
.detail-value {
  color: var(--ink);
  text-align: right;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
}

.project-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}
.project-description .lead {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
  line-height: 1.42;
  color: var(--ink);
  margin-bottom: 24px;
  letter-spacing: -0.005em;
}
.project-description p { margin-bottom: 18px; color: var(--ink-soft); }
.project-description p:last-child { margin-bottom: 0; }
.project-description strong { color: var(--ink); font-weight: 500; }

.project-gallery {
  margin-top: 96px;
  padding-top: 56px;
  border-top: 1px solid var(--line);
}
.gallery-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 32px;
  display: block;
}
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.gallery-grid .full-width { grid-column: 1 / -1; }
.gallery-grid img,
.gallery-grid iframe,
.gallery-grid video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px -8px rgba(20,20,25,0.08);
}
.gallery-grid iframe { aspect-ratio: 16 / 9; border: none; }

.project-nav {
  margin-top: 88px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.project-nav a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  transition: opacity 0.3s ease;
}
.project-nav a:hover { opacity: 0.6; }
.project-nav .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.project-nav .name {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 19px;
  color: var(--ink);
}
.project-nav .next { text-align: right; align-items: flex-end; }

/* ========================================
   Reveal Animations (no-op — kept as hooks for future opt-in)
   ======================================== */
.fade-up { opacity: 1; transform: none; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .fade-up, .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1000px) {
  .nav { padding: 16px 24px; }
  .nav.scrolled, .nav.solid { padding: 12px 24px; }
  .project-page { padding: 110px 24px 60px; }
  .project-header { grid-template-columns: 1fr; gap: 20px; padding-bottom: 28px; margin-bottom: 56px; }
  .project-content { grid-template-columns: 1fr; gap: 48px; }
  .project-sidebar { position: static; }
}

@media (max-width: 720px) {
  .nav { grid-template-columns: auto auto; }
  .nav-center { display: none; }
  .nav-right { gap: 18px; font-size: 12px; }
  .gallery-grid { grid-template-columns: 1fr; }
}
