/* Slab Library (materials.html): the new design system (house.css) over the yard mechanics in
   materials.css. A pinned 3D aisle (library-3d.js), four family doors, then every stone. */
:root {
  /* tokens materials.css still reads, mapped onto house.css */
  --header-h: 76px;
  --gutter: clamp(18px, 4.2vw, 64px);
  --paper: var(--limestone);
  --paper-deep: var(--bone);
  --ink-soft: #3a3b37;
  --red: var(--terracotta);
  --red-deep: var(--terracotta-deep);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --yard-paper: var(--limestone);
  --yard-paper-deep: var(--bone);
  --yard-ink: var(--ink);
  --yard-muted: var(--mute);
  --yard-line: var(--line);
  --dusk: #1d1916;
  --glow: #e9b89f;
}
.lib { background: var(--limestone); color: var(--ink); font-family: var(--sans); }
.lib .site-header .brand img { filter: none; }
.lib .display { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; line-height: 1; margin: 0; }
.lib .display em { font-style: italic; color: var(--terracotta); }
.lib .yard-main { padding-top: 0; }
.nowrap { white-space: nowrap; }

/* ---------------- the yard: CSS rack until WebGL is up ---------------- */
.lib-yard { position: relative; background: var(--dusk); color: #fff; }
.lib-yard-pin { position: relative; min-height: 100svh; padding: calc(var(--header-h) + 24px) var(--gutter) 40px; display: grid; align-content: center; gap: 30px; overflow: hidden;
  background: radial-gradient(120% 80% at 70% 10%, rgba(201, 154, 107, 0.35), transparent 60%), var(--dusk); }
.lib-yard-canvas { display: none; }
.lib-yard-hud, .lib-yard-end, .lib-yard-progress { display: none; }
.lib-yard-copy { position: relative; z-index: 2; max-width: 980px; will-change: opacity, transform; }
.lib-yard-copy .mono { color: var(--glow); }
.lib-yard-copy h1 { font-size: clamp(42px, 7.4vw, 118px); margin: 16px 0 18px; text-wrap: balance; color: #fff; }
.lib .lib-yard-copy h1 em { display: block; color: var(--glow); }
.lib-yard-copy .lede { max-width: 50ch; margin: 0; font-size: clamp(15px, 1.3vw, 19px); line-height: 1.55; color: rgba(255, 255, 255, 0.8); }
.lib-skip { position: absolute; z-index: 3; right: var(--gutter); bottom: 26px; display: inline-flex; gap: 8px; align-items: center; padding: 11px 16px; border-radius: 999px;
  color: #fff; text-decoration: none; font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: background-color 0.3s; }
.lib-skip:hover { background: rgba(255, 255, 255, 0.24); }
.lib-fallback { position: relative; z-index: 1; }
.lib .rack-caption { color: rgba(255, 255, 255, 0.86); }
.lib .rack-caption-size { color: rgba(255, 255, 255, 0.6); }

/* with WebGL: a tall section whose inner frame stays pinned while the camera walks */
.has-yard3d .lib-yard { height: 340svh; }
.has-yard3d .lib-yard-pin { position: sticky; top: 0; height: 100svh; min-height: 0; padding: 0; display: block; background: var(--dusk); }
.has-yard3d .lib-yard-canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.has-yard3d .lib-fallback { display: none; }
.has-yard3d .lib-yard-pin::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(20, 16, 13, 0.55) 0%, transparent 26%, transparent 62%, rgba(20, 16, 13, 0.6) 100%); }
/* a shade behind the heading so it reads over the slabs; it leaves with the copy */
.has-yard3d .lib-yard-copy::before { content: ""; position: absolute; z-index: -1; left: calc(-1 * var(--gutter)); right: -20vw; top: -30vh; bottom: -16vh; pointer-events: none;
  background: radial-gradient(70% 70% at 18% 70%, rgba(18, 14, 11, 0.82), rgba(18, 14, 11, 0.5) 45%, transparent 75%); }
.has-yard3d .lib-yard-copy { position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(90px, 13vh, 140px); }

.has-yard3d .lib-yard-hud { display: grid; position: absolute; z-index: 3; left: 50%; bottom: clamp(70px, 11vh, 110px); transform: translate(-50%, 16px); min-width: min(320px, 80vw);
  justify-items: center; gap: 4px; padding: 14px 22px 16px; text-align: center; cursor: pointer; border-radius: 4px;
  background: rgba(20, 17, 15, 0.5); border: 1px solid rgba(255, 255, 255, 0.16); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; pointer-events: none; transition: opacity 0.45s var(--ease), transform 0.6s var(--ease); }
.lib-yard-hud.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.lib-yard-hud .mono { color: var(--glow); font-size: 10px; }
.lib-yard-hud strong { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3vw, 38px); line-height: 1.05; }
.lib-yard-hud small { font-size: 12px; color: rgba(255, 255, 255, 0.66); font-variant-numeric: tabular-nums; }
.lib-yard-tap { margin-top: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; padding: 6px 12px; border-radius: 999px; background: var(--terracotta); }

