/* Sara Donia — Direction 1: Quiet Gallery */
/* Pure off-white, classical serif, generous breathing room. */

/* ─── Page transitions ───────────────────────────────────── */
@view-transition { navigation: auto; }
html { background: #fafaf6; }

/* ─── Noir theme ─────────────────────────────────────────── */
:root[data-theme="noir"] {
  --bg:   #141210;
  --ink:  #ece8de;
  --mute: #8a8480;
  --rule: rgba(236, 232, 222, 0.12);
}

body, .nav, .footer, .studio-quote, .gallery-header,
.filter-rail, .artwork-sidebar, .artwork-detail, .related-works {
  transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ─── Design tokens ──────────────────────────────────────── */
:root {
  --bg:      #fafaf6;
  --ink:     #1a1814;
  --mute:    #7a7468;
  --rule:    rgba(26, 24, 20, 0.12);
  --serif:   "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --ui:      "Inter", -apple-system, "Helvetica Neue", sans-serif;
  --pad-x:   max(64px, calc((100vw - 1600px) / 2));
}

/* ─── Base ───────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ─── Typography helpers ─────────────────────────────────── */
.ui-label {
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.ui-label--ink { color: var(--ink); }

.serif-display {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.01em;
}

/* ─── Navigation ─────────────────────────────────────────── */
.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 32px var(--pad-x);
  border-bottom: 1px solid var(--rule);
}

.nav__wordmark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-align: center;
}

.nav__links {
  display: flex;
  gap: 36px;
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  list-style: none;
}

.nav__links a {
  color: var(--mute);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.nav__utils {
  display: flex;
  gap: 24px;
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.nav__utils .cart { color: var(--ink); }

.nav__right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 36px;
}

.theme-toggle {
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  background: none;
  border: none;
  padding: 0 0 0 20px;
  border-left: 1px solid var(--rule);
  transition: color 0.15s;
}
.theme-toggle:hover { color: var(--ink); }

/* ─── Painting placeholder ───────────────────────────────── */
.painting {
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.08);
}

.painting__overlay {
  position: absolute;
  inset: 0;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: block;
  width: 100%;
  padding: 18px;
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  border: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.82; }

.btn--primary {
  background: var(--ink);
  color: var(--bg);
}

.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  margin-top: 12px;
}

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
  padding: 48px var(--pad-x);
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}

/* ─── Home — Hero ────────────────────────────────────────── */
.hero {
  padding: 80px var(--pad-x);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  min-height: 80vh;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hero__image-wrap { overflow: hidden; }

.hero__image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(.2,.8,.3,1);
}
.hero__image-wrap:hover .hero__image { transform: scale(1.02); }

.hero__eyebrow {
  margin-bottom: 40px;
}

.hero__heading {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(64px, 6.67vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.hero__heading em { font-weight: 300; }

.hero__body {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  font-style: italic;
  font-weight: 300;
  max-width: 380px;
  margin-bottom: 32px;
}

.hero__cta {
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
  display: inline-block;
  transition: opacity 0.15s;
}
.hero__cta:hover { opacity: 0.6; }

/* ─── Home — Selected Works ──────────────────────────────── */
.selected-works {
  padding: 0 var(--pad-x) 120px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 56px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.section-header h2 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 300;
  font-style: italic;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

/* ─── Artwork card ───────────────────────────────────────── */
.artwork-card__meta { margin-top: 16px; }
.artwork-card__title {
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  font-weight: 400;
}
.artwork-card__sub {
  margin-top: 6px;
}
.artwork-card__price {
  font-family: var(--serif);
  font-size: 15px;
  margin-top: 10px;
}

.artwork-card__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 18px;
}
.artwork-card__row .artwork-card__title { font-size: 18px; }
.artwork-card__row .artwork-card__price { font-size: 15px; }

/* ─── Home — Studio Quote ────────────────────────────────── */
.studio-quote {
  padding: 120px var(--pad-x);
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 64px;
}

.studio-quote blockquote {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 300;
  line-height: 1.4;
  font-style: italic;
  margin: 0;
}

.studio-quote cite {
  display: block;
  font-style: normal;
  margin-top: 32px;
}

/* ─── Gallery — Header ───────────────────────────────────── */
.gallery-header {
  padding: 100px var(--pad-x) 48px;
}

.gallery-header__count { margin-bottom: 24px; }

.gallery-header h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(80px, 9vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-style: italic;
}

/* ─── Gallery — Filter rail ──────────────────────────────── */
.filter-rail {
  padding: 0 var(--pad-x) 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}

.filter-rail__filters {
  display: flex;
  gap: 28px;
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  list-style: none;
}

.filter-rail__filters li { cursor: pointer; color: var(--mute); transition: color 0.15s; }
.filter-rail__filters li:hover { color: var(--ink); }
.filter-rail__filters li.active {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
}

/* ─── Gallery — Grid ─────────────────────────────────────── */
.gallery-grid {
  padding: 64px var(--pad-x) 100px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 64px 48px;
}

/* ─── Detail — Breadcrumb ────────────────────────────────── */
.breadcrumb {
  padding: 40px var(--pad-x) 24px;
}

/* ─── Detail — Main layout ───────────────────────────────── */
.artwork-detail {
  padding: 40px var(--pad-x) 100px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 96px;
  align-items: start;
}

.artwork-detail__image {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 24px 60px rgba(0, 0, 0, 0.06);
}

/* ─── Detail — Sticky sidebar ────────────────────────────── */
.artwork-sidebar {
  position: sticky;
  top: 40px;
}

.artwork-sidebar__category { margin-bottom: 20px; }

.artwork-sidebar__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 6vw, 88px);
  line-height: 1.0;
  font-style: italic;
  letter-spacing: -0.01em;
}

