/* Soft Light Software. A gallery wall at night: tiny labels, a great deal of
   empty wall, one exhibit. A dimmer on the right edge turns the light up and
   down (studio.js sets the colours from it). Newsreader and Inter. */

@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-latin-wght-normal.woff2) format("woff2-variations"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-latin-wght-italic.woff2) format("woff2-variations"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/inter-latin-wght-normal.woff2) format("woff2-variations"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  /* studio.js overwrites these from the dimmer; these are the no-JS defaults */
  --bg: #0f0d0b;
  --ink: #e6dccb;
  --soft: #a0968a;
  --hair: rgba(230, 220, 203, 0.13);
  --amber: #dba767;
  --candle: 226 156 78;
  --ga: 0.2;
  --gs: 1;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --gap: clamp(0.75rem, 2vw, 2rem);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { overflow-x: clip; background: var(--bg); scrollbar-color: var(--hair) var(--bg); scroll-behavior: smooth; caret-color: var(--amber); }
body { position: relative; margin: 0; overflow-x: clip; background: var(--bg); color: var(--ink); font: 400 1rem/1.68 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: rgb(var(--candle) / 0.4); color: #fff; }
:focus-visible { outline: 1px solid var(--amber); outline-offset: 5px; border-radius: 2px; }
h1, h2, p, dl, dd, figure { margin: 0; }
a { color: inherit; }
em { font-style: italic; color: var(--amber); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, .wall-text, .mail, .mark { font-family: var(--serif); font-weight: 400; font-optical-sizing: auto; }

/* Links and buttons: warmth on hover, nothing more */
.link { font-size: 0.94rem; text-decoration: underline; text-decoration-color: rgb(var(--candle) / 0.5); text-underline-offset: 0.32em; text-decoration-thickness: 1px; transition: text-decoration-color 0.6s var(--ease), color 0.6s var(--ease); }
.link:hover { text-decoration-color: var(--amber); color: #fff3df; }
.btn { display: inline-block; padding: 0.8rem 1.6rem; border-radius: 8px; font-size: 1rem; font-weight: 600; letter-spacing: 0.01em; text-decoration: none; color: #1a1208; background: var(--amber); border: 1px solid var(--amber); transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease); }
.btn:hover { background: #f5c486; border-color: #f5c486; color: #1a1208; box-shadow: 0 10px 30px -12px rgb(var(--candle) / 0.7); }
.btn:active { transform: translateY(1px); }

/* Top bar */
.top { position: absolute; z-index: 3; left: 0; right: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1.6rem var(--pad) 0; }
.mark { font-style: italic; font-size: 1.05rem; text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1.6rem; justify-content: flex-end; font-size: 0.9rem; letter-spacing: 0.03em; padding-right: 3.2rem; }
.top nav a { padding-block: 0.4rem; color: var(--soft); text-decoration: none; transition: color 0.6s var(--ease); }
.top nav a:hover { color: var(--ink); }

/* The wall: twelve columns, mostly empty */
.wall { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); max-width: 96rem; margin-inline: auto; padding-inline: var(--pad); }

.hero { overflow-x: clip; min-height: 100svh; grid-template-rows: 1fr auto auto auto; padding-top: 7rem; padding-bottom: clamp(2.5rem, 7vh, 4.5rem); }
.hero h1 { grid-column: 1 / span 8; grid-row: 2; align-self: end; max-width: 11em; font-size: clamp(2.7rem, 6.2vw, 5.6rem); line-height: 1.04; letter-spacing: -0.012em; text-wrap: balance; }
.plate { grid-column: 1 / span 7; grid-row: 3; margin-top: 2.25rem; }
.plate .lede { max-width: 34rem; font-size: 1.1875rem; line-height: 1.6; color: var(--ink); }
.plate .go { margin-top: 1.6rem; }
.tip { grid-column: 1 / span 7; grid-row: 4; align-self: end; justify-self: start; max-width: 32rem; margin-top: 1.5rem; font-size: 0.94rem; line-height: 1.55; color: var(--soft); }
.hero-shot { grid-column: 9 / -1; grid-row: 1 / 5; align-self: end; justify-self: center; width: min(100%, 20rem); margin-bottom: clamp(0.5rem, 3vh, 2rem); }
.hero-shot img { display: block; width: 100%; height: auto; border-radius: 3px; box-shadow: 0 0 0 1px var(--hair), 0 50px 100px -40px rgb(var(--candle) / calc(var(--ga) * 2)); }

/* The short version: what a stranger needs to trust the seller */
.ledger { padding-block: 0 clamp(2rem, 5vw, 4rem); }
.ledger dl { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: clamp(1rem, 2.5vw, 2.5rem); border-top: 1px solid var(--hair); padding-top: 1.75rem; }
.ledger dt { font-size: 0.9375rem; font-weight: 500; color: var(--amber); }
.ledger dd { margin-top: 0.4rem; font-family: var(--serif); font-size: 1.2rem; line-height: 1.38; }

/* Exhibit: Shoji, hung with its label */
.exhibit { padding-block: clamp(7rem, 16vw, 13rem); align-items: start; }
.label { grid-column: 1 / span 5; }
.label h2 { font-size: clamp(2.6rem, 4.4vw, 3.8rem); line-height: 1; letter-spacing: -0.015em; }
.facts { margin-top: 1.75rem; display: grid; gap: 0.9rem; font-size: 0.94rem; line-height: 1.5; }
.facts div { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); gap: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--hair); }
.facts dt { color: var(--soft); letter-spacing: 0.04em; }
.facts dd { color: var(--ink); }
.label .go { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.5rem; }
.hang { grid-column: 7 / span 6; display: grid; gap: 1.1rem; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.75rem, 2vw, 1.5rem); }
.shot { justify-self: start; width: 100%; }
.shot img { display: block; width: 100%; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px var(--hair), 0 50px 100px -40px rgb(var(--candle) / calc(var(--ga) * 1.6)); }
.cap { font-size: 0.94rem; color: var(--soft); }
.wall-text { margin-top: clamp(3rem, 8vw, 6rem); font-size: clamp(1.45rem, 2.5vw, 2.15rem); line-height: 1.32; letter-spacing: -0.006em; text-wrap: pretty; max-width: 28em; }

/* The studio: a paragraph on the wall and a few small plates */
.studio { padding-block: clamp(4rem, 9vw, 7rem); align-items: start; border-top: 1px solid var(--hair); }
.studio h2 { grid-column: 1 / span 4; font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1.05; letter-spacing: -0.015em; }
.studio .wall-text { grid-column: 5 / span 8; margin-top: 0; }
.studio .facts { grid-column: 5 / span 6; margin-top: clamp(2.5rem, 6vw, 4rem); }

/* Say hello: pushed to the far side of the wall */
.hello { padding-block: clamp(4rem, 9vw, 7rem) clamp(4rem, 9vw, 7rem); }
.hello .block { border-top: 1px solid var(--hair); padding-top: clamp(3rem, 6vw, 5rem); }
.hello .block { grid-column: 1 / -1; }
.hello .small { font-size: 0.94rem; color: var(--soft); }
.mail { display: inline-block; margin-top: 0.8rem; font-style: italic; font-size: clamp(1.7rem, 4.6vw, 3.4rem); line-height: 1.1; letter-spacing: -0.01em; text-decoration: underline; text-decoration-color: rgb(var(--candle) / 0.5); text-underline-offset: 0.28em; text-decoration-thickness: 1px; transition: text-decoration-color 0.6s var(--ease), text-shadow 0.8s var(--ease); }
.mail:hover { text-decoration-color: var(--amber); text-shadow: 0 0 34px rgb(var(--candle) / 0.55); }
.hello .reply { margin-top: 1.4rem; max-width: 26rem; font-size: 0.94rem; color: var(--soft); }

footer { border-top: 1px solid var(--hair); padding: 2.2rem var(--pad) 3rem; font-size: 0.94rem; color: var(--soft); }
footer .wall { padding: 0; }
footer .l { grid-column: 1 / span 6; }
footer nav { grid-column: 7 / -1; display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; justify-content: flex-end; }
footer a { padding-block: 0.4rem; text-decoration: none; transition: color 0.6s var(--ease); }
footer a:hover { color: var(--ink); }

/* The dimmer: a hairline on the right edge with a knob of light on it */
.dimmer { position: fixed; z-index: 10; right: 0.3rem; top: 50%; translate: 0 -50%; width: 2.75rem; height: min(34vh, 18rem); display: grid; place-items: center; touch-action: none; cursor: grab; outline: none; }
.dimmer:active { cursor: grabbing; }
.dim-track { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: linear-gradient(var(--soft), var(--hair)); opacity: 0.8; }
.dim-knob { position: absolute; left: 50%; bottom: calc(var(--lv, 0.3) * 100%); width: 0.62rem; height: 0.62rem; translate: -50% 50%; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgb(var(--candle) / 0.14), 0 0 calc(10px + var(--lv, 0.3) * 34px) rgb(var(--candle) / 0.75); transition: box-shadow 0.4s var(--ease); }
.dimmer:focus-visible .dim-knob { box-shadow: 0 0 0 3px var(--ink), 0 0 20px rgb(var(--candle) / 0.75); }
.dim-label { position: absolute; top: calc(100% + 0.9rem); left: 50%; translate: -50% 0; writing-mode: vertical-rl; font-size: 0.8rem; letter-spacing: 0.3em; color: var(--soft); }

/* ---------- The light. A line of light under a door is the default; set data-light on <html> to try window, lamp, spill or corner. ---------- */
.light { position: absolute; z-index: 0; left: -2rem; right: -2rem; top: -2rem; height: calc(100svh + 4rem); overflow: hidden; pointer-events: none; translate: var(--gx, 0px) var(--gy, 0px); animation: flicker 9s ease-in-out infinite; }
html[data-light="window"] .light, html[data-light="corner"] .light { -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent); mask-image: linear-gradient(180deg, #000 62%, transparent); }
.light > div { display: none; position: absolute; }
main { position: relative; z-index: 1; }
@keyframes flicker { 0%, 100% { opacity: 0.88; } 23% { opacity: 1; } 48% { opacity: 0.92; } 71% { opacity: 0.99; } }

/* window: a shaft of light falling across the wall through a window, with the frame's bars in it */
html[data-light="window"] .l-window { display: block; }
.l-window { right: 9%; top: -30%; width: 38vw; height: 160%; transform: rotate(-14deg) skewX(-14deg); transform-origin: top right;
  background:
    linear-gradient(90deg, transparent 47.5%, var(--bg) 47.5% 51%, transparent 51%),
    linear-gradient(0deg, transparent 49%, var(--bg) 49% 52%, transparent 52%),
    linear-gradient(180deg, rgb(var(--candle) / calc(var(--ga) * 1.25)), rgb(var(--candle) / calc(var(--ga) * 0.55)) 55%, transparent 92%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  filter: blur(3px); }

/* lamp: a cone of light from a lamp hung above the page */
html[data-light="lamp"] .l-lamp { display: block; }
.l-lamp { left: 62%; top: 0; width: 64vw; height: 108%; translate: -50% 0; clip-path: polygon(47.5% 0, 52.5% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgb(var(--candle) / calc(var(--ga) * 1.5)), rgb(var(--candle) / calc(var(--ga) * 0.5)) 50%, transparent 90%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); filter: blur(5px); }
html[data-light="lamp"] .light::after { content: ""; position: absolute; left: 62%; top: 1.6rem; width: 0.7rem; height: 0.7rem; translate: -50% -50%; border-radius: 50%; background: #ffe2b0; box-shadow: 0 0 40px 14px rgb(var(--candle) / 0.8); }

/* spill: light coming in from beyond the right edge, like a door left ajar */
html[data-light="spill"] .l-spill { display: block; }
.l-spill { right: 0; top: 0; bottom: 0; width: 70%;
  background: linear-gradient(270deg, rgb(var(--candle) / calc(var(--ga) * 1.5)), rgb(var(--candle) / calc(var(--ga) * 0.45)) 38%, transparent 82%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent); }
html[data-light="spill"] .light::after { content: ""; position: absolute; right: 2rem; top: 22%; bottom: 22%; width: 2px; background: linear-gradient(180deg, transparent, rgb(255 226 176 / 0.85), transparent); box-shadow: 0 0 26px 6px rgb(var(--candle) / 0.6); }

/* door: a line of light under a door, with the glow climbing the wall */
html:not([data-light]) .l-door, html[data-light="door"] .l-door { display: block; }
.l-door { left: 0; right: 0; bottom: 5rem; height: 60%;
  background: linear-gradient(0deg, rgb(var(--candle) / calc(var(--ga) * 1.3)), rgb(var(--candle) / calc(var(--ga) * 0.35)) 45%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 6%, #000 35%, #000 65%, transparent 94%); mask-image: linear-gradient(90deg, transparent 6%, #000 35%, #000 65%, transparent 94%); }
html:not([data-light]) .light::after, html[data-light="door"] .light::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 5rem; height: 2px; background: linear-gradient(90deg, transparent, rgb(255 226 176 / 0.9) 25%, rgb(255 226 176 / 0.9) 75%, transparent); box-shadow: 0 0 22px 4px rgb(var(--candle) / 0.55); }

/* corner: ambient light from past the top-right corner, with a little film grain, no shape at all */
html[data-light="corner"] .l-corner { display: block; }
.l-corner { inset: 0;
  background: radial-gradient(circle at 100% 0%, rgb(var(--candle) / calc(var(--ga) * 1.5)), rgb(var(--candle) / calc(var(--ga) * 0.5)) 34%, transparent 66%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .85 0 0 0 0 .65 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E"); }

/* Gentle arrivals */
.fx .rv { opacity: 0; transform: translateY(0.7rem); transition: opacity 1.6s var(--ease), transform 1.6s var(--ease); transition-delay: var(--d, 0s); }
.fx .rv.in { opacity: 1; transform: none; }
.fx .hero .rv { transition-duration: 0.9s; }
.fx .light { opacity: 0; animation: bloom 1.6s var(--ease) 0.05s forwards, flicker 9s 1.7s ease-in-out infinite; }
@keyframes bloom { to { opacity: 0.9; } }

@media (max-width: 860px) {
  .hero-shot { display: none; }
  .wall { padding-right: calc(var(--pad) + 1.9rem); }
  footer .wall { padding-right: 0; }
  .go .link { padding-block: 0.6rem; }
  .hero h1 { grid-column: 1 / -1; font-size: clamp(2.3rem, 10vw, 3.4rem); }
  .plate { grid-column: 1 / -1; }
  .ledger dl { grid-template-columns: 1fr 1fr; row-gap: 1.5rem; }
  .tip { grid-column: 1 / -1; grid-row: 4; justify-self: start; text-align: left; margin-top: 1.6rem; padding-right: 3.2rem; }
  .exhibit { row-gap: 3rem; }
  .label, .hang, .studio .wall-text, .studio .facts, .hello .block { grid-column: 1 / -1; position: static; }
  .top { flex-wrap: wrap; }
  .top nav { gap: 0 1.2rem; justify-content: flex-start; }
  footer .l, footer nav { grid-column: 1 / -1; justify-content: flex-start; }
  footer nav { margin-top: 1rem; }
  .hello .block { padding-right: 1.5rem; }
}
@media (max-width: 480px) { .ledger dl { grid-template-columns: 1fr; } .btn { width: 100%; text-align: center; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .light { animation: none; }
  .fx .light { opacity: 1; }
}
@media print { .light, .dimmer { display: none; } }