.has-yard3d .lib-yard-end { display: block; position: absolute; z-index: 3; left: 50%; top: 50%; width: min(560px, 86vw); transform: translate(-50%, -40%); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.6s var(--ease), transform 0.8s var(--ease); }
.lib-yard-end.is-on { opacity: 1; transform: translate(-50%, -50%); }
.lib-yard-end .mono { color: var(--glow); }
.lib-yard-end p { margin: 12px 0 0; font-family: var(--serif); font-size: clamp(24px, 3vw, 38px); line-height: 1.15; }

.has-yard3d .lib-yard-progress { display: block; position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, 0.12); }
.lib-yard-progress i { display: block; height: 100%; background: var(--glow); transform-origin: left; transform: scaleX(0); }

/* ---------------- four family doors and the studio ---------------- */
.lib-ways { padding: clamp(70px, 9vw, 140px) var(--gutter) clamp(40px, 5vw, 70px); }
.lib-ways-head { display: grid; gap: 14px; margin-bottom: clamp(26px, 3.4vw, 46px); }
.lib-ways-head .mono, .lib-index-head .mono { color: var(--terracotta); }
.lib-ways-head h2, .lib-index-head h2 { font-size: clamp(38px, 5.4vw, 84px); max-width: 15ch; }
.lib-ways-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.5fr); gap: 12px; margin: 0; }
.lib-way { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-height: clamp(300px, 30vw, 440px); padding: 20px;
  color: #fff; text-decoration: none; border: 0; border-radius: 0; background: var(--dusk); transition: transform 0.6s var(--ease); }
.lib-way::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--tex) center / cover; transform: scale(1.02); transition: transform 1.4s var(--ease); }
.lib-way::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(14, 12, 10, 0.05) 30%, rgba(14, 12, 10, 0.78)); }
.lib-way:hover { transform: translateY(-6px); }
.lib-way:hover::before { transform: scale(1.12) rotate(1deg); }
.lib-way .mono { position: absolute; top: 18px; left: 20px; color: rgba(255, 255, 255, 0.82); }
.lib-way strong { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 2.8vw, 44px); line-height: 1; }
.lib-way small { font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, 0.78); max-width: 30ch; }
.lib-way i { position: absolute; top: 14px; right: 16px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; font-style: normal;
  background: rgba(255, 255, 255, 0.16); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background-color 0.3s, transform 0.5s var(--ease); }
.lib-way:hover i { background: var(--terracotta); transform: rotate(45deg); }
.lib-way-studio::after { background: linear-gradient(120deg, rgba(20, 17, 15, 0.92) 25%, rgba(179, 71, 50, 0.4)); }
.lib-way-studio .mono { color: var(--glow); }
.lib-way-studio strong { font-size: clamp(30px, 3vw, 48px); max-width: 11ch; }
.lib-way-studio:hover i { transform: translateX(4px); }

