/*
Theme Name: Grotto
Description: Contemporary project space for grotesque figuration and abstract art.
Version: 1.0
*/

/* ============================================================
   Grotto's structural principle: the homepage collection grid is
   a salon-hang — irregular sizes, small rotations, uneven gutters,
   the way 19th-century academy exhibitions actually hung work floor
   to ceiling — instead of the uniform card grids every prior theme
   in this project has used. Three new GPU techniques debut here:
   a marching-cubes isosurface (real mesh generation from a metaball
   scalar field, not raymarching, not InstancedMesh — the project's
   first polygon-generating GPU algorithm), a real-time liquify/melt
   vertex+UV displacement on framed artwork images, and a metaball
   goo cursor (2D screen-space distance-field blob union replacing
   the pointer sitewide). Palette: bruise purple-black, bilious
   acid green, raw flesh pink — deliberately uncomfortable, never
   used before. Typography: Hanken Grotesk (literally a "grotesque"
   type classification) + Archivo + Azeret Mono. The interaction
   model stays a normal scrollable site — the strangeness lives in
   surface and layout, not in how the page behaves.
   ============================================================ */
:root {
	--ground: #150a12;
	--panel: #1e0f1c;
	--panel-2: #271426;
	--bruise: #4a1f52;
	--bruise-bright: #6b2d74;
	--bile: #b8c93e;
	--bile-dim: #7c8a2e;
	--flesh: #d9776a;
	--flesh-bright: #ea9585;
	--wound: #8a2f2f;
	--bone: #ece3d8;
	--bone-dim: #a89a97;
	--bone-mute: #6b5c5f;
	--line: rgba(236, 227, 216, 0.12);
	--line-strong: rgba(236, 227, 216, 0.26);
	--font-display: 'Hanken Grotesk', sans-serif;
	--font-body: 'Archivo', sans-serif;
	--font-mono: 'Azeret Mono', monospace;
	--ease-grot: cubic-bezier(0.65, -0.15, 0.32, 1.15);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
	margin: 0;
	background: var(--ground);
	color: var(--bone);
	font-family: var(--font-body);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
	cursor: none;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--bile); color: var(--ground); }
button { font-family: inherit; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 0.98; letter-spacing: -0.01em; margin: 0 0 0.4em; color: var(--bone); text-transform: uppercase; }
h1 { font-size: clamp(48px, 8vw, 128px); font-weight: 900; }
h2 { font-size: clamp(32px, 4.4vw, 62px); }
h3 { font-size: clamp(19px, 2vw, 24px); font-weight: 700; text-transform: none; }
p { margin: 0 0 1.1em; color: var(--bone-dim); }
.mono { font-family: var(--font-mono); }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 40px; }

.eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--bile); display: inline-flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ''; width: 26px; height: 2px; background: var(--flesh); }
.eyebrow.pink::before { background: var(--bile); }

.btn { display: inline-flex; align-items: center; gap: 12px; padding: 16px 34px; border: 2px solid var(--bone); border-radius: 0; font-family: var(--font-display); font-weight: 800; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bone); background: transparent; transition: background 0.4s var(--ease-grot), color 0.4s var(--ease-grot), transform 0.3s var(--ease-grot); cursor: pointer; }
.btn:hover { background: var(--bile); color: var(--ground); border-color: var(--bile); transform: skew(-3deg); }
.btn.solid { background: var(--flesh); color: var(--ground); border-color: var(--flesh); }
.btn.solid:hover { background: var(--bile); border-color: var(--bile); }

