/* ============================================================
   Olivia Rigby — Portfolio Site
   Sidebar pattern (Studio Alexander reference)
   Left: identity + brand index + contact (fixed)
   Right: work area
   ============================================================ */

:root {
  --paper: #FFFFFF;
  --paper-soft: #FAFAFA;
  --ink: #0A0A0A;
  --ink-soft: #555555;
  --ink-faint: #999999;
  --line: #E8E8E8;
  --line-soft: #F0F0F0;
  --sans: 'Geist', 'Manrope', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --sidebar-w: 300px;
  --bleed: clamp(24px, 4vw, 56px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
*::selection { background: var(--ink); color: var(--paper); }

html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; padding: 0; color: inherit; }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  z-index: 40;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

.sb-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 24px 32px 24px;
  gap: 20px;
}

/* Sidebar header — name + tagline above photo */
.sb-header { display: block; }
.sb-brand-link {
  display: block;
  color: var(--ink);
  transition: opacity .25s var(--ease);
}
.sb-brand-link:hover { opacity: 0.7; }
.sb-name {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}
.sb-tagline {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.sb-photo {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
  background: var(--paper-soft);
}

/* Sidebar nav — brand list */
.sb-nav { flex: 1; }
.sb-eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.sb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sb-item {
  margin: 0;
}
.sb-item a {
  display: block;
  padding: 2px 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: opacity .25s var(--ease), padding-left .25s var(--ease);
}
.sb-item a:hover { opacity: 0.55; padding-left: 6px; }
.sb-item.is-current a {
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding-left: 14px;
}
.sb-item.is-current a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 1px;
  background: var(--ink);
}

/* Sidebar footer — contact */
.sb-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.sb-footer a {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-soft);
  transition: opacity .25s var(--ease);
  line-height: 1.4;
}
.sb-footer a:hover { opacity: 0.55; color: var(--ink); }

/* Mobile sidebar toggle */
.sb-mobile-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 60;
  width: 40px;
  height: 40px;
  background: var(--paper);
  border-radius: 4px;
  align-items: center;
  justify-content: center;
}
.sb-mobile-toggle .dots {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sb-mobile-toggle .dots span {
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .3s var(--ease);
}

/* ============================================================
   Main area
   ============================================================ */
.main-area {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* ============================================================
   Home — intro + grid
   ============================================================ */
.home-intro {
  padding: clamp(60px, 10vh, 120px) var(--bleed) clamp(40px, 6vh, 72px);
  max-width: 1480px;
}
.hi-lede {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 32px);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 28ch;
  margin: 0;
}

/* Project grid */
.work-grid { padding: 0 var(--bleed) clamp(80px, 10vh, 120px); }
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(40px, 4vw, 64px) clamp(24px, 2.5vw, 40px);
  max-width: 1480px;
}
@media (min-width: 1400px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .grid { grid-template-columns: 1fr; } }

.tile { display: block; cursor: pointer; text-decoration: none; color: inherit; }
.tile-frame {
  position: relative;
  aspect-ratio: 1.414 / 1;
  overflow: hidden;
  background: var(--paper-soft);
  transition: transform .5s var(--ease);
}
.tile-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .9s var(--ease);
}
.tile:hover .tile-frame { transform: translateY(-3px); }
.tile:hover .tile-frame img { transform: scale(1.03); }

.tile-meta {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: baseline;
  gap: 14px;
  margin-top: 16px;
}
.tile-num {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.tile-name {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: opacity .25s var(--ease);
}
.tile:hover .tile-name { opacity: 0.55; }
.tile-count {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-faint);
  white-space: nowrap;
}
.tile-summary {
  margin: 4px 0 0 46px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 38ch;
}

/* ============================================================
   Project page — Pentagram-style compact hero + spreads
   ============================================================ */
.project-page-hero {
  padding: clamp(60px, 10vh, 120px) var(--bleed) clamp(32px, 4vh, 48px);
}
.pph-inner { max-width: 1100px; }
.pph-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  margin: 0 0 20px;
  color: var(--ink);
}
.pph-summary {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 48ch;
  margin: 0 0 24px;
}
.pph-meta {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

/* Spreads — work begins right after the title block */
.project-pages { padding: 0 var(--bleed) clamp(80px, 10vh, 120px); }
.project-pages-inner {
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: clamp(36px, 5vw, 64px);
}

.spread {
  position: relative;
  cursor: zoom-in;
  background: var(--paper-soft);
  overflow: hidden;
  transition: transform .5s var(--ease);
  opacity: 0;
  transform: translateY(24px);
}
.spread.in-view { opacity: 1; transform: translateY(0); }
.spread:hover { transform: translateY(-3px); }
.spread img { width: 100%; height: auto; display: block; }

/* ============================================================
   Footer (small, slim)
   ============================================================ */
.site-footer {
  padding: 40px var(--bleed);
  border-top: 1px solid var(--line);
}
.sf-inner {
  max-width: 1480px;
}
.sf-inner p {
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-faint);
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease), visibility 0s .35s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease); }

.lb-stage {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 92vw;
  max-height: 92vh;
}
.lb-stage img {
  max-width: 92vw;
  max-height: calc(92vh - 60px);
  object-fit: contain;
  background: var(--paper);
}
.lb-stage figcaption {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  color: var(--paper);
  border-radius: 50%;
  transition: background .2s var(--ease);
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, 0.1); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-close svg, .lb-prev svg, .lb-next svg { width: 20px; height: 20px; }

body.lightbox-open { overflow: hidden; }
body.sidebar-open { overflow: hidden; }

/* ============================================================
   Mobile — sidebar becomes slide-in panel
   ============================================================ */
@media (max-width: 860px) {
  .sb-mobile-toggle { display: inline-flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .4s var(--ease);
    width: min(320px, 86vw);
    box-shadow: 4px 0 24px rgba(10, 10, 10, 0.04);
  }
  .sidebar.is-open { transform: translateX(0); }

  .main-area {
    margin-left: 0;
    padding-top: 72px;
  }

  .home-intro {
    padding-top: 8px;
  }
}

@media print {
  .sidebar, .sb-mobile-toggle, .lightbox { display: none !important; }
  .main-area { margin-left: 0; }
  .spread { opacity: 1 !important; transform: none !important; }
  section { padding: 20px; break-inside: avoid; }
}
