/* ============================================
   LookAtMyPaintings.com — Steve Miller Art
   Immersive Gallery Experience
   ============================================

   The art is the only color. Everything else steps back.

   --bg:         #111111  (deep gallery black)
   --bg-panel:   #1A1A1A  (panels, cards)
   --bg-surface: #222222  (elevated surfaces)
   --text:       #E8E4DF  (warm off-white)
   --text-dim:   #888380  (secondary)
   --text-faint: #555250  (tertiary)
   --accent:     #D4785C  (warm burnt orange)
   --accent-hi:  #E89070  (hover glow)
   --border:     #2A2A2A  (subtle lines)

   ============================================ */

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

:root {
  --bg: #111111;
  --bg-panel: #1A1A1A;
  --bg-surface: #222222;
  --text: #E8E4DF;
  --text-dim: #888380;
  --text-faint: #555250;
  --accent: #D4785C;
  --accent-hi: #E89070;
  --border: #2A2A2A;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--accent-hi); }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
}

/* ===========================
   NAVIGATION — Minimal, dark
   =========================== */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  background: rgba(17,17,17,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav__logo {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.nav__logo span { color: var(--accent); }

.nav__links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav__links a {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 0.3s;
}

.nav__links a:hover,
.nav__links a.active { color: var(--text); }

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: all 0.3s;
}

/* ===========================
   GALLERY — The immersive experience
   =========================== */

.gallery {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Canvas: the painting container */
.gallery__canvas {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 80px 60px 120px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.gallery__canvas.loaded { opacity: 1; }

.gallery__canvas img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
  /* Image protection */
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

/* Protection layer — transparent overlay over image */
.gallery__protection {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10;
  cursor: default;
}

/* Zoom hint */
.gallery__zoom-hint {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  z-index: 55;
  pointer-events: none;
  transition: opacity 0.5s;
}

/* Slide transitions */
.gallery__canvas.slide-out-left {
  animation: slideOutLeft 0.4s ease forwards;
}
.gallery__canvas.slide-out-right {
  animation: slideOutRight 0.4s ease forwards;
}
.gallery__canvas.slide-in-right {
  animation: slideInRight 0.5s ease forwards;
}
.gallery__canvas.slide-in-left {
  animation: slideInLeft 0.5s ease forwards;
}
.gallery__canvas.fade-in-initial {
  animation: fadeInInitial 0.8s ease forwards;
}

@keyframes slideOutLeft {
  to { opacity: 0; transform: translateX(-60px); }
}
@keyframes slideOutRight {
  to { opacity: 0; transform: translateX(60px); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-60px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInInitial {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* Zoomed state */
.gallery.zoomed .gallery__canvas { cursor: grab; }
.gallery.zoomed .gallery__canvas img {
  transition: none; /* Direct manipulation, no easing */
}
.gallery.zoomed .gallery__info,
.gallery.zoomed .gallery__nav,
.gallery.zoomed #nav-ui,
.gallery.zoomed .gallery__zoom-hint { opacity: 0; pointer-events: none; }
.gallery.zoomed .nav { opacity: 0; pointer-events: none; }

/* Zoom exit hint */
.gallery.zoomed::after {
  content: 'Double-click to exit zoom · Scroll to adjust';
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  background: rgba(17,17,17,0.8);
  padding: 0.5rem 1rem;
  z-index: 999;
  pointer-events: none;
}

/* ===========================
   GALLERY INFO — Title overlay
   =========================== */

.gallery__info {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  padding: 0 2rem 1.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  background: linear-gradient(to top, rgba(17,17,17,0.7) 0%, transparent 100%);
}

.gallery__info > * { pointer-events: auto; }

.gallery__info-left {}

.gallery__info-title {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.gallery__info-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.gallery__info-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.gallery__counter {
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

/* ===========================
   GALLERY NAV — Prev/Next arrows
   =========================== */

.gallery__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  transition: opacity 0.5s ease;
}

.gallery__nav--prev { left: 1rem; }
.gallery__nav--next { right: 1rem; }

.gallery__nav-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17,17,17,0.5);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1.2rem;
  border-radius: 0;
}

.gallery__nav-btn:hover {
  background: rgba(17,17,17,0.8);
  border-color: var(--accent);
  color: var(--accent);
}

/* ===========================
   DETAILS TOGGLE BUTTON
   =========================== */

.details-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 2rem;
  z-index: 60;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17,17,17,0.6);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s;
}

.details-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.details-toggle__icon { font-style: normal; }

/* ===========================
   DETAILS PANEL — Slide-up
   =========================== */

.details-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  max-height: 70vh;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.details-panel.open {
  transform: translateY(0);
}

.details-panel__inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 2rem 3rem;
}

.details-panel__close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s;
  line-height: 1;
}

.details-panel__close:hover { color: var(--text); }

.details-panel__header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.details-panel__title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-style: italic;
  margin-bottom: 0.3rem;
}

.details-panel__meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.details-panel__meta span::after {
  content: '·';
  margin-left: 0.5rem;
  color: var(--text-faint);
}

.details-panel__meta span:last-child::after { content: ''; }

.detail__price {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  margin-top: 0.75rem;
}

.detail__price.status--available {
  color: var(--accent);
  border: 1px solid var(--accent);
}

.detail__price.status--sold {
  color: var(--text-faint);
  border: 1px solid var(--border);
}

.detail__price.status--nfs {
  color: var(--text-faint);
  border: 1px solid var(--border);
}

.details-panel__story {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.details-panel__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===========================
   PROGRESS BAR
   =========================== */

.progress {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border);
  z-index: 80;
}

.progress__bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.5s ease;
}

/* ===========================
   GALLERY END SCREEN
   =========================== */

