/* ============================================
   Art Portfolio — Airy & Light
   Palette: soft whites, sky blue, stone
   Fonts: Cormorant (display) + Karla (body)
   ============================================ */

:root {
  --bg:          #F5F2EC;
  --surface:     #FDFCFA;
  --text:        #3A4F5E;
  --text-light:  #7B8E9B;
  --accent:      #89B4D1;
  --accent-hover:#6A9BBD;
  --stone:       #C4BDB5;
  --warm:        #EBE6DF;
  --border:      #E2DDD5;
  --shadow-sm:   0 1px 3px rgba(58,79,94,.06);
  --shadow-md:   0 4px 20px rgba(58,79,94,.08);
  --shadow-lg:   0 12px 40px rgba(58,79,94,.12);
  --radius:      6px;
  --font-display: 'Cormorant', Georgia, serif;
  --font-body:    'Karla', system-ui, sans-serif;
  --max-width:   1200px;
  --nav-h:       70px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* ---- Navigation ---- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
  background: rgba(245,242,236,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--text);
}

.nav-logo {
  height: 38px;
  width: auto;
  border-radius: 3px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-size: .85rem;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-light);
  position: relative;
  transition: color .3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width .3s ease;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform .3s, opacity .3s;
}

/* ---- Hero ---- */
.hero {
  padding: calc(var(--nav-h) + 6rem) 2rem 4rem;
  text-align: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 300;
  letter-spacing: .06em;
  color: var(--text);
  animation: fadeUp .8s ease both;
}

.hero-subtitle {
  margin-top: .6rem;
  font-size: 1.1rem;
  color: var(--text-light);
  font-weight: 300;
  letter-spacing: .04em;
  animation: fadeUp .8s ease .15s both;
}

.hero-tagline {
  margin-top: .35rem;
  font-size: .95rem;
  color: var(--stone);
  font-style: italic;
  font-weight: 300;
  letter-spacing: .03em;
  animation: fadeUp .8s ease .3s both;
}

/* ---- Section Labels ---- */
.section-label {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--text);
  letter-spacing: .02em;
}

/* ---- Featured Grid ---- */
.featured-section {
  padding: 2rem clamp(1.5rem, 4vw, 3rem) 4rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.featured-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .4s ease, box-shadow .4s ease;
  animation: fadeUp .6s ease both;
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-image-wrap {
  overflow: hidden;
}

.card-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .6s ease;
}

.featured-card:hover .card-image-wrap img {
  transform: scale(1.04);
}

.card-info {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.card-info h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
}

.card-year {
  font-size: .8rem;
  color: var(--text-light);
}

/* ---- Gallery Grid ---- */
.gallery-section {
  padding: 2rem clamp(1.5rem, 4vw, 3rem) 6rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.gallery-grid {
  columns: 3;
  column-gap: 1.25rem;
}

.gallery-item {
  display: block;
  break-inside: avoid;
  margin-bottom: 1.25rem;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  animation: fadeUp .5s ease both;
}

.gallery-item img {
  width: 100%;
  transition: transform .5s ease;
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(58,79,94,.7) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity .35s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-overlay h3 {
  font-family: var(--font-display);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 400;
}

.gallery-overlay span {
  color: rgba(255,255,255,.75);
  font-size: .8rem;
  margin-top: .25rem;
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 6rem 2rem;
  color: var(--text-light);
}

.empty-state a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

/* ---- Detail Page ---- */
.detail-page {
  padding: calc(var(--nav-h) + 2rem) clamp(1.5rem, 4vw, 3rem) 4rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  font-size: .85rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  transition: color .3s;
}

.back-link:hover { color: var(--accent); }

.detail-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: start;
}

.artwork-frame-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  cursor: zoom-in;
}

.artwork-frame {
  transition: padding .3s ease, border .3s ease, box-shadow .3s ease;
}

.detail-img {
  width: 100%;
  border-radius: 2px;
}

/* Frame styles */
.frame-none { /* default, no extra styling */ }

