/* ============================================
   ESTHER HARMS PORTFOLIO — GLOBAL STYLESHEET
   ============================================ */

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

/* ---- TOKENS ---- */
:root {
  /* Light mode */
  --bg:           #F7F3EE;
  --bg-alt:       #EDE8E1;
  --ink:          #1C1612;
  --ink-mid:      #2E2924;
  --ink-muted:    #5A544E;
  --accent:       #C4673A;
  --accent-light: #F0DDD4;
  --sage:         #7A8C7E;
  --sage-light:   #DDE5DF;
  --card-bg:      #EFEBE4;
  --border:       rgba(28, 22, 18, 0.1);
  --nav-bg:       rgba(247, 243, 238, 0.93);
  --shadow:       0 2px 24px rgba(28,22,18,0.08);
  --radius:       14px;

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg:           #1A1714;
  --bg-alt:       #231F1B;
  --ink:          #EDE8E1;
  --ink-mid:      #D8D0C8;
  --ink-muted:    #A89E96;
  --accent:       #D4784A;
  --accent-light: #3A2519;
  --sage:         #8A9E8E;
  --sage-light:   #1E2820;
  --card-bg:      #231F1B;
  --border:       rgba(237, 232, 225, 0.1);
  --nav-bg:       rgba(26, 23, 20, 0.93);
  --shadow:       0 2px 24px rgba(0,0,0,0.3);
}

/* ---- BASE ---- */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

/* ---- NAV ---- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 4rem;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s ease;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.35s;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 100%;
  height: 1px;
  background: var(--accent);
  transition: right 0.25s ease;
}

.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.active::after { right: 0; }
.nav-links a.active { color: var(--ink); }

/* Nav back link (case study pages) */
.nav-back {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--ink); }
.nav-back svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* ---- THEME TOGGLE ---- */
.theme-toggle {
  width: 38px;
  height: 22px;
  border-radius: 100px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink-muted);
  transition: transform 0.3s, background 0.3s;
}

[data-theme="dark"] .theme-toggle::after {
  transform: translateX(16px);
  background: var(--accent);
}

/* ---- SHARED IMAGE UTILITIES ---- */
.img-full {
  width: 100%;
  max-width: 960px;
  margin: 0 auto 2rem;
  padding: 0 4rem;
}

.img-full img, .img-full video {
  width: 100%;
  display: block;
  border-radius: var(--radius);
}

.img-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  max-width: 960px;
  margin: 0 auto 2rem;
  padding: 0 4rem;
}

.img-pair img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
}

.img-caption {
  font-size: 0.78rem;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 0.75rem;
  font-style: italic;
}

/* ---- SHARED SECTION TAGS ---- */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-tag::before {
  content: '';
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---- SHARED HEADINGS ---- */
h2.case-h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  color: var(--ink);
}

/* ---- SHARED NEXT PROJECT ---- */
.next-project {
  padding: 5rem 4rem;
  border-top: 1px solid var(--border);
  max-width: 960px;
  margin: 0 auto;
}

.next-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.next-link {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: gap 0.3s;
}

.next-link:hover { gap: 1.5rem; }
.next-link svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.5; flex-shrink: 0; }

/* ---- FOOTER ---- */
footer {
  padding: 2rem 4rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

footer p { font-size: 0.78rem; color: var(--ink-muted); }

.footer-links { display: flex; gap: 2rem; }
.footer-links a { font-size: 0.78rem; color: var(--ink-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--ink); }

/* ---- LIGHTBOX ---- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(26,22,18,0.94);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}

.lightbox.open { display: flex; }

.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  transition: border-color 0.2s, color 0.2s;
}

.lightbox-close:hover { border-color: rgba(255,255,255,0.6); color: #fff; }

.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  cursor: default;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}

/* ---- SCROLL ANIMATIONS ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible { opacity: 1; transform: none; }

.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; }

/* ---- SHARED THEME + LIGHTBOX SCRIPT HOOK ---- */
/* Applied via global.js */

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .img-full, .img-pair { padding: 0 1.5rem; }
  .img-pair { grid-template-columns: 1fr; }
  .next-project { padding: 3rem 1.5rem; }
  footer { padding: 1.5rem; flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