.gallery__endscreen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 90;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.gallery__endscreen.visible {
  opacity: 1;
  pointer-events: auto;
}

.gallery__endscreen-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.gallery__endscreen-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400;
  color: var(--text);
  margin-bottom: 2rem;
}

/* ===========================
   UI IDLE HIDE
   =========================== */

.gallery.ui-hidden .nav,
.gallery.ui-hidden .gallery__info,
.gallery.ui-hidden .gallery__nav,
.gallery.ui-hidden .details-toggle,
.gallery.ui-hidden .gallery__zoom-hint,
.gallery.ui-hidden .progress {
  opacity: 0;
  pointer-events: none;
}

.gallery.details-open .gallery__nav,
.gallery.details-open .gallery__zoom-hint {
  opacity: 0;
  pointer-events: none;
}

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

.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.8rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  text-transform: uppercase;
}

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hi); color: #fff; }

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text-dim);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }

.btn--ghost {
  background: transparent;
  color: var(--accent);
  padding: 0;
  letter-spacing: 0.06em;
  border-bottom: 1px solid transparent;
}
.btn--ghost:hover { border-bottom-color: var(--accent); }

.btn--sm { padding: 0.5rem 1rem; font-size: 0.75rem; }

/* ===========================
   INTERIOR PAGES (About, Archive, Commission)
   =========================== */

.page {
  min-height: 100vh;
  padding: 100px 0 60px;
}

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container--narrow { max-width: 700px; }

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.divider {
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin: 1rem 0 1.5rem;
}

.divider--center { margin-left: auto; margin-right: auto; }

/* Sections */
.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.section:last-child { border-bottom: none; }

.section__title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 1.5rem;
}

.section p {
  color: var(--text-dim);
  max-width: 640px;
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.section p:last-child { margin-bottom: 0; }

/* Artist statement */
.statement {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem) !important;
  font-style: italic;
  color: var(--text) !important;
  line-height: 1.9 !important;
  max-width: 700px !important;
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
}

/* Teaching card */
.teaching-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2rem;
  margin-top: 1.5rem;
}

.teaching-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.teaching-card p {
  font-size: 0.95rem;
  max-width: none;
}

/* Exhibition card */
.exhibition-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 1.5rem 2rem;
  margin-bottom: 1rem;
}

.exhibition-card h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.exhibition-card p { font-size: 0.9rem; margin-bottom: 0; }

.exhibition-card--current {
  border-left: 3px solid var(--accent);
}

/* Links list */
.links-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
}

.links-list a {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.links-list a:hover { color: var(--accent); }

/* ===========================
   PORTFOLIO ARCHIVE (AA Embed)
   =========================== */

.portfolio-embed {
  min-height: 400px;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  margin-top: 2rem;
}

.portfolio-embed--active {
  border: none;
  display: block;
  padding: 0;
}

.portfolio-placeholder {
  text-align: center;
  color: var(--text-faint);
}

.portfolio-placeholder code {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--accent);
}

/* ===========================
   COMMISSION FORM
   =========================== */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  margin-top: 2rem;
}

.form-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2rem;
}

.form__group { margin-bottom: 1.2rem; }

.form__group label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.form__group input,
.form__group textarea,
.form__group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color 0.3s;
}

.form__group input:focus,
.form__group textarea:focus,
.form__group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form__group input::placeholder,
.form__group textarea::placeholder {
  color: var(--text-faint);
}

.form__group textarea { min-height: 110px; resize: vertical; }
.form__group select option { background: var(--bg); }

.form__submit { width: 100%; margin-top: 0.5rem; }
.form__note {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* Commission steps */
.commission-steps {
  list-style: none;
  counter-reset: steps;
}

.commission-steps li {
  counter-increment: steps;
  padding: 1rem 0 1rem 2.5rem;
  position: relative;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.commission-steps li:last-child { border-bottom: none; }

.commission-steps li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--accent);
  top: 1rem;
}

.commission-steps li strong { color: var(--text); }

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

.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer__copy {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-bottom: 1.5rem;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer__links a {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.footer__links a:hover { color: var(--accent); }

.footer__sections {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 3rem;
}

.footer__section-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  opacity: 0.5;
  margin-bottom: 0.4rem;
}

.footer__section-links {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.footer__section-links a {
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: color 0.3s;
}

.footer__section-links a:hover { color: var(--accent); }

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 768px) {
  .nav__links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: rgba(17,17,17,0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1.2rem;
    border-bottom: 1px solid var(--border);
  }

  .nav__links--open { display: flex; }
  .nav__toggle { display: block; }

  .nav__toggle--active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav__toggle--active span:nth-child(2) { opacity: 0; }
  .nav__toggle--active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .gallery__canvas { padding: 64px 16px 100px; }
  .gallery__nav--prev { left: 0.3rem; }
  .gallery__nav--next { right: 0.3rem; }
  .gallery__nav-btn { width: 36px; height: 36px; font-size: 1rem; }

  .gallery__info { padding: 0 1rem 1rem; }
  .gallery__info-title { font-size: 1.1rem; }

  .gallery__zoom-hint { bottom: 110px; font-size: 0.65rem; }

  .details-panel { max-height: 80vh; }
  .details-panel__inner { padding: 2rem 1.5rem; }

  .details-toggle { bottom: 1rem; right: 1rem; }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer__inner {
    text-align: center;
  }

  .footer__sections {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    justify-items: center;
  }
}

/* Disable image save hints on mobile */
@media (pointer: coarse) {
  .gallery__zoom-hint::after {
    content: ' · Pinch to zoom';
  }
}

/* noimageindex meta tag companion — discourage crawlers */
img[src*="images/"] {
  -webkit-touch-callout: none;
}
