:root {
  --bg: #363636;
  --fg: #f6f6f6;
  --muted: #6b7280;
  --border: rgb(28, 28, 28);
  --navbar: rgba(33, 33, 33, 0.5);
  --accent: #e5e7eb;
  --radius: 8px;               /* overall radius */
  --shadow: 0 10px 25px rgba(0,0,0,.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
}

.container { width: min(1300px, 92vw); margin-inline: auto; }
.section { padding: clamp(2rem, 4vw, 3.5rem) 0; }

/* TYPOGRAPHY */
h1, h2, h3 { line-height: 1.15; margin: 0 0 .6em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.4rem); }

.muted { color: var(--muted); }

/* NAVBAR */
.site-nav {
  --nav-height: 72px;
  --nav-height-scrolled: 56px;

  position: fixed; inset: 0 0 auto 0; height: var(--nav-height);
  background: var(--navbar);
  backdrop-filter: blur(2px);
  z-index: 900;
  transition: background .25s ease, height .25s ease, border-color .25s ease;
}

.site-nav.is-scrolled {
  height: var(--nav-height-scrolled);
  background: var(--border);
  backdrop-filter: none;
}

.site-nav__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
}

.nav__logo { display: inline-flex; align-items: center; gap: .5rem; }
.nav__logo img {
  display: block;
  width: 44px; height: 44px;
  transition: height .25s ease, width .25s ease;
}
.site-nav.is-scrolled .nav__logo img { width: 30px; height: 30px; }

.nav__title {
  justify-self: center;
  font-weight: 700;
  text-decoration: none; color: inherit;
  transition: transform .25s ease, opacity .25s ease, font-size .25s ease;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  opacity: 0.001;
}
.site-nav.is-scrolled .nav__title {
  font-size: clamp(1rem, 2vw, 1.15rem);
  opacity: .95;
}

.nav__links {
  justify-self: end;
  display: grid;
  grid-auto-flow: column;
  gap: 1rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav__links a {
  font-size: .95rem;
  text-decoration: none; color: inherit;
  padding: .35rem .5rem;
  border-radius: 6px;
}
.nav__links a:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

.section, [id] { scroll-margin-top: var(--nav-height); }

/* HERO SECTION */
.banner {
  position: relative;
  min-height: 85vh;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0)),
    url('../images/background.jpg') center/cover no-repeat;
}
.banner__content { text-align: center; padding: 3rem 1rem; }
.banner__title { font-weight: 800; text-shadow: 0 8px 30px rgba(0,0,0,.4); }
.banner__subtitle { opacity: .9; font-weight: 500; margin-bottom: 1rem; }
.banner__cta {
  display: inline-block;
  background: #fff; color: #111;
  padding: .7rem 1rem; border-radius: 9999px; text-decoration: none; font-weight: 600;
  box-shadow: var(--shadow);
}

/* ABOUT SECTION */
.about { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.about__image {
  background: url('../images/placeholder.svg') center/cover no-repeat;
  border-radius: var(--radius);
  min-height: 260px;
}
.about__copy { align-self: center; }
@media (min-width: 900px) {
  .about { grid-template-columns: 1fr 1.2fr; gap: 2rem; }
}

/* CATEGORY NAV */
.category-nav {
  position: static;
  border-bottom: 1px solid var(--border);
  background: transparent;
  backdrop-filter: none;
}
.category-nav__list {
  display: flex; gap: .5rem; flex-wrap: wrap; padding: .6rem 0; margin: 0;
  list-style: none;
}
.category-nav__link {
  display: inline-block; padding: .4rem .7rem; border: 1px solid var(--border); border-radius: 9999px;
  text-decoration: none; color: inherit; font-size: .95rem;
}
.category-nav__link:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

/* GALLERY */
#gallery-root { display: block; }
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 3rem;
  row-gap: 5rem;
  grid-auto-flow: dense;
}

.tile {
  display: grid;
  gap: .65rem;
  padding: 0;
  color: var(--fg);
  cursor: pointer;
  transition: opacity .35s ease, transform .25s ease;
  transform-origin: center;
  align-content: center;
  justify-items: center;
}
.tile:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }

.tile__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.01em;
  justify-self: center;
  text-align: center;
  width: fit-content;
  max-width: 100%;
}

.tile__media {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-height: 500px;
  justify-self: center;
  width: fit-content;
  max-width: 100%;
}

.tile__img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  max-height: min(500px, 100%);
  display: block;
  object-fit: contain;
  opacity: 0;
}

.tile:hover,
.tile:focus-visible {
  transform: scale(1.02);
}

.tile--double {
  grid-column: span 2;
}

.tile__meta {
  display: grid;
  gap: .25rem;
  margin: 0;
  justify-items: start;
  justify-self: center;
  width: fit-content;
  max-width: 100%;
}

.tile__meta-entry {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: start;
  align-items: baseline;
  gap: .6rem;
  font-size: .9rem;
  color: var(--muted);
}

