/* EISKAL — Oct 2026 fixes: image framing, space-grouped galleries, fixed header, focus, mobile CTA.
   Loaded after the original inline styles; selectors are prefixed with "html body" to win over the 2026 theme rules. */

/* ---------- Fixed header (stays available over every section) ---------- */
html body .nav{position:fixed;top:0;left:0;right:0;width:100%;z-index:60}
html body .nav{transition:background-color .35s ease,border-color .35s ease}
html body .nav.is-scrolled{background:rgba(28,25,21,.94)}
html{scroll-padding-top:96px}
html body .modal{z-index:200}
html body .project-detail{z-index:150}
@media (max-width:760px){
  html body .nav{height:64px;padding:0 16px;gap:10px}
  html body .nav > .btn{display:inline-flex;align-items:center;padding:9px 12px;font-size:10px;letter-spacing:.12em;white-space:nowrap}
  html body .nav > .btn .arrow{display:none}
  html{scroll-padding-top:76px}
}

/* ---------- Focus visibility ---------- */
html body :focus-visible{outline:2px solid #C9A97A;outline-offset:3px}
html body .project-card:focus-visible{outline-offset:6px}
html body .project-detail:focus{outline:none}

/* ---------- Portfolio cards: frame = the cover's own proportions (no cropping) ---------- */
html body .project-grid{grid-template-columns:repeat(3,minmax(0,1fr));column-gap:clamp(16px,2vw,30px);row-gap:clamp(40px,5vw,72px);align-items:start}
html body .project-grid .project-card,html body .project-grid .project-card[data-span]{grid-column:auto}
html body .project-grid .project-card .project-image{height:auto;max-height:none;background:#2A2620}
html body .project-grid .project-card .project-image img{width:100%;height:100%;object-fit:cover;object-position:center}
@media (max-width:1100px){html body .project-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:760px){html body .project-grid{grid-template-columns:1fr}}

/* ---------- Project detail hero (pass 4) ----------
   Left: title, overview and key facts (sticky while the cover scrolls). Right: the cover at full column width, whole frame,
   never cropped. Replaces the pass-3 layout where a height-capped cover sat beside a mostly empty half-screen. */
html body .project-detail .detail-hero{height:auto;min-height:0;margin:clamp(24px,3vw,40px) 0 clamp(64px,8vw,120px);background:none;overflow:visible;display:grid;grid-template-columns:minmax(300px,1fr) auto;gap:clamp(32px,4.5vw,80px);align-items:start}
html body .project-detail .detail-hero:after{display:none}
html body .project-detail .detail-hero-copy{position:sticky;top:clamp(96px,10vh,120px);left:auto;bottom:auto;color:var(--ink);padding:0}
html body .project-detail .detail-hero-copy .eyebrow{color:var(--muted)}
html body .project-detail .detail-hero-copy h1{font-size:clamp(44px,5.2vw,88px);margin:16px 0 14px}
html body .project-detail .detail-hero-copy .detail-loc{font:10px var(--mono),monospace;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin:0}
html body .project-detail .detail-hero-copy .detail-overview{display:block;padding:clamp(28px,3vw,40px) 0 0;margin:clamp(28px,3vw,40px) 0 0;border:0;border-top:1px solid var(--line)}
html body .project-detail .detail-hero-copy .detail-overview h2{font:10px/1.4 var(--mono),monospace;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);margin:0 0 16px}
html body .project-detail .detail-hero-copy .detail-overview p{font:16px/1.75 var(--sans,inherit);letter-spacing:0;text-transform:none;color:var(--ink);opacity:.86;margin:0;max-width:560px}
html body .project-detail .detail-hero-copy .detail-overview p + p{margin-top:14px}
html body .project-detail .detail-hero-copy .detail-concept{color:var(--muted);opacity:1;font-style:italic}
html body .project-detail .detail-hero-copy .detail-specs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px;padding:0;margin:clamp(28px,3vw,40px) 0 0}
html body .project-detail .detail-spec{border-top:1px solid var(--line);padding-top:12px;margin:0}
html body .project-detail .detail-spec dt{font:9px var(--mono),monospace;letter-spacing:.12em;color:var(--muted);text-transform:uppercase;margin:0 0 8px}
html body .project-detail .detail-spec dd{margin:0;font-size:14px;font-weight:500;line-height:1.5}
html body .project-detail .detail-hero-media{margin:0;background:#2A2620}
html body .project-detail .detail-hero-media img{width:auto;height:auto;max-width:min(60vw,1100px);max-height:calc(100svh - 120px);object-fit:contain;display:block}  /* whole frame visible in one screen */
@media (max-width:760px){
  html body .project-detail .detail-hero{grid-template-columns:1fr;gap:28px;margin:16px 0 56px}
  html body .project-detail .detail-hero-media{order:-1}
  html body .project-detail .detail-hero-copy{position:static}
  html body .project-detail .detail-hero-media img{width:100%;max-width:100%;max-height:none}
  html body .project-detail .detail-hero-copy h1{font-size:clamp(38px,11vw,56px)}
  html body .project-detail .detail-hero-copy .detail-overview p{font-size:15px}
}

/* ---------- Space index + space-grouped gallery ---------- */
.dg-index-nav{display:flex;flex-wrap:wrap;gap:8px 10px;margin:0 0 clamp(36px,5vw,64px);padding-top:6px}
.dg-index-nav a{font:10px/1 var(--mono),monospace;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);border:1px solid rgba(242,237,230,.18);padding:10px 12px;text-decoration:none}
.dg-index-nav a:hover{color:var(--ink);border-color:rgba(242,237,230,.5)}
.detail-gallery{display:flex;flex-direction:column;gap:clamp(56px,7vw,104px);margin:0 0 80px}
.dg-space{scroll-margin-top:84px}
.dg-head{display:grid;grid-template-columns:auto 1fr;column-gap:18px;row-gap:8px;align-items:baseline;margin:0 0 clamp(18px,2.4vw,30px);max-width:880px}
.dg-index{font:10px var(--mono),monospace;letter-spacing:.14em;color:var(--muted);grid-row:1/3}
.dg-head h3{margin:0;font-family:var(--serif);font-weight:400;font-size:clamp(24px,2.6vw,38px);letter-spacing:-.02em;color:var(--ink)}
.dg-head p{margin:0;grid-column:2;color:var(--muted);font-size:15px;line-height:1.7;max-width:640px}
/* Six-track grid: pairs span 3, closing trios span 2, landscapes span 6. Every image keeps its whole frame (no object-fit crop). */
.dg-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:clamp(12px,1.6vw,22px);align-items:start}
.dg-item{margin:0;background:#2A2620;grid-column:span 3}
.dg-item img{display:block;width:100%;height:auto}
.dg-item.is-third{grid-column:span 2}
.dg-item.is-full{grid-column:1/-1;background:none;display:flex;justify-content:center}
.dg-item.is-full img{width:auto;max-width:100%;max-height:calc(100svh - 120px)}  /* near-square frames stay fully on screen */
.dg-item.is-solo{grid-column:1/-1}
/* A single portrait: caption beside the image instead of a narrow image floating in a wide empty row. */
.dg-space.is-solo{display:grid;grid-template-columns:minmax(260px,1fr) auto;gap:clamp(32px,4.5vw,80px);align-items:start}
.dg-space.is-solo .dg-head{position:sticky;top:clamp(96px,10vh,120px);margin:0;grid-template-columns:1fr}
.dg-space.is-solo .dg-index{grid-row:auto}
.dg-space.is-solo .dg-head p{grid-column:1}
.dg-space.is-solo .dg-grid{grid-template-columns:1fr}
.dg-space.is-solo .dg-item img{width:auto;max-width:60vw;max-height:calc(100svh - 120px)}
/* Lone portrait inside a mixed (landscape + portrait) space: centred at screen height. */
.dg-space:not(.is-solo) .dg-item.is-solo{background:none;display:flex;justify-content:center}
.dg-space:not(.is-solo) .dg-item.is-solo img{width:auto;max-width:100%;max-height:calc(100svh - 120px)}
@media (max-width:760px){
  .dg-grid{grid-template-columns:1fr}
  .dg-item,.dg-item.is-third,.dg-item.is-full,.dg-item.is-solo{grid-column:1/-1}
  .dg-space.is-solo{display:block}
  .dg-space.is-solo .dg-item img{width:100%;max-width:100%;max-height:none}
  .dg-space.is-solo .dg-head{position:static;margin:0 0 18px}
  .dg-space:not(.is-solo) .dg-item.is-solo img,.dg-item.is-full img{width:100%;max-height:none}
  .dg-head{grid-template-columns:1fr}.dg-index{grid-row:auto}.dg-head p{grid-column:1}
}

/* ---------- Hero (pass 4) ----------
   The 16:9 film is the primary hero (its poster shows at once); the portrait stills are only a fallback.
   Shade: a top band keeps the navigation and top line legible, the left/bottom band carries the title and call to action. */
html body .hero-video{object-position:50% 50%}
html body .hero-slide img{object-position:50% 58%}
html body .hero-shade{background:
  linear-gradient(180deg,rgba(28,25,21,.66) 0,rgba(28,25,21,.18) 22%,rgba(28,25,21,0) 34%),
  linear-gradient(90deg,rgba(28,25,21,.74) 0,rgba(28,25,21,.36) 46%,rgba(28,25,21,.08) 78%),
  linear-gradient(0deg,rgba(28,25,21,.66) 0,rgba(28,25,21,0) 46%)}
@media (max-width:760px){
  /* Social links overlapped the title on phones; they remain in the contact section and footer. */
  html body .hero-social{display:none}
  html body .hero-shade{background:
    linear-gradient(180deg,rgba(28,25,21,.62) 0,rgba(28,25,21,0) 26%),
    linear-gradient(0deg,rgba(28,25,21,.82) 0,rgba(28,25,21,.36) 52%,rgba(28,25,21,.12) 100%)}
}

/* ---------- Brief dialog helper text ---------- */
.brief-note{margin:22px 0 0;color:var(--muted);font-size:13px;line-height:1.6;max-width:640px}
.brief-status{min-height:1.4em;margin-top:10px;font-size:13px}

html body .project-detail .detail-top{background:rgba(28,25,21,.985)}

/* WCAG AA: muted text on ivory sections (was #756F68, 4.26:1) */
html body .tone-light,html body .services,html body .modal{--muted:#645E57}

/* Tablet (761–991 px): the two-column detail hero and the caption-beside-image spaces need ~800 px; stack them below 992 px
   (the typography breakpoint), keeping the whole frame of every image visible. */
@media (max-width:991px){
  html body .project-detail .detail-hero{grid-template-columns:1fr;gap:28px}
  html body .project-detail .detail-hero-media{order:-1;justify-self:center}
  html body .project-detail .detail-hero-copy{position:static}
  html body .project-detail .detail-hero-media img{max-width:100%;max-height:calc(100svh - 120px)}
  .dg-space.is-solo{display:block}
  .dg-space.is-solo .dg-head{position:static;margin:0 0 18px}
  .dg-space.is-solo .dg-grid{justify-items:center}
  .dg-space.is-solo .dg-item img{max-width:100%;max-height:calc(100svh - 120px)}
}