/* iBathhouse. A quiet gallery. */

/* Font: Ibathhouse Hand, the studio's own typeface */
@font-face { font-family: "Ibathhouse Hand"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/IbathhouseHand-Regular.woff") format("woff"); }
@font-face { font-family: "Ibathhouse Hand"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/IbathhouseHand-Bold.woff") format("woff"); }
@font-face { font-family: "Ibathhouse Hand"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/IbathhouseHand-Italic.woff") format("woff"); }

/* Tokens */
:root {
  --wall: #FFFFFF;
  --ink: #000000;
  --muted: #000000;
  --rule: #000000;
  --accent: #000000;
  --accent-on-dark: #FFFFFF;
  --a: var(--accent);

  --serif: "Ibathhouse Hand", "Courier New", ui-monospace, monospace;
  --sans: "Ibathhouse Hand", "Courier New", ui-monospace, monospace;
  --mono: "Ibathhouse Hand", "Courier New", ui-monospace, monospace;

  --display: clamp(2.5rem, 1.3rem + 4.6vw, 5.5rem);
  --title: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem);
  --name: clamp(1.625rem, 1.4rem + 0.7vw, 2rem);
  --body: clamp(1.1875rem, 1.1rem + 0.3vw, 1.3125rem);
  --label: 0.875rem;

  --gutter: 16px;
  --max: 1320px;
  --measure: 56ch;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: clamp(5rem, 3rem + 8vw, 10rem);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --wall: #000000;
    --ink: #FFFFFF;
    --muted: #FFFFFF;
    --rule: #FFFFFF;
    --a: var(--accent-on-dark);
  }
}

@media (min-width: 768px) { :root { --gutter: 40px; } }
@media (min-width: 1200px) { :root { --gutter: 64px; } }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--ink); color: var(--wall); }

a { color: inherit; text-decoration-line: underline; text-decoration-color: var(--a); text-decoration-thickness: 1px; text-underline-offset: 0.22em; transition: text-decoration-thickness 160ms ease; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 1px; }

.skip { position: absolute; left: var(--gutter); top: -100px; background: var(--ink); color: var(--wall); padding: 0.5rem 0.75rem; font-family: var(--mono); font-size: var(--label); text-transform: uppercase; letter-spacing: 0.12em; text-decoration: none; z-index: 10; }
.skip:focus { top: 0.75rem; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Type roles */
.mono {
  font-family: var(--mono);
  font-size: var(--label);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--display);
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--title);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
em, .italic { font-style: italic; }
.display em, .title em { font-family: var(--serif); }
.lede { max-width: var(--measure); }
.muted { color: var(--muted); }

/* Frame */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
  .span-side { grid-column: 1 / span 3; }
  .span-main { grid-column: 4 / -1; }
  .span-text { grid-column: 4 / span 7; }
}

/* Header */
.site-header { padding: var(--space-3) 0; }
.site-header .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.wordmark { display: inline-block; line-height: 0; }
.wordmark img { height: 2.25rem; width: auto; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .wordmark img { filter: invert(1); mix-blend-mode: screen; } }
.nav ul { display: flex; gap: 0.25rem 1.25rem; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); padding: 0.5rem 0; display: inline-block; }
.nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--a); }

/* Sections */
.section { padding: var(--space-6) 0; border-top: 1px solid var(--rule); }
.section--first { border-top: 0; padding-top: clamp(4rem, 2rem + 10vw, 11rem); }
.section-head { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }
@media (min-width: 900px) { .section-head { margin-bottom: 0; position: sticky; top: var(--space-4); align-self: start; } }

/* The intro */
.intro .display { max-width: 22ch; }
.intro .display + .lede { margin-top: var(--space-4); }
.intro-meta { margin-top: var(--space-5); display: flex; gap: var(--space-2) var(--space-4); flex-wrap: wrap; }

/* ===== The catalogue label ===== */
.label {
  position: relative;
  padding-top: var(--space-2);
  max-width: 36ch;
}
.label::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 2.5rem; height: 1px;
  background: var(--ink);
}
.label__no { display: block; margin-bottom: var(--space-3); }
.label__name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--name);
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin-bottom: 0.4em;
}
.label__line { color: var(--ink); max-width: 34ch; }
.label__meta { display: block; margin-top: var(--space-2); }
.label__note { margin-top: var(--space-2); color: var(--muted); max-width: 34ch; }

/* Collections of labels */
.room + .room { margin-top: var(--space-6); }
.room-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; padding-bottom: var(--space-2); border-bottom: 1px solid var(--rule); margin-bottom: var(--space-5); }
.room-head .title { font-style: italic; }
.collection { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5) 24px; }
@media (min-width: 640px) { .collection { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) 32px; } }
@media (min-width: 1200px) { .collection { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Work */
.work-list > li { padding: var(--space-5) 0; border-top: 1px solid var(--rule); }
.work-list > li:first-child { border-top: 0; padding-top: 0; }
.work-item { display: grid; gap: var(--space-3); }
@media (min-width: 900px) { .work-item { grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); column-gap: 32px; } }
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.work-grid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: transparent; }

