/* Unplug Art Studio — shared styles for index.html and index-zh.html */

:root {
  --bg: #f8f6f1;
  --accent: #f39161;
  --accent-dark: #c45f30;
  --text: #1f1f1f;
  --muted: #6d6b68;
  --surface: #ffffff;
  --line: rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Source Sans 3', 'Source Sans Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html[lang="zh-Hans"] body {
  font-family: 'Source Sans 3', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

figure {
  margin: 0;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 96px;
}

/* Header ---------------------------------------------------------------- */

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 246, 241, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 30px;
  height: 30px;
  flex: none;
}

.logo-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  line-height: 1;
}

.logo-name small {
  display: block;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

html[lang="zh-Hans"] .logo-name small {
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

nav a {
  color: var(--muted);
  position: relative;
  padding-bottom: 6px;
  transition: color 0.2s ease;
}

nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

nav a:hover,
nav a:focus {
  color: var(--text);
}

nav a:hover::after,
nav a:focus::after {
  transform: scaleX(1);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  transition: border 0.2s ease, color 0.2s ease;
}

.lang-switch:hover,
.lang-switch:focus {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease, transform 0.2s ease;
}

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

.btn.primary:hover,
.btn.primary:focus {
  transform: translateY(-2px);
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn.ghost {
  border-color: var(--text);
  color: var(--text);
}

.btn.ghost:hover,
.btn.ghost:focus {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* Hero ------------------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px;
  align-items: center;
  padding: 96px 32px 64px;
}

.hero-copy .eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: var(--accent-dark);
  margin: 0 0 18px;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 4vw, 4.2rem);
  line-height: 1.1;
  margin: 0 0 24px;
}

.hero .meta {
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 24px;
}

.hero p {
  margin: 0 0 32px;
  max-width: 440px;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-art {
  position: relative;
}

.hero-art figure {
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15);
}

.hero-art img {
  width: 100%;
  height: auto;
}

.hero-art::before {
  content: '';
  position: absolute;
  inset: -28px;
  z-index: -1;
  border-radius: 36px;
  background: linear-gradient(135deg, rgba(243, 145, 97, 0.18), rgba(0, 0, 0, 0.05));
}

/* Section headings ------------------------------------------------------ */

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 3rem);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 0 0 16px;
  text-align: center;
}

html[lang="zh-Hans"] .section-title {
  letter-spacing: 0.12em;
}

.section-subtitle {
  color: var(--muted);
  margin: 0 auto 48px;
  max-width: 560px;
  text-align: center;
}

/* Gallery --------------------------------------------------------------- */

.gallery {
  padding: 72px 0 40px;
}

.gallery-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: -16px 0 44px;
}

.gallery-jump a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: border-color 0.2s ease, color 0.2s ease;
}

html[lang="zh-Hans"] .gallery-jump a {
  letter-spacing: 0.08em;
  font-size: 0.88rem;
}

.gallery-jump a:hover,
.gallery-jump a:focus {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.gallery-section,
section[id] {
  scroll-margin-top: 84px;
}

.gallery-section {
  margin-bottom: 64px;
}

.gallery-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  letter-spacing: 0.04em;
  text-align: center;
  margin: 0 0 6px;
}

.gallery-blurb {
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto 28px;
}

.gallery-grid {
  column-count: 3;
  column-gap: 20px;
}

.gallery-tile {
  break-inside: avoid;
  margin: 0 0 20px;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #e6e2db;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.gallery-tile img {
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.gallery-tile:hover img,
.gallery-tile:focus-within img {
  transform: scale(1.02);
}

.gallery-tile .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 36px 18px 16px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0) 100%);
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.3;
}

html[lang="zh-Hans"] .gallery-tile .caption {
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

/* Feature --------------------------------------------------------------- */

.feature {
  padding: 80px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px;
  align-items: center;
}

.feature figure {
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 18px 64px rgba(0, 0, 0, 0.16);
}

.feature img {
  width: 100%;
  height: auto;
}

.feature-copy h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3vw, 3.1rem);
  margin: 0 0 20px;
}

.feature-copy p {
  max-width: 520px;
}

/* About ----------------------------------------------------------------- */

.about {
  padding: 80px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  align-items: center;
}

.about figure img {
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.1);
}

.about-card {
  background: var(--surface);
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
}

.about-card h3 {
  font-family: 'Playfair Display', serif;
  margin: 0 0 12px;
  font-size: 1.6rem;
}

/* Footer ---------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--line);
  padding-top: 48px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

footer p {
  margin: 0 0 10px;
}

.footer-mark {
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
}

.footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.footer-contact {
  margin-top: 22px;
  font-size: 0.85rem;
}

.footer-contact span {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  user-select: all;
}

.copyright {
  margin-top: 28px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Back to top ----------------------------------------------------------- */

.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.to-top.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover,
.to-top:focus {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* Lightbox: a framed, matted piece on a dark wall ----------------------- */

html.lb-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 72px 56px;
  background: radial-gradient(ellipse at 50% 40%, rgba(58, 52, 48, 0.96), rgba(22, 20, 19, 0.98));
}

.lightbox[hidden] {
  display: none;
}

.lb-figure {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}

/* Picture light: warm cone on the wall behind the frame ... */
.lb-figure::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -48px;
  width: 150%;
  height: 120%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 70% at 50% 0%, rgba(255, 221, 160, 0.30), rgba(255, 221, 160, 0.10) 45%, rgba(255, 221, 160, 0) 75%);
  pointer-events: none;
  z-index: 0;
}