.tile__meta-entry dt { font-weight: 600; color: var(--fg); }
.tile__meta-entry dd {
  margin: 0;
  text-align: left;
  color: #d1d5db;
}

@media (max-width: 700px) {
  .tile--double {
    grid-column: span 1;
  }
}

/* Section headings per category */
.category-block { display: block; width: 100%; margin: 2.5rem 0 1rem; }
.category-block__title {
  margin-bottom: 2rem;
  padding-bottom: .6rem;
  font-weight: 800; 
  border-bottom: 1px solid var(--border);
}

/* ARTWORK DETAIL LAYOUT */
/* Artwork detail layout */
.artwork {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  margin: 0;
  align-items: start;
}

.artwork > * { min-width: 0; }

.artwork__image {
  display: grid;
  place-items: center;
  width: 100%;
  max-height: 78vh;
  overflow: hidden;
}

.artwork__image img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.artwork__meta {
  display: grid;
  gap: clamp(.75rem, 2vw, 1.75rem);
  align-content: start;
  color: var(--fg);
}

.meta {
  display: grid;
  gap: .35rem;
}

.meta dt {
  font-weight: 600;
  letter-spacing: .01em;
}

.meta dd {
  margin: 0 0 .2rem;
  color: var(--muted);
}

.actions {
  margin-top: auto;
  display: flex;
  gap: .75rem;
}

.actions { margin-top: .6rem; }
.button {
  display: inline-block; padding: .6rem .9rem; border-radius: 10px; background: #111; color: #fff; text-decoration: none; font-weight: 600;
}
.button[aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
  cursor: not-allowed;
}

/* ARTWORK PAGE WRAPPER */
.artwork-page { display: block; }
.artwork-page__section {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-top: clamp(6rem, 14vh, 7rem);
}
.artwork-page__back {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
}
.artwork-page__back::before { content: "\2190"; }
.artwork-page__back:focus-visible,
.artwork-page__back:hover { text-decoration: underline; }

.artwork-page__panel {
  background: transparent;
  color: var(--fg);
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.artwork-page__panel[hidden] { display: none !important; }
.artwork-page__panel .artwork { height: auto; }
.artwork-page__panel .artwork__meta { overflow: visible; }
.artwork-page__panel .artwork__meta h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  letter-spacing: -.015em;
}
.artwork-page__panel .artwork__meta p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.artwork-page__title {
  margin: 0 0 clamp(1rem, 3vw, 1.75rem);
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  letter-spacing: -.015em;
}
.artwork-page__panel .meta { gap: .8rem; }
.artwork-page__panel .meta dt { display: inline; }
.artwork-page__panel .meta dt::after { content: ": "; }
.artwork-page__panel .meta dd {
  display: inline;
  margin: 0;
  color: var(--fg);
  opacity: .85;
}
.artwork-page__desc {
  margin: clamp(1.5rem, 4vw, 2.5rem) 0 0;
  max-width: 70ch;
  line-height: 1.6;
}
.artwork-page__desc[hidden] { display: none; }

.decision { display: grid; gap: .5rem; margin-top: 1rem; }
.decision__title { margin: 0; font-size: 1.4rem; font-weight: 500; }
.artwork-page__panel .decision p { margin: 0; line-height: 1.5; color: var(--fg); opacity: .85; }
.decision .actions { flex-wrap: wrap; }
.button--ghost {
  background: transparent;
  color: var(--fg);
  box-shadow: inset 0 0 0 1px currentColor;
}
.button[hidden] { display: none; }

.larger-sizes {
  margin-top: clamp(1rem, 3vw, 2rem);
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border-radius: var(--radius);
  background: #ececec;
  color: #222;
}
.larger-sizes[hidden] { display: none; }
.larger-sizes h2 { margin: 0 0 1rem; font-weight: 500; }
.larger-sizes p { margin: 0 0 1rem; max-width: 70ch; line-height: 1.6; }
.larger-sizes__note { font-weight: 600; margin-bottom: 0 !important; }
.larger-sizes__actions { margin-top: 1.5rem; }
.larger-sizes__actions:not(:has(.button:not([hidden]))) { display: none; }

.artwork-page__empty {
  color: var(--muted);
}

/* Footer */
.footer {
  padding: 2rem 0;
  color: var(--muted);
  font-size: .95rem;
  border-top: 1px solid var(--border);
}
.footer .app-version {
  opacity: .3;
  margin-left: .5rem;
  font-size: .85rem;
}

/* RESPONSIVE */
@media (max-width: 800px) {
  .artwork {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
  }
  .artwork__image { max-height: 60vh; }
  .artwork__meta { overflow: visible; }
  .artwork-page__panel { padding: 1rem; }
  .artwork-page__panel .artwork__meta h1 {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
  }
}

/* Utilities */
.fade-in { opacity: 1 !important; }
.hidden { display: none !important; }