.grain { position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0.06; mix-blend-mode: overlay; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"); }

/* ============================================================
   Metaball goo cursor — replaces the system pointer sitewide.
   ============================================================ */
#gooCursor { position: fixed; inset: 0; z-index: 600; pointer-events: none; mix-blend-mode: difference; }
#gooCursor.is-hover { transform: scale(1.6); }

/* ============================================================
   Header
   ============================================================ */
.site-head { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 22px 0; transition: background 0.4s, border-color 0.4s; border-bottom: 1px solid transparent; }
.site-head.scrolled { background: rgba(21, 10, 18, 0.86); backdrop-filter: blur(14px); border-color: var(--line); }
.head-inner { display: flex; align-items: center; justify-content: space-between; padding: 0 3vw; }
.logo { font-family: var(--font-display); font-weight: 900; font-size: 26px; letter-spacing: -0.01em; text-transform: uppercase; color: var(--bone); }
.logo span { color: var(--bile); }
.main-nav ul { list-style: none; display: flex; gap: 34px; margin: 0; padding: 0; }
.main-nav a { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-dim); transition: color 0.3s; }
.main-nav a:hover { color: var(--flesh); }
.nav-toggle { display: none; background: none; border: 2px solid var(--bile); color: var(--bile); font-size: 10px; letter-spacing: 0.14em; padding: 8px 16px; cursor: pointer; font-family: var(--font-mono); text-transform: uppercase; }
.mobile-nav { position: fixed; inset: 0; z-index: 200; background: var(--ground); transform: translateY(-100%); transition: transform 0.55s var(--ease-grot); display: flex; flex-direction: column; }
.mobile-nav.open { transform: translateY(0); }
.mobile-nav ul { list-style: none; margin: auto 0; padding: 0 40px; }
.mobile-nav li { border-bottom: 1px solid var(--line); }
.mobile-nav a { display: block; padding: 20px 0; font-family: var(--font-display); font-weight: 800; font-size: 34px; color: var(--bone); text-transform: uppercase; }
.mn-close { position: absolute; top: 26px; right: 34px; background: none; border: 2px solid var(--bile); color: var(--bile); font-size: 20px; padding: 4px 13px; cursor: pointer; }
@media (max-width: 960px) { .main-nav { display: none; } .nav-toggle { display: block; } }

/* ============================================================
   Structural devices
   ============================================================ */
.accession-tag { display: inline-flex; flex-wrap: wrap; gap: 18px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bone-mute); }
.accession-tag .acc-no { color: var(--bile); font-weight: 500; }

.status-stamp { display: inline-block; padding: 4px 10px; border: 1px solid currentColor; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; transform: rotate(-2deg); }
.status-available { color: var(--bile); }
.status-placed { color: var(--bone-mute); }
.status-on-hold { color: var(--flesh); }
.status-not-for-sale { color: var(--wound); }

/* Advisory ticker — replaces the generic press marquee used
   elsewhere in the project with a device native to this content:
   a gallery viewer-discretion strip. */
.advisory-strip { background: var(--bile); color: var(--ground); overflow: hidden; padding: 12px 0; white-space: nowrap; border-top: 2px solid var(--ground); border-bottom: 2px solid var(--ground); }
.advisory-track { display: inline-flex; gap: 48px; animation: advisory-scroll 32s linear infinite; }
.advisory-track span { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }
@keyframes advisory-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding: 160px 0 70px; }
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.3) contrast(1.1) brightness(0.8); animation: hero-drift 26s ease-in-out infinite alternate; }
@keyframes hero-drift { from { transform: scale(1.06) translate(0,0); } to { transform: scale(1.14) translate(-1.5%, -1%); } }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(21,10,18,0.25) 0%, rgba(21,10,18,0.6) 55%, var(--ground) 100%); z-index: 1; pointer-events: none; }
.hero-inner { position: relative; z-index: 2; padding: 0 3vw; }
.hero h1 { margin: 18px 0 26px; }
.hero h1 .warp-word { display: inline-block; transition: transform 0.4s var(--ease-grot), color 0.4s; }
.hero h1 .warp-word:hover { color: var(--bile); transform: scale(1.06) skew(-6deg, 2deg); }
.hero-lede { max-width: 560px; font-size: 18px; color: var(--bone-dim); }
.hero-cta { display: flex; gap: 18px; margin-top: 28px; flex-wrap: wrap; }
.scroll-cue { position: absolute; bottom: 26px; right: 4vw; z-index: 2; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bone-mute); writing-mode: vertical-rl; display: flex; align-items: center; gap: 10px; }
.scroll-cue::after { content: ''; width: 1px; height: 46px; background: var(--bone-mute); }

/* ============================================================
   Trust / stats strip
   ============================================================ */
.stats-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 44px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-weight: 900; font-size: clamp(30px, 3.6vw, 48px); color: var(--flesh); }
.stat span { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone-mute); }
@media (max-width: 760px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   Exhibition banner
   ============================================================ */
.exhibit-banner { position: relative; padding: 120px 0; overflow: hidden; }
.exhibit-media { position: absolute; inset: 0; }
.exhibit-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.3) contrast(1.08); }
.exhibit-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(21,10,18,0.94) 15%, rgba(21,10,18,0.35) 70%); }
.exhibit-inner { position: relative; z-index: 1; max-width: 640px; }
.exhibit-dates { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--bile); text-transform: uppercase; margin-bottom: 14px; display: block; }