.lb-frame {
  position: relative;
  z-index: 1;
  padding: 11px;
  background: linear-gradient(160deg, #4a3b33, #241c18 60%, #3a2d27);
  border-radius: 2px;
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.65),
    0 2px 6px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ... the brass fixture and its stem on top of the frame ... */
.lb-frame::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -30px;
  width: 38%;
  min-width: 110px;
  max-width: 260px;
  height: 11px;
  transform: translateX(-50%);
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #e2bd72 0%, #b8924d 45%, #6b4f24 100%);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 240, 200, 0.5);
  z-index: 3;
}

.lb-frame::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -20px;
  width: 6px;
  height: 20px;
  margin-left: -3px;
  background: linear-gradient(90deg, #5c4420, #c9a35b 50%, #5c4420);
  z-index: 2;
}

.lb-mat {
  position: relative;
  padding: clamp(14px, 3.2vw, 38px);
  background: #fbfaf7;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), inset 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ... and a gentle warm wash where the light meets the mat and painting. */
.lb-mat::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 228, 170, 0.22) 0%, rgba(255, 228, 170, 0.08) 30%, rgba(255, 228, 170, 0) 60%);
  pointer-events: none;
}

.lb-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, calc(100vw - 144px - 22px - 2 * clamp(14px, 3.2vw, 38px)));
  max-height: calc(100vh - 128px - 22px - 2 * clamp(14px, 3.2vw, 38px) - 56px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lb-img.is-loaded {
  opacity: 1;
}

.lb-caption {
  margin-top: 22px;
  display: flex;
  align-items: baseline;
  gap: 18px;
  color: rgba(248, 246, 241, 0.85);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
}

html[lang="zh-Hans"] .lb-caption {
  letter-spacing: 0.1em;
  font-size: 0.95rem;
}

.lb-full {
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(248, 246, 241, 0.5);
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(248, 246, 241, 0.3);
  padding: 0 0 1px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.lb-img {
  cursor: zoom-in;
}

/* Zoom in place: the original file, panned by scrolling, still on the wall. */
.lb-zoom {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  overflow: auto;
  background: rgba(22, 20, 19, 0.98);
  cursor: zoom-out;
  -webkit-overflow-scrolling: touch;
}

.lb-zoom[hidden] {
  display: none;
}

.lb-zoom-img {
  display: block;
  flex: none;
  margin: auto;
  max-width: none;
  padding: 24px;
}

.lb-zoom.is-loading .lb-zoom-img {
  opacity: 0;
}

.lb-zoom.is-loading::before {
  content: attr(data-loading);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(248, 246, 241, 0.6);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lb-zoom-hint {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(22, 20, 19, 0.7);
  color: rgba(248, 246, 241, 0.6);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.lightbox.is-zoomed .lb-prev,
.lightbox.is-zoomed .lb-next {
  display: none;
}

.lb-full:hover,
.lb-full:focus {
  color: var(--accent);
  border-color: var(--accent);
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 246, 241, 0.85);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover,
.lb-close:focus,
.lb-prev:focus,
.lb-next:focus {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.lb-close {
  top: 18px;
  right: 18px;
  z-index: 5;
}

.lb-prev {
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-next {
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

/* Responsive ------------------------------------------------------------ */

@media (min-width: 1440px) {
  .gallery-grid {
    column-count: 4;
  }
}

@media (max-width: 1024px) {
  .gallery-grid {
    column-count: 2;
  }
}

@media (max-width: 960px) {
  header {
    position: static;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 72px;
  }

  .hero-art {
    max-width: 640px;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 0 20px 80px;
  }

  .top-bar {
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .top-nav {
    width: 100%;
    justify-content: space-between;
  }

  nav {
    gap: 16px;
    font-size: 0.8rem;
  }

  .hero {
    padding: 48px 0 32px;
    gap: 40px;
  }

  .gallery-grid {
    column-count: 2;
    column-gap: 10px;
  }

  .gallery-tile {
    margin-bottom: 10px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  }

  .gallery-tile .caption {
    padding: 22px 10px 9px;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
  }

  html[lang="zh-Hans"] .gallery-tile .caption {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  .gallery-section {
    margin-bottom: 44px;
  }

  .gallery-jump {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }

  .gallery-jump a {
    text-align: center;
    padding: 10px 8px;
  }

  .to-top {
    right: 14px;
    bottom: 14px;
    width: 40px;
    height: 40px;
  }

  .lightbox {
    padding: 64px 16px 84px;
  }

  .lb-frame {
    padding: 7px;
  }

  .lb-frame::before {
    top: -22px;
    height: 9px;
    min-width: 90px;
  }

  .lb-frame::after {
    top: -14px;
    height: 14px;
    width: 5px;
    margin-left: -2.5px;
  }

  .lb-img {
    max-width: calc(100vw - 32px - 14px - 2 * clamp(14px, 3.2vw, 38px));
    max-height: calc(100vh - 148px - 14px - 2 * clamp(14px, 3.2vw, 38px) - 52px);
  }

  .lb-caption {
    margin-top: 16px;
    flex-direction: column;
    gap: 8px;
    font-size: 0.72rem;
  }

  .lb-close,
  .lb-prev,
  .lb-next {
    width: 42px;
    height: 42px;
  }

  .lb-close {
    top: 12px;
    right: 12px;
  }

  .lb-prev,
  .lb-next {
    top: auto;
    bottom: 16px;
    transform: none;
  }

  .lb-prev {
    left: calc(50% - 56px);
  }

  .lb-next {
    right: calc(50% - 56px);
  }

  .feature,
  .about {
    padding: 56px 0;
  }

  .about-card {
    padding: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .gallery-tile img,
  nav a::after {
    transition: none;
  }
}