/* ---------------- every stone ---------------- */
.lib-index-head { display: grid; gap: 14px; padding: clamp(30px, 4vw, 60px) var(--gutter) 22px; }
.lib .yard-index { width: 100%; max-width: none; }
.lib .pebble-bar { top: var(--header-h); background: color-mix(in srgb, var(--limestone) 92%, transparent); border-top: 1px solid var(--line); }
.lib .pebble-label { font-size: 12px; font-weight: 600; }
.lib .pebble-stone { transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.lib .yard-count { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }
.lib .stone-grid { grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 15vw, 230px), 1fr)); gap: clamp(28px, 3vw, 48px) clamp(14px, 1.6vw, 26px); }
.lib .stone-name { font-family: var(--serif); font-size: clamp(17px, 1.3vw, 20px); }
.lib .stone-size { font-size: 11.5px; letter-spacing: 0.04em; }
.lib .stone-open { perspective: 900px; }
.lib .stone-chip { border-radius: 4px; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--stone) 55%, #000), 0 24px 30px -18px rgba(20, 16, 10, 0.55);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease); }
.lib .stone-chip.is-tilt { transition: transform 0.12s linear, box-shadow 0.3s var(--ease); box-shadow: 0 8px 0 color-mix(in srgb, var(--stone) 55%, #000), 0 34px 40px -20px rgba(20, 16, 10, 0.6); }
.lib .stone-chip::after { border-radius: inherit; background: radial-gradient(circle at var(--gx, 30%) var(--gy, 20%), rgba(255, 255, 255, 0.38), transparent 45%), linear-gradient(125deg, rgba(255, 255, 255, 0.14), transparent 40%, rgba(0, 0, 0, 0.14)); }
.lib .stone-open:hover .stone-chip img { transform: scale(1.06); }
.lib .stone-save { border-radius: 50%; }
.lib-badge { position: absolute; z-index: 2; left: 8px; bottom: 8px; padding: 4px 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #fff;
  background: rgba(20, 17, 15, 0.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: 999px; }
.lib-badge::before { content: "◆ "; color: var(--glow); }
.lib .stone-details-link { border-radius: 999px; font-size: 11.5px; }

/* rise in a row at a time */
.lib-rise .stone .stone-open { opacity: 0; transform: translateY(34px); transition: opacity 0.8s var(--ease) var(--d, 0ms), transform 1s var(--ease) var(--d, 0ms); }
.lib-rise .stone.is-in .stone-open { opacity: 1; transform: none; }

/* viewer: the studio link */
.lib-viewer-studio { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; margin-top: 16px; padding: 12px 14px; color: #fff; text-decoration: none;
  background: linear-gradient(110deg, rgba(179, 71, 50, 0.5), rgba(255, 255, 255, 0.06)); border: 1px solid rgba(255, 255, 255, 0.16); transition: background-color 0.3s; }
.lib-viewer-studio[hidden] { display: none; }
.lib-viewer-studio .mono { grid-column: 1; color: var(--glow); font-size: 10px; }
.lib-viewer-studio strong { grid-column: 1; font-family: var(--serif); font-weight: 400; font-size: 20px; }
.lib-viewer-studio i { grid-column: 2; grid-row: 1 / span 2; font-style: normal; font-size: 20px; transition: transform 0.4s var(--ease); }
.lib-viewer-studio:hover i { transform: translateX(4px); }

/* the Indonesian guidance, in the new type */
.lib .collection-guidance { padding: clamp(60px, 8vw, 120px) var(--gutter); background: var(--bone); border-top: 0; }
.lib .collection-guidance h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.6vw, 52px); letter-spacing: -0.02em; line-height: 1.05; max-width: 22ch; }
.lib .collection-guidance h2:not(:first-child) { margin-top: clamp(40px, 5vw, 70px); }
.lib .collection-guidance p { color: var(--ink-soft); font-size: 16px; line-height: 1.7; }
.lib .collection-guidance .inquiry-intent { max-width: 340px; margin: 24px 0 18px; font-weight: 600; font-size: 13px; }
.lib .inquiry-intent select { border: 1px solid var(--line); background: #fff; }

@media (max-width: 1100px) {
  .lib-ways-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lib-way-studio { grid-column: 1 / -1; min-height: 260px; }
}
@media (max-width: 760px) {
  .has-yard3d .lib-yard { height: 300svh; }
  .lib-yard-copy h1 { font-size: clamp(38px, 11vw, 52px); }
  .lib-yard-copy .lede { font-size: 15px; }
  .has-yard3d .lib-yard-copy { bottom: 92px; }
  .has-yard3d .lib-yard-hud { bottom: 84px; padding: 12px 18px 14px; }
  .lib-skip { left: var(--gutter); right: var(--gutter); bottom: 18px; justify-content: center; }
  .lib-ways-grid { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 76%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 6px; scrollbar-width: none; }
  .lib-ways-grid::-webkit-scrollbar { display: none; }
  .lib-way { min-height: 340px; scroll-snap-align: start; }
  .lib-way-studio { grid-column: auto; min-height: 340px; }
  .lib .stone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .lib-rise .stone .stone-open { opacity: 1; transform: none; }
}

/* viewer details in the new type */
.lib .viewer-wa, .lib .dock-send, .lib .shortlist-send { text-decoration: none; }
.lib .viewer-title { font-family: var(--serif); }
.lib .viewer-info .inquiry-intent { color: var(--on-basalt-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.lib .viewer-info .inquiry-intent select { margin-top: 8px; min-height: 44px; padding: 0 12px; color: var(--on-basalt); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(238, 234, 225, 0.24); border-radius: 999px;
  font-size: 14px; letter-spacing: 0; text-transform: none; }
.lib .viewer-info .inquiry-intent select option { color: var(--ink); }

/* the family doors share the .yard-types hook with the old pill links; undo the pill */
.lib .lib-ways-grid.yard-types { display: grid; flex-wrap: initial; gap: 12px; margin: 0; }
.lib .lib-ways-grid .lib-way { border: 0; border-radius: 0; padding: 20px; min-height: clamp(300px, 30vw, 440px); font-size: inherit; color: #fff; background: var(--dusk); }
.lib .lib-ways-grid .lib-way:hover { color: #fff; background: var(--dusk); border: 0; }
@media (max-width: 760px) { .lib .lib-ways-grid .lib-way { min-height: 340px; } }