/* ============================================================
   Salon-hang collection grid — the core novelty. Cards vary in
   span, vertical offset and rotation via PHP-generated inline
   styles seeded from grotto_hash(), imitating an irregular
   floor-to-ceiling gallery hang rather than a uniform grid.
   ============================================================ */
.salon-section { padding: 110px 0; }
.salon-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 60px; flex-wrap: wrap; gap: 20px; }
.salon-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 26px; }
.salon-card { position: relative; grid-column: span 4; overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: transform 0.5s var(--ease-grot), z-index 0s; }
.salon-card:hover { transform: scale(1.03) rotate(0deg) !important; z-index: 5; }
.salon-card .sc-media { position: relative; overflow: hidden; aspect-ratio: 4/5; }
.salon-card .sc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease-grot), filter 0.5s; }
.salon-card:hover .sc-media img { transform: scale(1.08); filter: saturate(1.4) hue-rotate(-6deg); }
.salon-card .sc-body { padding: 16px 18px 20px; }
.salon-card .sc-artist { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-mute); margin-bottom: 6px; display: block; }
.salon-card h3 { margin-bottom: 8px; }
.salon-card .status-stamp { position: absolute; top: 14px; right: 14px; background: var(--ground); z-index: 2; }
@media (max-width: 900px) { .salon-card { grid-column: span 6 !important; transform: none !important; } }
@media (max-width: 560px) { .salon-grid { grid-template-columns: 1fr; } .salon-card { grid-column: span 1 !important; } }

/* ============================================================
   Sculpture Room — marching-cubes showcase
   ============================================================ */
.sculpt-room { position: relative; padding: 0; height: 92vh; min-height: 640px; overflow: hidden; background: var(--panel); }
#marchingCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sculpt-overlay { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: space-between; padding: 70px 3vw; pointer-events: none; }
.sculpt-overlay .eyebrow { pointer-events: auto; }
.sculpt-caption { max-width: 480px; pointer-events: auto; }
.sculpt-caption p { color: var(--bone-dim); }

/* ============================================================
   Artist roster
   ============================================================ */
.roster-section { padding: 110px 0; }
.roster-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-top: 50px; }
.roster-card { border: 1px solid var(--line); background: var(--panel); padding: 24px; transition: border-color 0.3s, transform 0.4s var(--ease-grot); }
.roster-card:hover { border-color: var(--flesh); transform: translateY(-6px); }
.roster-card .rc-media { aspect-ratio: 1/1; overflow: hidden; margin-bottom: 16px; filter: grayscale(0.4) contrast(1.1); }
.roster-card .rc-media img { width: 100%; height: 100%; object-fit: cover; }
.roster-card h3 { margin-bottom: 4px; }
.roster-card .rc-role { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bile); }
@media (max-width: 900px) { .roster-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   The Melt — liquify showcase
   ============================================================ */
.melt-section { padding: 110px 0; background: var(--panel-2); }
.melt-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; margin-top: 50px; }
.melt-stage { position: relative; aspect-ratio: 4/5; background: var(--ground); border: 1px solid var(--line); overflow: hidden; }
#liquifyCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.melt-hint { position: absolute; bottom: 16px; left: 16px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-dim); background: rgba(21,10,18,0.7); padding: 6px 12px; z-index: 3; }
@media (max-width: 900px) { .melt-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Press quotes
   ============================================================ */
.press-section { padding: 100px 0; border-top: 1px solid var(--line); }
.press-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 50px; }
.press-quote blockquote { margin: 0 0 16px; font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1.25; color: var(--bone); text-transform: none; }
.press-quote cite { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bone-mute); font-style: normal; }
@media (max-width: 900px) { .press-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Journal
   ============================================================ */
.journal-section { padding: 110px 0; }
.journal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 50px; }
.journal-card { display: block; border: 1px solid var(--line); background: var(--panel); overflow: hidden; transition: border-color 0.3s; }
.journal-card:hover { border-color: var(--bile); }
.journal-card .jc-media { aspect-ratio: 16/10; overflow: hidden; }
.journal-card .jc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-grot); }
.journal-card:hover .jc-media img { transform: scale(1.06); }
.journal-card .jc-body { padding: 22px; }
.journal-card .jc-date { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-mute); }
.journal-card h3 { margin: 8px 0; font-size: 20px; }
@media (max-width: 900px) { .journal-grid { grid-template-columns: 1fr; } }

