:root {
  --paper: #101515;
  --cream: #171d1d;
  --ink: #f2efea;
  --muted: #aaa9a4;
  --petrol: #168b88;
  --rose: #d17aa8;
  --champagne: #b88755;
  --line: #303b3a;
  --shadow: 0 22px 65px rgba(0, 0, 0, 0.48);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: radial-gradient(circle at 84% 2%, rgba(22,139,136,.14), transparent 28%), linear-gradient(145deg, #111616 0, #0b0e0f 58%, #171014 100%);
  color: var(--ink);
  font:
    16px/1.55 "DM Sans",
    sans-serif;
  min-height: 100vh;
}
.masthead {
  min-height: 46vh;
  padding: clamp(32px, 6vw, 90px);
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: end;
  gap: 40px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.masthead:after {
  content: "";
  position: absolute;
  width: 34vw;
  height: 34vw;
  border: 1px solid rgba(22, 139, 136, 0.28);
  border-radius: 50%;
  right: -9vw;
  top: -14vw;
  box-shadow:
    0 0 0 4vw rgba(209, 122, 168, 0.055),
    0 0 0 9vw rgba(184, 135, 85, 0.045);
}
.brand,
.intro {
  position: relative;
  z-index: 1;
}
.eyebrow {
  color: var(--rose);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.brand h1 {
  font:
    600 clamp(4.2rem, 11vw, 10rem)/0.82 "Playfair Display",
    serif;
  letter-spacing: -0.055em;
  margin: 0.18em 0 0.06em;
}
.brand > p {
  margin: 0;
  color: var(--petrol);
  font:
    italic 500 clamp(1.5rem, 3vw, 2.8rem)/1.1 "Playfair Display",
    serif;
}
.intro {
  max-width: 390px;
  justify-self: end;
}
.intro p {
  font:
    500 clamp(1.05rem, 1.6vw, 1.35rem)/1.45 "DM Sans",
    sans-serif;
}
.intro span {
  display: inline-block;
  border-top: 1px solid var(--petrol);
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
main {
  padding: 0 clamp(20px, 5vw, 80px) 80px;
}
.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 14, 15, 0.91);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 0;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filters button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 16px;
  font: 600 0.83rem "DM Sans";
  cursor: pointer;
}
.filters button:hover,
.filters button.active {
  background: var(--petrol);
  border-color: var(--petrol);
  color: white;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.search input {
  width: min(260px, 35vw);
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  padding: 8px 3px;
  font: inherit;
  color: var(--ink);
  outline: none;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(18px, 2.5vw, 36px);
}
.card {
  grid-column: span 4;
  background: rgba(23, 29, 29, 0.9);
  border: 1px solid var(--line);
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.27);
  transition:
    0.3s transform,
    0.3s box-shadow;
  cursor: pointer;
  min-width: 0;
}
.card:nth-child(7n + 1),
.card:nth-child(7n + 5) {
  grid-column: span 5;
}
.card:nth-child(7n + 2),
.card:nth-child(7n + 4) {
  grid-column: span 3;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}
.visual {
  aspect-ratio: 4/5;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--tone1), var(--tone2));
}
.visual:before {
  content: "";
  position: absolute;
  width: 70%;
  height: 70%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  top: -20%;
  right: -20%;
  box-shadow:
    0 0 0 35px rgba(255, 255, 255, 0.1),
    0 0 0 70px rgba(255, 255, 255, 0.08);
}
.visual.missing {
  background: repeating-linear-gradient(
    135deg,
    #f5eee7,
    #f5eee7 18px,
    #eee3e3 18px,
    #eee3e3 19px
  );
}
.num {
  position: absolute;
  top: 18px;
  left: 18px;
  font: 600 2.2rem/1 "Playfair Display";
  color: rgba(36, 60, 61, 0.62);
}
.file-state {
  position: relative;
  z-index: 1;
  background: rgba(255, 253, 249, 0.9);
  padding: 9px 12px;
  max-width: 100%;
  font-size: 0.75rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.card-body {
  padding: 22px;
}
.kicker {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--rose);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.7rem;
}
.card h2 {
  font:
    600 clamp(1.45rem, 2vw, 2rem)/1.08 "Playfair Display",
    serif;
  margin: 0.55rem 0;
}
.style {
  color: var(--muted);
  font-size: 0.9rem;
}
.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: #242c2b;
  color: #bdbbb5;
  font-size: 0.72rem;
}
.pill.image {
  background: rgba(22, 139, 136, 0.18);
  color: #80d2cf;
}
.pill.highlight {
  background: rgba(209, 122, 168, 0.17);
  color: #efacd0;
}
.empty {
  text-align: center;
  padding: 70px;
  color: var(--muted);
}
dialog {
  width: min(820px, calc(100% - 28px));
  max-height: 90vh;
  border: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 25px 100px rgba(0, 0, 0, 0.7);
}
dialog::backdrop {
  background: rgba(2, 5, 5, 0.82);
  backdrop-filter: blur(5px);
}
.close {
  position: sticky;
  float: right;
  top: 14px;
  right: 14px;
  z-index: 5;
  border: 0;
  background: var(--ink);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
}
.detail-visual {
  height: 220px;
  background: linear-gradient(125deg, #d6b9c8, #d7c099, #71a2a0);
  display: flex;
  align-items: flex-end;
  padding: 28px;
}
.detail-visual span {
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  font-size: 0.78rem;
}
.detail-content {
  padding: clamp(26px, 5vw, 58px);
}
.detail-content h2 {
  font:
    600 clamp(2.4rem, 6vw, 4.7rem)/0.95 "Playfair Display",
    serif;
  margin: 0 0 12px;
}
.detail-content h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--rose);
  margin: 28px 0 8px;
}
.notice {
  border-left: 3px solid var(--champagne);
  padding: 12px 16px;
  background: #202525;
  color: #c9c6bf;
}
.quote {
  font:
    italic 500 1.25rem/1.5 "Playfair Display",
    serif;
  white-space: pre-line;
}
.copy {
  border: 1px solid var(--petrol);
  background: var(--petrol);
  color: #fff;
  border-radius: 4px;
  padding: 10px 14px;
  font: 600 0.8rem "DM Sans";
}
.copy:disabled {
  border-color: var(--line);
  background: #282e2e;
  color: #8f918e;
  cursor: not-allowed;
}
footer {
  padding: 32px clamp(20px, 5vw, 80px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.visit-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 560px;
  margin: 0 auto 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}
.visit-stats.public-counter { grid-template-columns: 1fr; max-width: 260px; }

.visit-stats div {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 1rem;
  text-align: center;
}

.visit-stats div + div { border-left: 1px solid rgba(255, 255, 255, 0.1); }
.visit-stats strong { font: 600 1.15rem/1.2 "DM Sans", sans-serif; }
.visit-stats span { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }

@media (max-width: 520px) {
  .visit-stats { border-radius: 18px; margin-bottom: 1.5rem; }
  .visit-stats div { padding: 0.7rem 0.45rem; }
}
@media (max-width: 900px) {
  .masthead {
    grid-template-columns: 1fr;
    min-height: 52vh;
  }
  .intro {
    justify-self: start;
  }
  .card,
  .card:nth-child(n) {
    grid-column: span 6;
  }
}
@media (max-width: 620px) {
  .masthead {
    padding: 35px 20px;
    min-height: 45vh;
  }
  .brand h1 {
    font-size: 4.15rem;
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .search {
    justify-content: space-between;
  }
  .search input {
    width: 75%;
  }
  .card,
  .card:nth-child(n) {
    grid-column: span 12;
  }
  .visual {
    aspect-ratio: 4/3;
  }
  footer {
    flex-direction: column;
  }
}
.card,
.card:nth-child(n) {
  grid-column: span 3;
}
@media (max-width: 900px) {
  .card,
  .card:nth-child(n) {
    grid-column: span 6;
  }
}
@media (max-width: 620px) {
  .card,
  .card:nth-child(n) {
    grid-column: span 12;
  }
  .visual {
    aspect-ratio: 9/16;
  }
}
.masthead {
  min-height: auto;
  padding: clamp(28px, 4vw, 58px) clamp(20px, 5vw, 80px);
  align-items: center;
}
.brand h1 {
  font-size: clamp(3.6rem, 8vw, 7rem);
  margin: 0.16em 0 0;
}
.intro {
  align-self: center;
}
.visual {
  aspect-ratio: 9/16;
  background: var(--cream);
}
.language-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.language-switch button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font: 600 0.78rem "DM Sans";
  cursor: pointer;
}
.language-switch button.active {
  background: var(--petrol);
  border-color: var(--petrol);
  color: #fff;
}
.social-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.social-links a {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
  font: 600 1rem/1 "DM Sans", sans-serif;
  text-decoration: none;
  transition: 0.2s color, 0.2s border-color, 0.2s background, 0.2s transform;
}
.social-links a:hover,
.social-links a:focus-visible {
  color: #fff;
  background: var(--petrol);
  border-color: var(--petrol);
  transform: translateY(-2px);
  outline: none;
}
.social-links-footer {
  margin: 0;
}
.social-links-footer a {
  width: 32px;
  height: 32px;
}
.footer-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px 14px; }
.footer-tools button, .studio-link {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 11px;
  font: 500 .68rem "DM Sans", sans-serif;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
}
.footer-tools button:hover, .footer-tools button:focus-visible, .studio-link:hover, .studio-link:focus-visible { color: #fff; border-color: var(--petrol); outline: none; }
.social-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px clamp(20px, 5vw, 80px);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 14, 15, 0.96);
}
.social-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  font: 600 0.86rem "DM Sans", sans-serif;
  text-decoration: none;
}
.social-bar a span {
  color: var(--rose);
  font-size: 1.2rem;
}
.social-bar a:hover,
.social-bar a:focus-visible {
  color: #fff;
  background: var(--petrol);
  border-color: var(--petrol);
  outline: none;
}
.social-bar a:hover span,
.social-bar a:focus-visible span {
  color: #fff;
}

/* Compact desktop gallery: five complete 9:16 artworks per row. */
@media (min-width: 1200px) {
  .gallery {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(14px, 1.5vw, 24px);
  }
  .card,
  .card:nth-child(n) {
    grid-column: auto;
  }
}