.artwork-sidebar__specs {
  margin: 48px 0;
  display: grid;
  grid-template-columns: 120px 1fr;
  row-gap: 14px;
  column-gap: 24px;
  font-family: var(--ui);
  font-size: 12px;
}

.artwork-sidebar__specs dt {
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  display: flex;
  align-items: center;
}

.artwork-sidebar__specs dd { margin: 0; }

.artwork-sidebar__price-row {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.artwork-sidebar__price {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 400;
}

.artwork-sidebar__note { font-size: 10px; }

.artwork-sidebar__description {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  font-style: italic;
  font-weight: 300;
  margin-top: 48px;
}

/* ─── Detail — Related works ─────────────────────────────── */
.related-works {
  padding: 64px var(--pad-x) 100px;
  border-top: 1px solid var(--rule);
}

.related-works__label { margin-bottom: 32px; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

/* ─── Hover states on artwork links ──────────────────────── */
.painting-link {
  display: block;
  transition: opacity 0.18s;
}
.painting-link:hover { opacity: 0.9; }

/* ─── Custom cursor ──────────────────────────────────────── */
* { cursor: none !important; }

.cursor-dot {
  position: fixed;
  top: -4px;
  left: -4px;
  width: 7px;
  height: 7px;
  background: var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  will-change: transform;
  transition: width 0.25s, height 0.25s, top 0.25s, left 0.25s, background 0.25s, opacity 0.3s;
}
.cursor-dot.is-hovering {
  width: 5px;
  height: 5px;
  top: -2.5px;
  left: -2.5px;
  background: var(--mute);
}

.cursor-ring {
  position: fixed;
  top: -20px;
  left: -20px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  will-change: transform;
  transition: width 0.35s cubic-bezier(.2,.8,.3,1),
              height 0.35s cubic-bezier(.2,.8,.3,1),
              top 0.35s cubic-bezier(.2,.8,.3,1),
              left 0.35s cubic-bezier(.2,.8,.3,1),
              opacity 0.3s;
}
.cursor-ring.is-hovering {
  width: 60px;
  height: 60px;
  top: -30px;
  left: -30px;
}

/* ─── Scroll reveal ──────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Nav — compact on scroll ────────────────────────────── */
.nav {
  transition: padding 0.3s ease, box-shadow 0.3s ease;
}
.nav--scrolled {
  padding-top: 18px;
  padding-bottom: 18px;
  box-shadow: 0 1px 0 var(--rule);
  backdrop-filter: blur(12px);
  background: rgba(250, 250, 246, 0.88);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ─── Painting-link image hover ──────────────────────────── */
.painting-link { overflow: hidden; }

.painting-link img,
.painting-link .painting {
  transition: transform 0.55s cubic-bezier(.2,.8,.3,1), filter 0.55s ease;
  transform-origin: center;
  overflow: hidden;
}
.painting-link:hover img,
.painting-link:hover .painting {
  transform: scale(1.025);
  filter: brightness(1.03);
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --pad-x: 40px; }
  .hero { padding-top: 120px; padding-bottom: 100px; }
  .hero__heading { font-size: 72px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --pad-x: 24px; }

  .nav { grid-template-columns: 1fr; gap: 20px; padding: 24px var(--pad-x); text-align: center; }
  .nav__right { justify-content: center; flex-wrap: wrap; }

  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 60px;
    padding-bottom: 60px;
    min-height: auto;
  }
  .hero__image-wrap { order: -1; }
  .hero__heading { font-size: 52px; }

  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .grid-3 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 24px; }

  .studio-quote { grid-template-columns: 1fr; gap: 24px; }
  .studio-quote blockquote { font-size: 24px; }

  .artwork-detail { grid-template-columns: 1fr; gap: 48px; }
  .artwork-sidebar { position: static; }
  .artwork-sidebar__title { font-size: 40px; }

  .section-header { flex-direction: column; gap: 16px; }
  .filter-rail { flex-direction: column; gap: 20px; align-items: flex-start; }

  .footer { flex-direction: column; gap: 16px; }
}

/* ─── Cart drawer ─────────────────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 20, 0.45);
  backdrop-filter: blur(3px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--bg);
  border-left: 1px solid var(--rule);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(.2, .8, .3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 32px 24px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}

.cart-drawer__close {
  background: none;
  border: none;
  font-family: var(--ui);
  font-size: 13px;
  color: var(--mute);
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
.cart-drawer__close:hover { color: var(--ink); }

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.cart-empty {
  padding: 48px 0;
  text-align: center;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.cart-item:last-child { border-bottom: none; }

.cart-item__img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
}

.cart-item__title {
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  line-height: 1.2;
}
.cart-item__sub { margin-top: 4px; }
.cart-item__price {
  font-family: var(--serif);
  font-size: 15px;
  margin-top: 8px;
}

.cart-item__remove {
  background: none;
  border: none;
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 2px 0 0;
  transition: color 0.15s;
  white-space: nowrap;
}
.cart-item__remove:hover { color: var(--ink); }

.cart-drawer__foot {
  padding: 24px 32px 36px;
  border-top: 1px solid var(--rule);
  flex-shrink: 0;
}

.cart-drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-total-amount {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  font-style: italic;
}