/* Plates: images on the wall */
.plates { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5) 32px; }
@media (min-width: 640px) { .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plate { margin: 0; }
.plate__img { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.plate__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: transparent; }
.plate figcaption { margin-top: var(--space-2); display: flex; gap: 0.75rem; }
.plate figcaption .mono:last-child { color: var(--ink); }
@media (min-width: 640px) {
  .plates--offset .plate:nth-child(even) { margin-top: var(--space-6); }
}

/* Lists with numbers (noticed, steps) */
.numbered > li { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0 var(--space-2); padding: var(--space-3) 0; border-top: 1px solid var(--rule); }
.numbered > li:last-child { border-bottom: 1px solid var(--rule); }
.numbered .mono { padding-top: 0.35em; }
.numbered p { max-width: var(--measure); }

/* Exhibition title (proposal) */
.exhibit { padding-top: clamp(4rem, 2rem + 10vw, 11rem); padding-bottom: var(--space-6); }
.exhibit .display { font-size: clamp(2.75rem, 1.6rem + 5vw, 6rem); }
.exhibit__rule { width: 6rem; height: 3px; background: var(--a); border: 0; margin: var(--space-4) 0 0; }
.exhibit .lede { margin-top: var(--space-4); }
.exhibit__by { margin-bottom: var(--space-3); }

/* Call to action */
.cta-line { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.cta {
  font-family: var(--serif);
  font-size: var(--title);
  line-height: 1.3;
  text-decoration-line: underline;
  text-decoration-color: var(--a);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}
.cta:hover { text-decoration-thickness: 3px; }
.cta--quiet { font-size: var(--body); font-family: var(--sans); text-decoration-thickness: 1px; }

/* Contact */
.contact-lines { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.contact-lines dt { margin-bottom: 0.25rem; }
.form { margin-top: var(--space-5); display: grid; gap: var(--space-4); max-width: 40rem; }
.field { display: grid; gap: 0.5rem; }
.field > label, .field > legend { font-family: var(--mono); font-size: var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 0; }
.field input[type="text"], .field input[type="email"], .field input[type="url"], .field textarea {
  font: inherit; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--rule); border-radius: 0;
  padding: 0.5rem 0; width: 100%;
}
.field textarea { resize: vertical; min-height: 5.5rem; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ink); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; box-shadow: 0 1px 0 0 var(--ink); }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.checks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.25rem 1.5rem; margin-top: 0.5rem; }
@media (min-width: 640px) { .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.check { display: flex; gap: 0.75rem; align-items: baseline; padding: 0.4rem 0; cursor: pointer; }
.check input { accent-color: var(--ink); width: 1rem; height: 1rem; margin: 0; flex: none; transform: translateY(0.15em); }
.check .mono { color: var(--muted); min-width: 1.75rem; }
.button {
  justify-self: start;
  font: inherit; font-weight: 500;
  color: var(--wall); background: var(--ink);
  border: 1px solid var(--ink); border-radius: 0;
  padding: 0.85rem 1.4rem; cursor: pointer;
}
.button:hover { background: transparent; color: var(--ink); }
.form-status { min-height: 1.5em; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: var(--space-4) 0 var(--space-5); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

/* Prose page (privacy) */
.prose { max-width: var(--measure); }
.prose p + p, .prose h2 + p { margin-top: var(--space-2); }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: var(--name); margin-top: var(--space-5); margin-bottom: var(--space-2); }

/* Viewer (click to view large) */
.viewer {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: var(--gutter); border: 0;
  background: var(--wall); color: var(--ink);
}
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--space-2); }
.viewer::backdrop { background: var(--wall); }
.viewer__bar { display: flex; justify-content: flex-end; }
.viewer__close { font-family: var(--mono); font-size: var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); background: none; border: 0; padding: 0.5rem 0; cursor: pointer; }
.viewer__img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-out; }
.viewer__cap { text-align: center; }

/* Motion: a soft rise, once. Only when JS is present and motion is welcome. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(8px); transition: opacity 400ms ease, transform 400ms ease; }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .viewer[open] { animation: fade 240ms ease; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}

/* Small refinements */
.mono a { text-transform: none; letter-spacing: 0.04em; }
@media (max-width: 899px) { .section-head { margin-bottom: var(--space-4); } }

/* ===== Worlds: a laptop that opens onto one of our own sites ===== */
.worlds .display { max-width: 16ch; }
.world { margin-top: var(--space-5); }
.laptop {
  --open: 1;
  width: min(100%, 880px);
  margin: 0 auto;
  perspective: 1800px;
}
.laptop__lid {
  transform-origin: 50% 100%;
  transform: rotateX(calc((1 - var(--open)) * -88deg));
  border: 10px solid var(--ink);
  border-bottom-width: 0;
  border-radius: 18px 18px 0 0;
  background: var(--ink);
  aspect-ratio: 16 / 10;
}
.laptop__screen { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; background: var(--wall); border-radius: 6px 6px 0 0; }
.laptop__screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.laptop__base {
  position: relative;
  height: 14px;
  width: 100%;
  background: var(--ink);
  border-radius: 0 0 22px 22px;
}
.laptop__base::before { content: ""; position: absolute; left: 50%; top: 0; width: 18%; height: 5px; transform: translateX(-50%); background: var(--wall); border-radius: 0 0 8px 8px; }
.world__label { margin: var(--space-4) auto 0; width: min(100%, 880px); display: grid; gap: var(--space-3); }
@media (min-width: 640px) { .world__label { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
.world__label .label { max-width: 44ch; }
.enter {
  font-family: var(--serif);
  font-size: var(--title);
  line-height: 1.25;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  white-space: nowrap;
}
.enter:hover { text-decoration-thickness: 4px; }

@media (min-width: 900px) { .laptop__base { width: 112%; margin: 0 -6%; } }
.worlds { overflow-x: clip; }
.laptop__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.laptop__video.is-playing { z-index: 2; }
