/* One black ground; the same identity, images, and rectangles form each screen. */
:root { --content-inset: 5%; }
html, body { background: black; }
.site-view-open { overflow: hidden; }
body:is(.site-page,.field-page) { font-size: 13px; }
:is(.site-page,.field-page) a, .work-return { text-transform: lowercase; text-decoration: underline; }
:is(.site-page,.field-page) :focus-visible, .work-page :focus-visible { outline: 2px dotted currentColor; outline-offset: 5px; }
main.site-main { display: block; overflow: visible; }
.site-shell { width: 100%; }
:is(.site-identity,.screen-identity) a, :is(.site-identity,.screen-identity) svg { display: block; width: 100%; height: 100%; }
:is(.site-identity,.screen-identity) a { text-transform: uppercase; }
:is(.site-identity,.screen-identity) text { fill: white; text-transform: uppercase; font-family: var(--font-family-main); font-weight: 400; }
.home-view { position: relative; height: 100svh; min-height: 600px; overflow: hidden; }
.home-name { position: absolute; z-index: 1; left: 3%; top: 2%; width: 94%; height: 28%; margin: 0; font-weight: 400; }
.home-image { position: absolute; inset: 0 0 0 58%; }
.home-image img { display: block; width: 100%; height: 100%; object-fit: fill; }
.nav-code { display: inline-block; width: 3ch; margin-right: 1ch; white-space: nowrap; }
.nav-label { white-space: nowrap; }
.home-navigation { position: absolute; z-index: 3; inset: 37% 4% 14%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, 1fr); grid-template-areas: "collection about" "thoughts reading" "watching listening" "homestuck hydrants"; align-items: start; gap: 10px 18px; --nav-step: clamp(16px, 5vw, 80px); }
.home-navigation a { display: flex; align-items: baseline; width: max-content; max-width: 100%; background: black; color: white; font-size: clamp(14px, 1.7vw, 24px); line-height: 1.4; text-decoration: none; }
.home-navigation a:hover { text-decoration: underline; }
.home-navigation .nav-code { flex: 0 0 3ch; }
.home-navigation .home-collection { grid-area: collection; }
.home-navigation .home-about { grid-area: about; }
.home-navigation .home-thoughts { grid-area: thoughts; }
.home-reading { grid-area: reading; }
.home-watching { grid-area: watching; }
.home-listening { grid-area: listening; }
.home-hydrants { grid-area: hydrants; }
.home-homestuck { grid-area: homestuck; }
/* Mirrored inward/outward steps share equal screen-edge insets. */
.home-about, .home-reading, .home-listening, .home-hydrants { justify-self: end; }
.home-thoughts { margin-left: var(--nav-step); }
.home-reading { margin-right: var(--nav-step); }
.home-watching { margin-left: calc(2 * var(--nav-step)); }
.home-listening { margin-right: calc(2 * var(--nav-step)); }
.home-homestuck { margin-left: calc(.5 * var(--nav-step)); }
.home-hydrants { margin-right: calc(.5 * var(--nav-step)); }
.color-artifacts, .collection-artifacts { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.color-rectangle { position: absolute; display: block; pointer-events: auto; cursor: pointer; padding: 0; margin: 0; border: 0; border-radius: 0; }
.rectangle-close { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 0; background: black; color: white; font: 14px/1 var(--font-family-main); cursor: pointer; opacity: 0; }
.color-rectangle:hover .rectangle-close, .color-rectangle:focus-visible .rectangle-close { opacity: 1; }
@media (hover: none), (max-width: 600px) { .rectangle-close { display: none; } }
.color-palette { position: absolute; z-index: 4; bottom: var(--palette-inset); left: var(--palette-inset); display: flex; gap: 5px; padding: 0; background: transparent; --palette-inset: clamp(16px, 3vmin, 32px); }
.color-palette button { width: 25px; height: 25px; border: 1px solid white; border-radius: 0; background: var(--swatch); cursor: pointer; padding: 0; }
.color-palette button[aria-pressed="true"] { outline: 1px solid white; outline-offset: 2px; }

/* Full-screen native dialogs supply focus containment and Escape, without window chrome. */
.site-view { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; box-sizing: border-box; margin: 0; padding: 0; border: 0; border-radius: 0; background: black; color: white; overflow: auto; font: inherit; }
.site-view::backdrop { background: black; }
:is(.site-header,.screen-chrome) { position: relative; min-height: 170px; padding: 28px 4%; box-sizing: border-box; }
:is(.site-header,.screen-chrome) :is(.site-identity,.screen-identity) { position: absolute; right: 4%; top: 24px; width: 32%; height: 75px; }
:is(.site-header,.screen-chrome) nav { display: flex; flex-wrap: wrap; gap: 18px 30px; width: 55%; }
:is(.site-header,.screen-chrome) nav a, :is(.site-header,.screen-chrome) button { white-space: nowrap; }
:is(.site-header,.screen-chrome) a, :is(.site-header,.screen-chrome) button { color: white; text-transform: lowercase; text-decoration: underline; }
:is(.site-header,.screen-chrome) button { padding: 0; border: 0; background: black; cursor: pointer; }
.collection-heading { position: relative; z-index: 3; padding: 0 8% 30px; }
.collection-heading h2 { text-transform: uppercase; margin: 20px 0 25px; font: 400 clamp(28px,4vw,62px)/1 var(--font-family-main); letter-spacing: .015em; }
.collection-categories, .collection-tags { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.collection-tags { margin-top: 18px; }
.collection-categories a, .collection-tags a { color: white; }
.collection-categories a[aria-current="page"], .collection-tags a[aria-current="page"] { background: blue; text-decoration: none; padding: 3px 8px; margin: -3px -8px; }
/* Each link owns a cell; irregular offsets remain safe as the catalog grows. */
.collection-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 80px 8%; padding: 25px 8% 100px; background: black; }
.collection-empty { grid-column: 1 / -1; margin: 0; font-size: 13px; line-height: 1.7; }
:is(.site-page,.field-page) a.collection-item { display: block; position: relative; color: white; text-decoration: none; width: 82%; min-width: 0; align-self: start; overflow-wrap: anywhere; }
.collection-grid .collection-item:nth-child(6n+2) { margin-top: 100px; justify-self: end; }
.collection-grid .collection-item:nth-child(6n+3) { margin-top: 30px; width: 70%; }
.collection-grid .collection-item:nth-child(6n+4) { margin-left: 12%; width: 72%; }
.collection-grid .collection-item:nth-child(6n+5) { margin-top: 60px; }
.collection-grid .collection-item:nth-child(6n) { margin-top: 110px; }
.collection-grid .collection-item[hidden] { display: none; }
.collection-media, .collection-thumbnail { display: block; position: relative; }
/* Distorted collection images stay inside stable slots; work-page art stays proportional. */
.collection-thumbnail { height: 180px; overflow: hidden; }
.collection-media img { display: block; width: 100%; height: 100%; object-fit: fill; }
/* These rectangles belong to the screen, independently of catalog entries. */
.collection-view :is(.site-header,.screen-chrome) { z-index: 3; }
.collection-view .color-palette, .collection-artifacts { position: fixed; }
.collection-title { display: block; margin-top: 12px; text-transform: uppercase; line-height: 1.4; }
.collection-item:focus-visible .collection-title { text-transform: lowercase; }
.collection-meta { display: block; font-size: 11px; margin-top: 8px; }
.collection-item:hover .collection-title, .collection-item:focus-visible .collection-title { text-decoration: underline; }
.about-room { position: relative; display: grid; grid-template-columns: minmax(0,53%) minmax(0,47%); align-items: start; min-height: 65svh; padding: 20px var(--content-inset) 70px; }
.about-copy { grid-column: 1; grid-row: 1; min-width: 0; padding-right: 10%; }
.about-copy .contact-text { max-width: 50ch; width: 100%; margin: 0 0 32px; font-size: 14px; line-height: 1.7; }
.about-image { display: block; width: 100%; max-width: 420px; height: auto; }
/* The color room: art on one side, large type on the other, copy always visible. */
:is(.page-header,.page-chrome) { min-height: 120px; font-size: 13px; }
:is(.page-header,.page-chrome) :is(.site-identity,.screen-identity) { height: 50px; width: 26%; }
:is(.page-header,.page-chrome) .site-nav { display: flex; width: 60%; gap: 16px 28px; justify-content: flex-start; text-align: left; padding: 0; font-size: 13px; }
:is(.page-header,.page-chrome) .site-nav a { width: auto; text-align: left; }
body.work-page .project-layout { display: grid; grid-template-columns: minmax(0,53%) minmax(0,47%); align-items: start; padding: 20px var(--content-inset) 60px; box-sizing: border-box; overflow: visible; gap: 0; }
.room-heading { position: relative; grid-column: 2; grid-row: 1; margin-left: 5%; padding: clamp(18px, 3vw, 40px); border: 1px solid white; box-sizing: border-box; min-width: 0; align-self: start; }
body.work-page #main-heading { width: 100%; margin: 0; text-align: right; font: 400 clamp(36px,min(9vw,calc(54vw / var(--title-length,8))),150px)/.88 var(--font-family-main); letter-spacing: .015em; overflow-wrap: anywhere; }
body.work-page #subtitle { width: auto; margin: 40px 0 0; text-align: right; font: 12px/1.6 var(--font-family-main); }
body.work-page .project-content { display: contents; }
body.work-page .project-section { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0,53%) minmax(0,47%); gap: 0; margin: 65px 0 0; }
body.work-page .project-section:first-child { display: contents; }
body.work-page .slideshow-wrapper { grid-column: 1; grid-row: 1; height: 65svh; max-height: 750px; width: 100%; min-width: 0; }
body.work-page .slideshow-inner { position: relative; align-items: flex-start; padding-bottom: 50px; }
body.work-page .slideshow-inner img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
body.work-page .slideshow-control { position: absolute; bottom: 0; width: auto; height: auto; font: 13px/1.5 var(--font-family-main); text-decoration: underline; }
body.work-page .slideshow-prev { left: 0; }
body.work-page .slideshow-next { right: 0; }
body.work-page .project-copy { grid-column: 1; grid-row: 2; width: auto; max-width: none; padding: 0; margin: 0 0 50px; font-size: 14px; line-height: 1.7; text-transform: lowercase; }
body.work-page .project-section:has(.slideshow-wrapper) .project-copy { margin-top: 32px; }
body.work-page .project-section:first-child:not(:has(.slideshow-wrapper)) .project-copy { grid-row: 1; }
body.work-page .project-layout:has(> .interface) .project-section:first-child .project-copy { grid-row: 2; margin-top: 32px; }
body.work-page .project-copy p { text-align: left; margin-bottom: 24px; }
body.work-page .interface { grid-column: 1; grid-row: 1; min-width: 0; }
body.work-page .interface .buddha-display { flex-direction: column; margin: 20px 0; }
body.work-page .interface .left-pane, body.work-page .interface .right-pane { width: 100%; max-width: 100%; padding: 10px 0; }
body.work-page .interface #portal { font-size: .44vw; }
body.work-page .interface .controls { justify-content: flex-start; margin-top: 0; }
body.work-page .iframe { grid-column: 1 / -1; width: 90%; height: auto; max-height: 80svh; margin: 50px auto; }
body.work-page .writing-layout { display: grid; grid-template-columns: minmax(0,60%) minmax(0,40%); align-items: start; padding: 20px var(--content-inset) 60px; box-sizing: border-box; overflow: visible; }
body.work-page .writing-layout #main-heading { font-size: clamp(36px,min(6vw,calc(45vw / var(--title-length,8))),100px); }
body.work-page .writing-layout .writing-body { grid-column: 1; grid-row: 1; min-width: 0; padding-right: 10%; }
body.work-page .writing-layout .writing-content { margin: 0; padding: 0; max-width: none; width: 100%; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
body.work-page .writing-content + .writing-content { margin-top: 30px; }
.work-return { display: block; grid-column: 1 / -1; width: fit-content; font-size: 12px; margin: 60px 0 0; padding: 14px 20px; background: blue; color: white; }
@media (max-width: 600px) {
    :root { --content-inset: 6%; }
    .home-view { min-height: 600px; }
    .home-name { top: 2%; left: 4%; width: 92%; height: 24%; }
    .home-image { inset: 0 0 0 56%; }
    .home-navigation { inset: 33% 6% 14%; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "collection about" "thoughts reading" "watching listening" "homestuck hydrants"; gap: 10px 12px; --nav-step: 1ch; }
    .home-navigation a { font-size: 14px; }
    .color-palette { gap: 5px; }
    .color-palette button { width: 27px; height: 27px; }
    :is(.site-header,.screen-chrome) { padding: 20px 5%; min-height: 200px; }
    :is(.site-header,.screen-chrome) nav, :is(.page-header,.page-chrome) .site-nav { width: 100%; gap: 15px 20px; font-size: 12px; }
    :is(.site-header,.screen-chrome) :is(.site-identity,.screen-identity) { width: 57%; height: 42px; top: 62px; right: 5%; }
    .collection-heading { padding: 0 6% 20px; }
    .collection-heading h2 { margin: 0 0 25px; font-size: 32px; }
    .collection-categories, .collection-tags { gap: 15px 20px; }
    .collection-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 35px 6% 70px; gap: 65px 10%; }
    .collection-grid .collection-item:nth-child(n) { width: 90%; margin: 0; }
    .collection-grid .collection-item:nth-child(2n) { margin-top: 70px; justify-self: end; }
    .collection-thumbnail { height: 150px; }
    .about-room { display: flex; flex-direction: column; align-items: stretch; padding: 15px var(--content-inset) 60px; }
    .about-copy { padding: 0; }
    :is(.page-header,.page-chrome) { min-height: 140px; }
    body.work-page .project-layout, body.work-page .writing-layout { display: flex; flex-direction: column; align-items: stretch; padding: 15px var(--content-inset) 45px; }
    .room-heading { margin: 0 0 30px; padding: 20px; align-self: stretch; }
    body.work-page #main-heading { font-size: clamp(36px,min(15vw,calc(138vw / var(--title-length,8))),90px); }
    body.work-page #subtitle { margin: 25px 0 0; }
    body.work-page .project-section, body.work-page .project-section:first-child { display: contents; }
    body.work-page .slideshow-wrapper { height: 55svh; margin: 0 0 40px; }
    body.work-page .project-copy { padding: 0; margin: 20px 0 60px; max-width: none; }
    body.work-page .interface .buddha-display { height: auto; margin-bottom: 30px; }
    body.work-page .interface #portal { font-size: .85vw; }
    body.work-page .writing-layout .writing-body { padding: 0; }
    .work-return { margin-left: 0; }
}

.fallback-navigation { display: flex; gap: 28px; padding: 28px 5%; }
