/* Maipo Ceramics — single stylesheet. Tokens first, then layout, then pages. */

@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/assets/fonts/jost-latin-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url('/assets/fonts/jost-latin-italic-var.woff2') format('woff2');
}

:root {
  --paper: #ffffff;
  --clay: #f4f2ee;        /* image placeholders, quiet surfaces */
  --line: #e6e3de;        /* hairlines */
  --ink: #3a3f44;         /* text */
  --ink-strong: #262a2e;  /* titles */
  --muted: #7a8086;       /* secondary text */
  --glaze: #a1c2d5;       /* the logo blue */
  --glaze-deep: #3d6784;  /* links, focus, hover: the blue of the pollock speckles */

  --font: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.125rem;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --header-h: 88px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  font-weight: 380;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { text-wrap: balance; font-weight: 400; color: var(--ink-strong); line-height: 1.25; margin: 0; letter-spacing: .01em; }
p { margin: 0 0 1em; }
strong, b { font-weight: 540; color: var(--ink-strong); }
ul { margin: 0; padding: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { color: var(--glaze-deep); }
:focus-visible { outline: 2px solid var(--glaze-deep); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-text { width: 100%; max-width: calc(680px + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink-strong); color: #fff; padding: 10px 16px; border-radius: 4px; text-decoration: none;
}
.skip:focus { top: 12px; color: #fff; }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 24px;
  border: 1px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  font: inherit; font-size: var(--step--1); letter-spacing: .04em;
  text-decoration: none; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .15s var(--ease);
}
.btn:hover { background: var(--ink-strong); border-color: var(--ink-strong); color: #fff; }
.btn:active { transform: translateY(1px); }

/* ------------------------------------------------------------ header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 24px; }

.brand { display: block; flex: none; }
.brand img { width: auto; height: 46px; }

.site-nav { display: flex; align-items: center; gap: 36px; }
.site-nav ul { list-style: none; display: flex; gap: 32px; }
.site-nav ul a {
  position: relative; display: inline-block; padding: 8px 0;
  font-size: 0.9375rem; letter-spacing: .03em; text-decoration: none; color: var(--ink);
}
.site-nav ul a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.site-nav ul a:hover { color: var(--glaze-deep); }
.site-nav ul a:hover::after, .site-nav ul a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav ul a[aria-current="page"] { color: var(--ink-strong); }

.insta {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-right: -12px; color: var(--ink); border-radius: 50%;
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.insta:hover { color: var(--glaze-deep); background: var(--clay); }

.menu-toggle {
  display: none; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px;
  background: none; border: 0; color: var(--ink); font: inherit; font-size: 0.9375rem; letter-spacing: .03em; cursor: pointer;
}
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after {
  display: block; width: 20px; height: 1px; background: currentColor; position: relative;
  transition: transform .3s var(--ease), background-color .2s;
}
.menu-toggle-bars::before, .menu-toggle-bars::after { content: ''; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  :root { --header-h: 72px; }
  .brand img { height: 38px; }
  .menu-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    visibility: hidden; opacity: 0; transform: translateY(-6px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s linear .25s;
  }
  .site-nav.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: 14px 0; font-size: var(--step-1); border-bottom: 1px solid var(--line); }
  .site-nav ul a::after { display: none; }
  .site-nav ul a[aria-current="page"] { color: var(--glaze-deep); }
  .insta { margin: 12px 0 0 -10px; }
}

/* ------------------------------------------------------------ footer */

.site-footer { margin-top: clamp(64px, 10vw, 120px); border-top: 1px solid var(--line); }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap;
  padding-top: 28px; padding-bottom: 32px; font-size: var(--step--1); color: var(--muted);
}
.footer-brand img { height: 28px; width: auto; opacity: .9; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; margin: 0; }
.footer-links a { color: var(--ink); text-decoration: none; }
.footer-links a:hover { color: var(--glaze-deep); text-decoration: underline; }
.footer-copy { margin: 0; }
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------ home: the gallery */

.is-home main { padding-top: 8px; }
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { position: relative; display: block; overflow: hidden; aspect-ratio: 3 / 2; background: var(--clay); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), opacity .4s var(--ease); }
.tile:hover img { transform: scale(1.03); }
.tile:focus-visible { outline-offset: 2px; }
@media (max-width: 1023px) { .home-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 639px) { .home-grid { grid-template-columns: 1fr; } }

/* One orchestrated moment: the gallery settles in on first load. */
@media (prefers-reduced-motion: no-preference) {
  .js .home-grid .tile { animation: settle .9s var(--ease) both; animation-delay: calc(min(var(--i), 11) * 55ms); }
  @keyframes settle { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* ------------------------------------------------------------ collection */

.page-head { text-align: center; padding: clamp(24px, 5vw, 56px) 0 clamp(16px, 3vw, 32px); }
.lede { max-width: 60ch; margin: 0 auto; font-size: var(--step-1); font-weight: 340; line-height: 1.6; color: var(--ink); }

.jump ul { list-style: none; display: flex; justify-content: center; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.jump a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: var(--step--1); letter-spacing: .04em;
  transition: border-color .25s var(--ease), color .25s var(--ease), background-color .25s var(--ease);
}
.jump a:hover { border-color: var(--glaze); background: #f3f7fa; color: var(--glaze-deep); }

.collection { padding-top: clamp(40px, 6vw, 72px); }
.collection-untitled { padding-top: clamp(28px, 4vw, 48px); }
.collection-title { text-align: center; font-size: var(--step-3); font-weight: 350; letter-spacing: .06em; margin-bottom: clamp(24px, 3vw, 40px); }

.cards { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 16px; }
@media (max-width: 1023px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 639px) { .cards { grid-template-columns: repeat(2, 1fr); gap: 28px 10px; } }

.card a { display: block; text-decoration: none; color: var(--ink); }
.card-img { display: block; overflow: hidden; aspect-ratio: 1; background: var(--clay); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.card-title {
  display: inline-block; margin-top: 12px; font-size: var(--step-0); font-weight: 400; color: var(--ink);
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: background-size .35s var(--ease), color .25s var(--ease);
}
.card a:hover .card-img img { transform: scale(1.035); }
.card a:hover .card-title { color: var(--glaze-deep); background-size: 100% 1px; }

/* ------------------------------------------------------------ item page */

.item {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px);
  align-items: start; padding-top: clamp(16px, 3vw, 32px);
}
.shots { display: grid; gap: 10px; }
.shot { display: block; background: var(--clay); cursor: zoom-in; }
.shot img { width: 100%; }
.shots-count { display: none; }

.item-info { position: sticky; top: calc(var(--header-h) + 24px); padding-top: 8px; }
.item-info.is-tall { position: static; }
.crumbs { display: flex; gap: 10px; font-size: var(--step--1); color: var(--muted); margin-bottom: 18px; letter-spacing: .02em; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--glaze-deep); text-decoration: underline; }
.item-title { font-size: var(--step-3); font-weight: 350; margin-bottom: 28px; }
.spec-title { font-size: var(--step-0); font-weight: 520; margin: 28px 0 4px; }
.spec-title:first-of-type { margin-top: 0; }
.spec { list-style: none; border-top: 1px solid var(--line); }
.spec li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.spec li.price { color: var(--ink-strong); font-weight: 480; }

.more { padding-top: clamp(72px, 10vw, 128px); }
.more-title { font-size: var(--step-2); font-weight: 350; letter-spacing: .05em; margin-bottom: 28px; }
.more-title a { text-decoration: none; }
.more-title a:hover { text-decoration: underline; }

@media (max-width: 899px) {
  .item { grid-template-columns: 1fr; gap: 24px; padding-top: 0; }
  .item-info { position: static; }
  .item-media { margin: 0 calc(-1 * var(--gutter)); position: relative; }
  .shots {
    display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .shots::-webkit-scrollbar { display: none; }
  .shot { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 5; }
  .is-single .shot { aspect-ratio: auto; }
  .shot img { height: 100%; object-fit: cover; }
  .shots-count {
    display: block; position: absolute; right: calc(var(--gutter) + 4px); bottom: 12px; margin: 0;
    padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .88);
    font-size: var(--step--1); color: var(--ink); font-variant-numeric: tabular-nums;
  }
}

/* ------------------------------------------------------------ stages */

.stage-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px);
  max-width: 1040px; margin: 0 auto; padding-top: clamp(24px, 5vw, 56px);
}
.stage-card { display: flex; flex-direction: column; align-items: flex-start; }
.stage-poster { display: block; width: 100%; overflow: hidden; background: var(--clay); margin-bottom: 24px; }
.stage-poster img { width: 100%; transition: transform 1s var(--ease); }
.stage-card:hover .stage-poster img { transform: scale(1.02); }
.stage-card p { flex: 1; max-width: 46ch; }
.stage-note { max-width: 640px; margin: clamp(56px, 8vw, 96px) auto 0; text-align: center; }
.stage-note p:last-child { margin-bottom: 0; }
@media (max-width: 719px) { .stage-cards { grid-template-columns: 1fr; gap: 56px; } }

.stage-head { text-align: center; padding-top: clamp(24px, 5vw, 56px); }
.stage-kicker { font-size: var(--step-1); font-weight: 450; letter-spacing: .18em; color: var(--ink-strong); }
.stage-emblem { width: min(300px, 70vw); margin: 20px auto 8px; }
.stage-sub { font-size: var(--step-1); line-height: 1.5; }

.prose h2 { font-size: var(--step-2); font-weight: 350; margin: clamp(48px, 7vw, 80px) 0 20px; }
.prose ul { list-style: none; margin: 0 0 1em; }
.prose ul li { position: relative; padding-left: 22px; margin-bottom: 6px; }
.prose ul li::before { content: ''; position: absolute; left: 2px; top: .75em; width: 8px; height: 1px; background: var(--glaze-deep); }
.prose a { color: var(--glaze-deep); }

.figs { display: grid; gap: 10px; margin-top: clamp(40px, 6vw, 64px); }
.figs-2 { grid-template-columns: 1fr 1fr; max-width: 1100px; }
.figs-3 { grid-template-columns: repeat(3, 1fr); max-width: 1100px; }
/* landscape 3:2 next to portrait 3:4: columns in proportion so the heights line up */
.figs-wide-tall { grid-template-columns: 2fr 1fr; }
.figs .shot img { width: 100%; }
@media (max-width: 639px) {
  .figs-2, .figs-3, .figs-wide-tall { grid-template-columns: 1fr; }
}

.program { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 40px; }
.program p { padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 639px) { .program { grid-template-columns: 1fr; } }

.team .person { padding-top: 4px; margin-bottom: 28px; }
.stage-end { width: min(360px, 80vw); margin: 48px auto 0; }

/* ------------------------------------------------------------ split pages: pop-up, about */

.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center;
  padding-top: clamp(16px, 4vw, 48px);
}
.split-media { background: var(--clay); }
.split-media img { width: 100%; }
.page-title { font-size: var(--step-2); font-weight: 400; letter-spacing: .14em; margin-bottom: 36px; }
.places { display: grid; gap: 32px; }
.place h2 { font-size: var(--step-1); font-weight: 500; margin-bottom: 8px; }
.place p { margin: 0; }

.split-about { align-items: start; }
.about-lede { font-size: var(--step-1); font-weight: 340; line-height: 1.6; color: var(--ink-strong); }
.signature { margin-top: 28px; font-style: italic; }
.contact-lines { margin-top: 28px; }
.contact-lines a { color: var(--glaze-deep); }

.newsletter { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.newsletter h2 { font-size: var(--step-1); font-weight: 450; margin: 0 0 14px; }
.newsletter label { display: block; font-size: var(--step--1); margin-bottom: 6px; }
.newsletter-row { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter input[type="email"] {
  flex: 1 1 220px; min-height: 44px; padding: 0 16px;
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .25s var(--ease);
}
.newsletter input[type="email"]:hover { border-color: #cfcac2; }
.newsletter input[type="email"]:focus { outline: none; border-color: var(--glaze-deep); box-shadow: 0 0 0 3px rgba(61, 103, 132, .15); }
.hp { position: absolute; left: -5000px; }

@media (max-width: 899px) {
  .split { grid-template-columns: 1fr; }
}

.notfound { text-align: center; padding-top: 80px; }

/* ------------------------------------------------------------ lightbox */

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .97);
  opacity: 0; visibility: hidden;
  transition: opacity .25s var(--ease), visibility 0s linear .25s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.lightbox img {
  max-width: calc(100vw - 160px); max-height: calc(100vh - 120px); width: auto; height: auto;
  object-fit: contain; transition: opacity .2s var(--ease);
}
.lightbox img.is-loading { opacity: 0; }
.lb-btn {
  position: absolute; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease);
}
.lb-btn:hover { background: var(--clay); color: var(--ink-strong); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 639px) {
  .lightbox img { max-width: 100vw; max-height: calc(100vh - 140px); }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
  .lb-count { bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