/* ============================================================
   CTA / Visit
   ============================================================ */
.cta-band { padding: 130px 0; text-align: center; background: var(--bruise); position: relative; overflow: hidden; }
.cta-band h2 { max-width: 780px; margin: 0 auto 30px; }
.cta-band .btn.solid { background: var(--bile); color: var(--ground); border-color: var(--bile); }

/* ============================================================
   Footer
   ============================================================ */
.site-foot { padding: 80px 0 40px; border-top: 1px solid var(--line); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.foot-grid h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone-mute); margin-bottom: 16px; }
.foot-menu, .foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-menu li, .foot-grid li { margin-bottom: 10px; }
.foot-menu a, .foot-grid a { color: var(--bone-dim); font-size: 14px; transition: color 0.3s; }
.foot-menu a:hover, .foot-grid a:hover { color: var(--flesh); }
.foot-bottom { margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bone-mute); flex-wrap: wrap; gap: 10px; }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* ============================================================
   Reveals
   ============================================================ */
.reveal { opacity: 0; transform: translateY(36px); }
.reveal.in { opacity: 1; transform: translateY(0); transition: opacity 0.8s var(--ease-grot), transform 0.8s var(--ease-grot); }

/* ============================================================
   Interior pages — single artwork / archive / journal
   ============================================================ */
.page-hero { padding: 170px 0 70px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(38px, 6vw, 76px); }

.artwork-single { padding: 60px 0 120px; }
.artwork-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 70px; }
.artwork-media { border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.artwork-media img { width: 100%; display: block; }
.artwork-meta h1 { font-size: clamp(30px, 4vw, 48px); margin-bottom: 6px; }
.artwork-meta .aw-artist { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--flesh); margin-bottom: 20px; display: block; }
.artwork-meta .accession-tag { flex-direction: column; gap: 8px; margin: 24px 0; padding: 20px; background: var(--panel); border: 1px solid var(--line); }
@media (max-width: 900px) { .artwork-layout { grid-template-columns: 1fr; } }

.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; padding: 70px 0 120px; }
@media (max-width: 900px) { .archive-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .archive-grid { grid-template-columns: 1fr; } }

.taxo-filter { display: flex; gap: 12px; flex-wrap: wrap; padding: 30px 0; }
.taxo-filter a { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 8px 16px; border: 1px solid var(--line-strong); color: var(--bone-dim); transition: all 0.3s; }
.taxo-filter a:hover, .taxo-filter a.active { border-color: var(--bile); color: var(--bile); }

.content-basic { padding: 70px 0 120px; max-width: 780px; margin: 0 auto; }
.content-basic h2 { margin-top: 1.4em; }
.content-basic p { font-size: 17px; }
.content-basic img { margin: 30px 0; border: 1px solid var(--line); }

.search-form-basic { display: flex; gap: 0; margin: 30px 0 60px; max-width: 560px; }
.search-form-basic input { flex: 1; background: var(--panel); border: 1px solid var(--line-strong); color: var(--bone); padding: 14px 18px; font-family: var(--font-body); font-size: 15px; }
.search-form-basic button { background: var(--bile); color: var(--ground); border: none; padding: 14px 22px; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; cursor: pointer; }

.contact-grid { max-width: 1100px; margin: 0 auto; padding: 60px 40px 130px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 70px; }
.contact-form form { display: flex; flex-direction: column; gap: 6px; }
.contact-form label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-mute); margin-top: 16px; }
.contact-form input, .contact-form textarea { background: var(--panel); border: 1px solid var(--line-strong); color: var(--bone); padding: 13px 16px; font-family: var(--font-body); font-size: 15px; }
.contact-form button { margin-top: 24px; align-self: flex-start; }
.contact-detail { margin-bottom: 22px; }
.contact-detail span { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-mute); margin-bottom: 6px; }
.contact-detail b { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; padding: 40px 24px 90px; } }

@media (max-width: 700px) {
	.stats-grid, .roster-grid, .press-grid, .journal-grid, .foot-grid { grid-template-columns: 1fr; }
}