.frame-light-oak {
  padding: 12px;
  border-top: 4px solid #D4B878;
  border-left: 4px solid #CCB070;
  border-bottom: 4px solid #7A5A28;
  border-right: 4px solid #80602C;
  background:
    repeating-linear-gradient(
      95deg,
      rgba(180,140,90,.15) 0px,
      transparent 2px,
      transparent 6px,
      rgba(160,120,70,.1) 8px
    ),
    repeating-linear-gradient(
      88deg,
      rgba(200,160,100,.1) 0px,
      transparent 3px,
      transparent 10px
    ),
    linear-gradient(to bottom right, #C4A060, transparent 35%) top left,
    linear-gradient(to bottom left, #C4A060, transparent 35%) top right,
    linear-gradient(to top right, #C4A060, transparent 35%) bottom left,
    linear-gradient(to top left, #C4A060, transparent 35%) bottom right,
    linear-gradient(180deg, #B8924C, #A07840, #B8924C);
  background-size: 100%, 100%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 100%;
  background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  box-shadow:
    inset 0 0 0 2px #8A6830,
    inset 3px 3px 0 2px rgba(255,255,255,.2),
    inset -3px -3px 0 2px rgba(0,0,0,.2),
    8px 10px 25px rgba(0,0,0,.25), 2px 3px 8px rgba(0,0,0,.12);
}

.frame-dark-walnut {
  padding: 12px;
  border-top: 4px solid #7A5828;
  border-left: 4px solid #724E22;
  border-bottom: 4px solid #261206;
  border-right: 4px solid #2C1608;
  background:
    repeating-linear-gradient(
      93deg,
      rgba(80,50,20,.2) 0px,
      transparent 1px,
      transparent 5px,
      rgba(60,35,15,.15) 7px
    ),
    repeating-linear-gradient(
      87deg,
      rgba(90,55,25,.1) 0px,
      transparent 2px,
      transparent 8px
    ),
    linear-gradient(to bottom right, #6B4420, transparent 35%) top left,
    linear-gradient(to bottom left, #6B4420, transparent 35%) top right,
    linear-gradient(to top right, #6B4420, transparent 35%) bottom left,
    linear-gradient(to top left, #6B4420, transparent 35%) bottom right,
    linear-gradient(180deg, #5A3818, #4A2C10, #5A3818);
  background-size: 100%, 100%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 100%;
  background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  box-shadow:
    inset 0 0 0 2px #2A1A08,
    inset 3px 3px 0 2px rgba(255,255,255,.12),
    inset -3px -3px 0 2px rgba(0,0,0,.35),
    8px 10px 25px rgba(0,0,0,.25), 2px 3px 8px rgba(0,0,0,.12);
}

.frame-natural-oak {
  padding: 12px;
  border-top: 4px solid #F0DFB8;
  border-left: 4px solid #E8D5A8;
  border-bottom: 4px solid #B8A070;
  border-right: 4px solid #BFA878;
  background:
    repeating-linear-gradient(
      95deg,
      rgba(200,170,115,.12) 0px,
      transparent 2px,
      transparent 7px,
      rgba(180,150,100,.08) 9px
    ),
    repeating-linear-gradient(
      88deg,
      rgba(220,190,135,.08) 0px,
      transparent 3px,
      transparent 10px
    ),
    linear-gradient(to bottom right, #E6D2A8, transparent 35%) top left,
    linear-gradient(to bottom left, #E6D2A8, transparent 35%) top right,
    linear-gradient(to top right, #E6D2A8, transparent 35%) bottom left,
    linear-gradient(to top left, #E6D2A8, transparent 35%) bottom right,
    linear-gradient(180deg, #DCC592, #D0B880, #DCC592);
  background-size: 100%, 100%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 100%;
  background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  box-shadow:
    inset 0 0 0 2px #C0A878,
    inset 3px 3px 0 2px rgba(255,255,255,.3),
    inset -3px -3px 0 2px rgba(0,0,0,.12),
    8px 10px 25px rgba(0,0,0,.2), 2px 3px 8px rgba(0,0,0,.1);
}

.frame-driftwood {
  padding: 12px;
  border-top: 4px solid #B8B0A0;
  border-left: 4px solid #B0A898;
  border-bottom: 4px solid #686058;
  border-right: 4px solid #706860;
  background:
    repeating-linear-gradient(
      94deg,
      rgba(140,130,115,.12) 0px,
      transparent 1px,
      transparent 5px,
      rgba(120,110,95,.08) 7px
    ),
    repeating-linear-gradient(
      87deg,
      rgba(150,140,125,.08) 0px,
      transparent 2px,
      transparent 8px
    ),
    linear-gradient(to bottom right, #A09888, transparent 35%) top left,
    linear-gradient(to bottom left, #A09888, transparent 35%) top right,
    linear-gradient(to top right, #A09888, transparent 35%) bottom left,
    linear-gradient(to top left, #A09888, transparent 35%) bottom right,
    linear-gradient(180deg, #968E7E, #8A8070, #968E7E);
  background-size: 100%, 100%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 100%;
  background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  box-shadow:
    inset 0 0 0 2px #706860,
    inset 3px 3px 0 2px rgba(255,255,255,.2),
    inset -3px -3px 0 2px rgba(0,0,0,.2),
    8px 10px 25px rgba(0,0,0,.25), 2px 3px 8px rgba(0,0,0,.12);
}

.frame-black-gallery {
  padding: 10px;
  border-top: 2px solid #1f1f1f;
  border-left: 2px solid #1a1a1a;
  border-bottom: 2px solid #050505;
  border-right: 2px solid #0a0a0a;
  background: linear-gradient(180deg, #181818, #0e0e0e, #181818);
  box-shadow:
    inset 0 0 0 1px #000,
    inset 2px 2px 0 1px rgba(255,255,255,.05),
    inset -2px -2px 0 1px rgba(0,0,0,.5),
    6px 8px 20px rgba(0,0,0,.3), 2px 2px 6px rgba(0,0,0,.15);
}

.frame-white-gallery {
  padding: 12px;
  border-top: 3px solid #F4EFE5;
  border-left: 3px solid #F0EBE0;
  border-bottom: 3px solid #D4CDBF;
  border-right: 3px solid #D8D1C3;
  background: #EDE6D8;
  box-shadow:
    inset 0 0 0 1px #C8BFAC,
    inset 2px 2px 0 1px rgba(255,255,255,.35),
    inset -2px -2px 0 1px rgba(0,0,0,.06),
    6px 8px 18px rgba(0,0,0,.15), 2px 3px 6px rgba(0,0,0,.06);
}

/* Frame selector */
.frame-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.selector-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-light);
  white-space: nowrap;
}

.frame-options {
  display: flex;
  gap: .6rem;
}

.frame-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  padding: 4px;
  transition: border-color .3s, transform .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame-btn:hover { transform: scale(1.1); }
.frame-btn.active { border-color: var(--accent); }

.frame-preview {
  display: block;
  width: 18px;
  height: 14px;
  border-radius: 1px;
}

.fp-none { background: var(--bg); border: 1px solid var(--border); }
.fp-natural-oak { background: linear-gradient(135deg, #E6D2A8, #D4BC88); }
.fp-light-oak { background: linear-gradient(135deg, #C4A060, #A07840); }
.fp-driftwood { background: linear-gradient(135deg, #968E7E, #8A8070); }
.fp-dark-walnut { background: linear-gradient(135deg, #5A3818, #3E2812); }
.fp-white-gallery { background: #EDE6D8; border: 1px solid #D4CDBF; }
.fp-black-gallery { background: linear-gradient(135deg, #2C2C2C, #1a1a1a); }

/* Room viewer button */
.room-viewer-btn {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: 1rem;
  padding: .75rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .85rem;
  color: var(--text);
  cursor: pointer;
  transition: all .3s;
}

.room-viewer-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Detail info */
.detail-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}

.meta-item {
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: .35rem .85rem;
  border: 1px solid var(--border);
  border-radius: 50px;
}

.detail-description {
  color: var(--text);
  font-size: .95rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.detail-description p + p { margin-top: 1rem; }

.detail-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.inquire-btn {
  display: inline-block;
  padding: .85rem 2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .04em;
  transition: background .3s, transform .2s;
}

.inquire-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.inquire-secondary {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
}

.inquire-secondary:hover {
  background: var(--warm);
  color: var(--text);
  transform: translateY(-1px);
}

/* ---- Lightbox ---- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(245,242,236,.96);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
  animation: fadeIn .3s ease;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: var(--shadow-lg);
}

/* ---- Room Viewer Modal ---- */
.room-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(58,79,94,.4);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.room-modal.open {
  display: flex;
  animation: fadeIn .3s ease;
}

.room-modal-inner {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  display: flex;
  flex-direction: column;
}

.room-modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--text-light);
  cursor: pointer;
}

.room-modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1.25rem;
}

/* ---- Order Print Modal ---- */
.order-modal-inner {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.order-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.order-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text);
}

.order-subtitle {
  font-size: .85rem;
  color: var(--text-light);
  margin-top: 2px;
}

.order-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.order-intro {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.order-preview {
  width: 120px;
  height: auto;
  max-height: 90px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
}

.order-intro-text {
  font-size: .85rem;
  color: var(--text);
  line-height: 1.55;
  margin: 0;
}

.order-section-label {
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: .25rem;
}

.order-section-sublabel {
  font-size: .78rem;
  color: var(--text-light);
  margin-bottom: .6rem;
  line-height: 1.4;
}

.order-sizes {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: var(--surface);
}

.order-size-row {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: .75rem;
}

.order-size-row:last-child { border-bottom: none; }

.order-size-dims {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.order-size-main {
  font-size: .92rem;
  color: var(--text);
}

.order-size-label {
  font-size: .78rem;
  color: var(--text-light);
  margin-left: .5rem;
}

.order-size-quality {
  font-size: .78rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.order-size-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.order-size-action {
  font-size: .78rem;
  padding: .4rem .7rem;
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, border-color .2s;
}

.order-size-action-primary {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--surface);
}

.order-size-action-primary:hover {
  background: var(--accent);
  color: #fff;
}

.order-size-action-secondary {
  color: var(--text);
  border-color: var(--text-light);
  background: var(--surface);
}

.order-size-action-secondary:hover {
  background: var(--warm);
  border-color: var(--text);
}

.order-size-empty {
  padding: 1rem;
  font-size: .85rem;
  color: var(--text-light);
  line-height: 1.5;
}

.order-note {
  background: var(--warm);
  border-radius: 6px;
  padding: .8rem .9rem;
  margin-bottom: 0;
  font-size: .82rem;
  color: var(--text);
  line-height: 1.55;
}

.order-note-title {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 2px;
}

.order-note-link {
  color: var(--accent);
  text-decoration: none;
}

.order-note-link:hover {
  text-decoration: underline;
}

@media (max-width: 520px) {
  .order-intro { flex-direction: column; }
  .order-preview { width: 100%; max-height: 140px; }
  .order-size-row { grid-template-columns: 1fr; }
  .order-size-action { justify-self: start; }
}

/* Room tabs */
.room-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.room-tab {
  padding: .5rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: transparent;
  font-family: var(--font-body);
  font-size: .8rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all .3s;
}

.room-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.room-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.room-tab-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  align-self: center;
}

.room-tab-upload {
  border-style: dashed !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

.room-tab-upload:hover {
  background: var(--accent) !important;
  color: #fff !important;
  border-style: solid !important;
}

/* Photo room background */
.room-scene.photo-room {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Room scene */
.room-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  max-height: 50vh;
  border-radius: var(--radius);
  overflow: hidden;
  background: #E8E4DF;
  flex-shrink: 0;
}

.room-wall {
  position: absolute;
  inset: 0;
  bottom: 35%;
  transition: background .5s ease;
}

.room-floor {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 35%;
  transition: background .5s ease;
}

.room-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.room-art-container {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width .35s ease;
  cursor: grab;
  user-select: none;
}

.room-art-shadow {
  position: absolute;
  top: 6px;
  left: 6px;
  right: -6px;
  bottom: -6px;
  background: rgba(0,0,0,.15);
  filter: blur(12px);
  border-radius: 2px;
  z-index: -1;
  transition: all .35s ease;
}

.room-art-frame {
  transition: padding .3s ease, border .3s ease, box-shadow .3s ease;
  line-height: 0;
  position: relative;
  z-index: 1;
}

.room-art-frame img {
  width: 100%;
  display: block;
}

.room-furniture {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* Room controls row */
.room-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.25rem;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ---- New structured control panel (frame/mat rows + dimensions readout) ---- */
.control-panel {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  align-items: center;
}

.cp-left {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  min-width: 0;
}

.cp-row {
  display: grid;
  grid-template-columns: 42px auto 1fr;
  align-items: center;
  gap: .9rem;
  min-width: 0;
}

.cp-row > .selector-label {
  font-size: .7rem;
}

.cp-slider-group {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
}

.cp-slider-group > .selector-label {
  font-size: .7rem;
}

.cp-slider-group .size-slider {
  flex: 1 1 auto;
  width: auto;
  min-width: 70px;
}

.cp-right {
  border-left: 1px solid var(--border);
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-self: stretch;
  justify-content: center;
}

.cp-info-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cp-info-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-light);
}

.cp-info-value {
  font-size: .92rem;
  color: var(--text);
}

.cp-info-quality {
  font-size: .72rem;
  margin-top: 2px;
}

.room-control-group {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.print-quality-readout {
  font-family: var(--font-body);
  font-size: .75rem;
  color: var(--text-light);
  white-space: nowrap;
  min-height: 1.2em;
}

.size-slider {
  width: 100px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.size-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.wall-colors {
  display: flex;
  gap: .4rem;
}

.wall-color-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform .2s, border-color .3s;
  padding: 0;
}

.wall-color-btn:hover { transform: scale(1.15); }
.wall-color-btn.active { border-color: var(--accent); }

/* Room frame selector in controls */
.room-frame-selector {
  margin-top: 0;
}

/* ---- Mat Controls ---- */
.mat-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  align-items: center;
}

.mat-control-group {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.mat-colors {
  display: flex;
  gap: .4rem;
}

.mat-color-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform .2s, border-color .3s;
  padding: 0;
}

.mat-color-btn:hover { transform: scale(1.15); }
.mat-color-btn.active { border-color: var(--accent); }

/* Mat overlay on artwork */
.artwork-mat {
  background: #FFFFFF;
  padding: 0;
  line-height: 0;
  transition: padding .35s ease, background-color .35s ease;
  box-shadow:
    inset 2px 2px 4px rgba(0,0,0,.12),
    inset -1px -1px 2px rgba(0,0,0,.04);
}

.artwork-mat img {
  box-shadow: 0 0 0 1px rgba(255,255,255,.65), 0 0 3px 1px rgba(0,0,0,.15);
}

.room-art-mat {
  background: #FFFFFF;
  padding: 0;
  line-height: 0;
  transition: padding .35s ease, background-color .35s ease;
  box-shadow:
    inset 2px 2px 4px rgba(0,0,0,.12),
    inset -1px -1px 2px rgba(0,0,0,.04);
}

.room-art-mat img {
  box-shadow: 0 0 0 1px rgba(255,255,255,.65), 0 0 3px 1px rgba(0,0,0,.15);
}

/* Weave/linen mat texture — fiber-like surface, warm natural tone */
.mat-weave {
  background-color: #EADFC8 !important;
  background-image:
    repeating-linear-gradient(90deg,
      rgba(120,95,60,.10) 0px,
      rgba(120,95,60,.10) 1px,
      transparent 1px,
      transparent 3px),
    repeating-linear-gradient(0deg,
      rgba(130,100,65,.12) 0px,
      rgba(130,100,65,.12) 1px,
      transparent 1px,
      transparent 3px),
    repeating-linear-gradient(45deg,
      rgba(100,80,50,.04) 0px,
      rgba(100,80,50,.04) 2px,
      transparent 2px,
      transparent 5px);
}


/* ---- About Page ---- */
.about-page {
  padding: calc(var(--nav-h) + 4rem) clamp(1.5rem, 4vw, 3rem) 6rem;
  max-width: 900px;
  margin: 0 auto;
}

.about-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  align-items: start;
}

.about-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.about-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 300;
  margin-bottom: 1.5rem;
}

.about-bio {
  font-size: .95rem;
  line-height: 1.9;
  color: var(--text);
}

.about-bio p + p { margin-top: 1.25rem; }

.about-links {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.social-link {
  font-size: .9rem;
  color: var(--accent);
  transition: color .3s;
}

.social-link:hover { color: var(--accent-hover); }

/* ---- Contact Page ---- */
.contact-page {
  padding: calc(var(--nav-h) + 4rem) clamp(1.5rem, 4vw, 3rem) 6rem;
  max-width: 700px;
  margin: 0 auto;
}

.contact-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 300;
  margin-bottom: .75rem;
}

.contact-text {
  color: var(--text-light);
  font-size: .95rem;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: .5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .3s, box-shadow .3s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(137,180,209,.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

.form-group.has-error input,
.form-group.has-error textarea {
  border-color: #D4726A;
}

.field-error {
  display: block;
  margin-top: .35rem;
  font-size: .8rem;
  color: #D4726A;
}

.submit-btn {
  display: inline-block;
  padding: .85rem 2.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .03em;
  cursor: pointer;
  transition: background .3s, transform .2s;
}

.submit-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ---- Flash Messages ---- */
.flash-messages {
  position: fixed;
  top: var(--nav-h);
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  width: 100%;
  max-width: 500px;
  padding: 0 1rem;
}

.flash {
  margin-top: .5rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  font-size: .9rem;
  animation: slideDown .4s ease;
}

.flash-success {
  background: #E8F5ED;
  color: #2D6A4F;
  border: 1px solid #B7E4C7;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem clamp(1.5rem, 4vw, 3rem);
  background: var(--surface);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  color: var(--text-light);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  transition: color .3s;
}

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

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Room Viewer Page ---- */
.room-viewer-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  padding-top: calc(var(--nav-h) + 1rem);
}

.rv-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: .25rem;
}

.rv-subtitle {
  color: var(--text-light);
  font-size: .85rem;
  margin-bottom: 1rem;
}

.rv-tabs {
  margin-bottom: .75rem;
}

.rv-main {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-bottom: .75rem;
  align-items: flex-start;
}

.rv-scene-col {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.rv-scene {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #E8E4DF;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  touch-action: none;
}

.rv-picker-col {
  flex: 0 0 180px;
  display: flex;
  flex-direction: column;
  max-height: 55vh;
}

.rv-picker-label {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.rv-picker {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  overflow-y: auto;
  flex: 1;
  padding-right: .25rem;
  scrollbar-width: thin;
}

.rv-picker::-webkit-scrollbar {
  width: 5px;
}
.rv-picker::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.rv-picker-thumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  padding: 3px;
  transition: border-color .2s, background .2s;
  text-align: left;
}

.rv-picker-thumb:hover {
  border-color: var(--accent);
  background: var(--warm);
}

.rv-picker-thumb img {
  width: 55px;
  height: 38px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.rv-picker-title {
  font-family: var(--font-body);
  font-size: .7rem;
  color: var(--text);
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rv-piece-selected {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.rv-piece-frame {
  line-height: 0;
}

.rv-piece-mat {
  background: #FFFFFF;
  padding: 0;
  line-height: 0;
  box-shadow: inset 2px 2px 4px rgba(0,0,0,.15), inset -1px -1px 2px rgba(0,0,0,.04);
}

.rv-piece-mat img {
  box-shadow: 0 0 0 1px rgba(255,255,255,.65), 0 0 3px 1px rgba(0,0,0,.15);
}

.rv-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
}

.rv-controls-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
}

.rv-selected-label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  min-width: 80px;
}

.rv-remove-btn {
  background: none;
  border: 1px solid #C44;
  color: #C44;
  border-radius: 50px;
  padding: .3rem .7rem;
  font-family: var(--font-body);
  font-size: .7rem;
  cursor: pointer;
  transition: all .2s;
}

.rv-remove-btn:hover {
  background: #C44;
  color: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    gap: 1rem;
    animation: slideDown .3s ease;
  }
  .nav-toggle { display: flex; }

  .gallery-grid { columns: 2; }
  .detail-layout { grid-template-columns: 1fr; }
  .about-layout { grid-template-columns: 1fr; }

  .room-art-container { width: 35%; }
  .room-controls { flex-direction: column; align-items: flex-start; }

  .control-panel {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .cp-right {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 1rem;
    flex-direction: row;
    gap: 1.5rem;
    flex-wrap: wrap;
  }
  .cp-row { grid-template-columns: 42px 1fr; row-gap: .5rem; }
  .cp-row > .frame-options,
  .cp-row > .mat-colors { grid-column: 2; }
  .cp-slider-group { grid-column: 1 / -1; }

  .rv-main { flex-direction: column; }
  .rv-picker-col { flex: none; max-height: none; }
  .rv-picker { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .rv-picker-thumb { flex: 0 0 auto; width: auto; min-width: 110px; }
}

@media (max-width: 480px) {
  .gallery-grid { columns: 1; }
  .featured-grid { grid-template-columns: 1fr; }
}
