/*
 * Frame-by-frame geometry closure — 13 October 2026.
 * Preserve the approved illustrations, typography, colours, animation and copy.
 * Use the actual available viewport as a MINIMUM, never as a content crop.
 * Explicit exceptions: cinematic pinned Work, short Next Project transitions,
 * and readable, continuously scrolling Privacy content.
 */
:root {
  --frame-header: var(--vp-header, 81px);
  --frame-room: calc(100svh - var(--frame-header));
  --frame-gutter: var(--sh-gutter, clamp(24px, 3.6vw, 64px));
  --frame-entry: clamp(24px, 3.3svh, 36px);
  --frame-exit: var(--frame-entry);
}
@media (max-width: 800px) {
  :root {
    --frame-header: 70px;
    --frame-entry: clamp(25px, 3.5svh, 35px);
    --frame-exit: var(--frame-entry);
  }
}

/* Identical label line boxes and text origin on every individual scene.
 * Keep the approved foreground colours, underlines and font families. */
:root {
  --frame-label-size: 12px;
  --frame-label-line: 1.4;
}
body:not(.case-body) :is(
  #intro .manifesto-work__eyebrow,
  #work .tiny-line,
  #about .section-kicker,
  #skills .section-mini-label,
  #approach .approach-reimagined__kicker--rail,
  #company .company-showcase__eyebrow,
  #message .contact-overline,
  #projects .chapter-trackside
),
.case-body #case-main .case-overline,
body:not(.case-body) main#content > .eyebrow {
  box-sizing: border-box;
  font-size: var(--frame-label-size);
  line-height: var(--frame-label-line);
  margin-top: 0;
  text-align: left;
}
/* All browser viewports see the SAME outer frame top/bottom inset. Inner
 * text, media and dividers may have individual space according to content. */
body:not(.case-body) :is(#intro,#work,#about,#skills) {
  padding-block: var(--frame-entry) var(--frame-exit);
}
#company .company-showcase__separate {
  padding-top: var(--frame-entry);
  padding-bottom: var(--frame-exit);
}
#message.contact-section.contact-unified {
  padding-bottom: var(--frame-exit);
}
.case-body #case-main > .case-section.alt .case-demo > div:first-child {
  align-self: start;
}
.case-body #case-main > .case-section.alt .case-demo-panel {
  align-self: center;
}
.case-body #case-main > .case-next {
  min-height: var(--frame-room);
  align-items: start;
}
/* Next Project is a self-contained frame: place its small label on the top
 * rail, and balance headline and CTA in the remaining space rather than
 * leaving both stuck to the top with one huge empty band beneath. */
.case-body #case-main > .case-next {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  grid-template-rows: auto minmax(min-content,1fr);
  gap: clamp(16px, 2.6svh, 30px) clamp(24px,4vw,60px);
}
.case-body #case-main > .case-next > div { display: contents; }
.case-body #case-main > .case-next .case-overline {
  grid-column: 1/-1;
  grid-row: 1;
}
.case-body #case-main > .case-next h2 {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  margin: 0;
}
.case-body #case-main > .case-next > a {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
}
@media (max-width: 750px) {
  .case-body #case-main > .case-next {
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: auto auto auto;
    align-content: start;
  }
  .case-body #case-main > .case-next .case-overline { grid-column:1; grid-row:1; }
  .case-body #case-main > .case-next h2 { grid-column:1; grid-row:2; }
  .case-body #case-main > .case-next > a { grid-column:1; grid-row:3; justify-self:start; }
}
/* The privacy footer is part of the site and must share its global x rail. */
body:not(.case-body) > footer {
  padding-inline: var(--frame-gutter);
}

/* Every principal frame uses the SAME left rail as the global identity.
 * Case pages and Privacy inherit this gutter through their scoped rules. */
body:not(.case-body) :is(#intro, #work, #about, #skills) {
  padding-inline: var(--frame-gutter);
}
#approach.approach-reimagined,
#message.contact-section.contact-unified {
  padding-inline: var(--frame-gutter);
}
#company.company-section.company-showcase {
  --co-gutter: var(--frame-gutter);
}
/* Retain the approved How I Work heading/visual relationship, while lifting
 * only its small scene label into the same header-clear entry rail. */
#approach .approach-reimagined__frame {
  position: relative;
}
#approach .approach-reimagined__kicker--rail {
  position: absolute;
  top: var(--frame-entry);
  left: 0;
  z-index: 5;
  margin: 0;
}
#approach .approach-reimagined__intro {
  padding-top: clamp(39px, 5.5svh, 60px);
}
@media (max-width: 1050px) {
  #approach .approach-reimagined__intro {
    padding-top: clamp(28px, 4svh, 38px);
  }
}

/* HOME — each numbered scene has one header-clear start and can grow naturally.
 * The selected hero intentionally remains a full-window cinematic opening. */
body:not(.case-body) :is(#intro, #work, #about, #skills, #approach, #company, #message) {
  box-sizing: border-box;
  min-height: var(--frame-room);
  height: auto;
  scroll-margin-top: var(--frame-header);
}
body:not(.case-body) :is(#intro, #work, #about, #skills) {
  padding-top: var(--frame-entry);
  padding-bottom: var(--frame-exit);
}
/* Intro text and the founder-selected photograph continue to determine height. */
#intro.manifesto--work-first {
  min-height: var(--frame-room);
  height: auto;
  padding-top: var(--frame-entry);
}
/* The Intro's decorative dash belongs AFTER the small label so its text
 * shares the same left-hand character origin as every other frame label. */
#intro .manifesto-work__eyebrow-mark {
  order: 2;
  flex-shrink: 0;
}
/* A mobile frame no longer collapses to a short strip merely because a former
 * mobile rule assigned min-height:0. Content always wins above the minimum. */
#work.work-introduction,
#about.personal-section,
#skills.skills-section {
  min-height: var(--frame-room);
  height: auto;
}
/* HOW I WORK — same outer entry/exit contract, different editorial internals. */
#approach.approach-reimagined,
#approach .approach-reimagined__frame {
  min-height: var(--frame-room);
  height: auto;
}
#approach .approach-reimagined__frame {
  padding-top: var(--frame-entry);
  padding-bottom: var(--frame-exit);
}

/* COMPANY — two intentional zones in ONE section; avoid shrinking the hero
 * into the separate-work strip when copy and illustration need more room. */
#company.company-section.company-showcase {
  min-height: var(--frame-room);
  height: auto;
  grid-template-rows: minmax(min-content, 1fr) auto;
  padding: 0;
}
#company .company-showcase__hero {
  grid-template-rows: auto minmax(min-content, 1fr);
  padding-top: var(--frame-entry);
}
/* Existing separate-work band remains attached below the company hero.
 * No duplicate page, scroll snap, new colour or relocated content. */

/* CONTACT — correct the 44px label-baseline mismatch visible in founder
 * screenshots. Keep captcha, exact form fields and live send flow intact. */
#message.contact-section.contact-unified {
  min-height: var(--frame-room);
  height: auto;
  padding-top: var(--frame-entry);
  padding-bottom: var(--frame-exit);
}
#message .contact-unified-layout {
  min-width: 0;
  align-items: start;
  padding-top: clamp(23px, 3svh, 39px);
  padding-bottom: clamp(12px, 1.6svh, 22px);
}
#message .contact-unified-intro,
#message .contact-form-shell {
  min-width: 0;
  align-self: start;
}
#message .footerline {
  min-width: 0;
}

/* WORK THEATRE — keep the original 3-stage horizontal choreography, but put
 * its rail and buttons BELOW the fixed 81px navigation instead of behind it.
 * At phone/tablet widths the existing natural vertical chapters are retained. */
@media (min-width: 801px) {
  body:not(.case-body) .work-theatre .work-pin {
    position: sticky;
    top: var(--frame-header);
    height: var(--frame-room);
    max-height: var(--frame-room);
  }
  .work-theatre .chapter-trackside {
    padding-top: var(--frame-entry);
    padding-bottom: clamp(13px, 1.8svh, 20px);
  }
  .work-theatre .chapter-inner {
    padding-top: clamp(11px, 1.6svh, 23px);
    padding-bottom: clamp(11px, 1.6svh, 23px);
  }
  .work-theatre .chapter-bottom {
    padding-top: clamp(12px, 1.7svh, 19px);
    padding-bottom: clamp(12px, 1.7svh, 19px);
  }
}
@media (max-width: 800px) {
  body:not(.case-body) .work-theatre .work-pin {
    position: relative;
    top: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  body:not(.case-body) .work-theatre .chapter {
    height: auto;
  }
  /* Stacked mobile chapters have no sticky stage inset. Their own label
   * rail must clear the fixed 70px header on entry. */
  .work-theatre .chapter-trackside {
    padding-top: var(--frame-entry);
  }
  /* The #projects entry already has scroll-margin-top for the 70px header.
   * A second header-sized padding would shift labels down by another 70px. */
  .work-theatre .chapter {
    scroll-margin-top: var(--frame-header);
  }
}
/* The theatre must not visually clip controls on compact-height desktops. */
@media (min-width: 801px) and (max-height: 740px) {
  .work-theatre .chapter-trackside { padding-block: 13px; }
  .work-theatre .chapter-inner { padding-block: 8px; }
  .work-theatre .chapter-bottom { padding-block: 9px; }
  .work-theatre .chapter-description { margin-block: 16px; }
}

/* THREE WORK ROUTES — heading and illustration must START on the same row.
 * Different project content can increase the section height naturally. */
.case-body #case-main > .case-hero {
  box-sizing: border-box;
  min-height: var(--frame-room);
  height: auto;
  padding: var(--frame-entry) var(--frame-gutter) var(--frame-exit);
  align-items: start;
}
.case-body #case-main .case-hero-copy,
.case-body #case-main .case-hero > .case-visual {
  min-width: 0;
  align-self: start;
}
.case-body #case-main > .case-section,
.case-body #case-main > .case-depth,
.case-body #case-main > .case-honesty,
.case-body #case-main > .case-next {
  box-sizing: border-box;
  padding-inline: var(--frame-gutter);
}
/* Process and demonstration have enough available room for their actual
 * content, with a common top label/title rail rather than arbitrary 100px. */
.case-body #case-main > .case-section {
  min-height: var(--frame-room);
  height: auto;
  padding-top: var(--frame-entry);
  padding-bottom: var(--frame-exit);
}
/* A process narrative has four different visual weights. Put the three
 * explanatory steps in the available lower area instead of collecting a
 * large dead band under short paragraphs on tall desktop screens. */
.case-body #case-main > #process.case-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(min-content, 1fr);
  align-items: start;
}
.case-body #process .case-steps {
  width: 100%;
  align-self: center;
}
/* Interactive panels form one balanced stage, preserving their native
 * button/aria-live controls and expanding when content wraps. */
.case-body #case-main > .case-section.alt .case-demo {
  min-height: max(360px, calc(var(--frame-room) - var(--frame-entry) - var(--frame-exit)));
  align-items: start;
}
/* Long depth/evidence passages stay natural reading flow. */
.case-body #case-main > .case-depth {
  min-height: var(--frame-room);
  height: auto;
  padding-top: var(--frame-entry);
  padding-bottom: var(--frame-exit);
}
.case-body .case-depth__opening,
.case-body .case-depth__founder {
  margin-left: 0;
  margin-right: auto;
}
/* Closing explanation and Next Project are intentionally shorter narrative
 * transitions, not empty 100vh frames. Their headings align to the same rail. */
.case-body #case-main > .case-honesty {
  min-height: var(--frame-room);
  height: auto;
  padding-top: var(--frame-entry);
  padding-bottom: var(--frame-exit);
}
.case-body #case-main > .case-next {
  height: auto;
  padding-top: var(--frame-entry);
  padding-bottom: var(--frame-exit);
}
.case-body .case-footer {
  padding-inline: var(--frame-gutter);
}

/* PRIVACY — first eyebrow/title share the header's horizontal and vertical
 * grid, but the four legal paragraphs retain compact readable widths. */
body:not(.case-body) main#content {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-height: var(--frame-room);
  margin: 0;
  padding: var(--frame-entry) var(--frame-gutter) var(--frame-exit);
}
body:not(.case-body) main#content > h1 {
  margin-top: clamp(26px, 3.5svh, 43px);
  margin-bottom: clamp(44px, 6svh, 70px);
}
body:not(.case-body) main#content > .section {
  max-width: 1250px;
}
/* Match mobile navigation header surface to the original Home interaction.
 * Leave header heights, labels, colours and links otherwise untouched. */
body.menu-open .site-header.shared-header {
  background: var(--sh-accent);
  color: var(--sh-ink);
  border-bottom-color: transparent;
}

/* CASE ROUTE ANCHORS — clicking a frame's label/title must not land
 * beneath the 81px/70px shared header. Keep the same visible entry rhythm
 * for direct #process, #interaction-title and #status-title links. */
.case-body #case-main > #process {
  scroll-margin-top: var(--frame-header);
}
.case-body #case-main :is(
  #interaction-title,
  #status-title,
  #trenic-scope-title,
  #jewellery-scope-title,
  #backoffice-scope-title
) {
  scroll-margin-top: calc(var(--frame-header) + var(--frame-entry) + 42px);
}
/* Preserve equivalent bottom-space for each of the three Work routes and
 * their naturally sized footers, even when the article text wraps. */
.case-body #case-main > :is(.case-section,.case-depth,.case-honesty,.case-next) {
  padding-bottom: var(--frame-exit);
}

/* Phone & tablet — preserve natural stack, never force a fixed-height crop.
 * Tall Skills/forms, image, demonstration cards and legal copy can scroll. */
@media (max-width: 1080px) {
  .case-body #case-main > .case-hero {
    align-items: start;
  }
}
@media (max-width: 900px) {
  #company.company-section.company-showcase {
    grid-template-rows: auto auto;
  }
  #company .company-showcase__hero {
    grid-template-rows: auto auto;
  }
}
@media (max-width: 800px) {
  #message .contact-unified-layout {
    padding-top: clamp(20px, 3.1svh, 32px);
    padding-bottom: clamp(14px, 2svh, 22px);
  }
  #message.contact-section.contact-unified {
    min-height: var(--frame-room);
    height: auto;
  }
  .case-body #case-main > :is(.case-hero,.case-section,.case-depth,.case-honesty,.case-next) {
    min-height: 0;
    height: auto;
  }
  .case-body #case-main > .case-hero {
    padding-top: var(--frame-entry);
    padding-bottom: var(--frame-exit);
  }
  .case-body #case-main > .case-section.alt .case-demo {
    min-height: 0;
    align-items: start;
  }
  .case-body #case-main > .case-section,
  .case-body #case-main > .case-depth,
  .case-body #case-main > .case-honesty {
    padding-block: var(--frame-entry) var(--frame-exit);
  }
}
@media (max-width: 600px) {
  #company.company-section.company-showcase,
  #message.contact-section.contact-unified {
    height: auto;
  }
  #company .company-showcase__visual {
    min-width: 0;
  }
  #message .contact-form-shell,
  #message .message-form {
    min-width: 0;
    max-width: 100%;
  }
  body:not(.case-body) main#content > .section {
    width: 100%;
  }
}
@media (max-width: 360px) {
  :root { --frame-entry: 25px; --frame-gutter: 24px; }
}

/* ================================================================
   Shared visible frame contract: 14 October 2026
   One header-clear viewport is the preferred frame size on desktop.
   Content can expand its OWN frame instead of clipping or overlapping
   the following one. No snap, fixed content crop, artwork or motion
   changes. The first cinematic hero includes the fixed site header.
   ================================================================ */
:root {
  --frame-body-space: calc(var(--frame-room) - var(--frame-entry) - var(--frame-exit));
}

/* Founder opening: the small label begins on the same optical Y rail as
   every other scene (global 81/70px header + common entry padding).
   Reserve the site-footer cue at the same bottom inset. */
body:not(.case-body) #top.hero {
  box-sizing: border-box;
  height: auto;
  min-height: 100svh;
  padding: calc(var(--frame-header) + var(--frame-entry))
           var(--frame-gutter)
           calc(var(--frame-exit) + 62px);
  justify-content: flex-start;
}
body:not(.case-body) #top .hero-overline {
  flex: 0 0 auto;
  font-size: var(--frame-label-size);
  line-height: var(--frame-label-line);
}
body:not(.case-body) #top .hero-name-wrap {
  margin-top: auto;
  min-width: 0;
}
body:not(.case-body) #top .hero-bottom {
  margin-top: clamp(15px, 2.2svh, 28px);
  margin-bottom: auto;
}
body:not(.case-body) #top .hero-footer {
  left: var(--frame-gutter);
  right: var(--frame-gutter);
  bottom: var(--frame-exit);
}

/* The outer frame is common, the inner composition stays section-specific.
   These content rows get the remaining space instead of arbitrary spacers. */
body:not(.case-body) :is(#intro, #work, #about, #skills, #approach, #company, #message) {
  box-sizing: border-box;
  min-height: var(--frame-room);
  height: auto;
  scroll-margin-top: var(--frame-header);
}
body:not(.case-body) :is(#intro, #work, #about, #skills) {
  padding: var(--frame-entry) var(--frame-gutter) var(--frame-exit);
}
@media (min-width: 901px) {
  #intro .manifesto-work__layout {
    min-height: var(--frame-body-space);
  }
}
#about.personal-section {
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr);
  align-items: stretch;
}
#about.personal-section .about-grid {
  align-self: center;
  margin-block: 0;
}
#skills.skills-section {
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr);
  align-content: stretch;
  justify-content: stretch;
}
#skills.skills-section .skills-grid {
  width: 100%;
  align-self: center;
  margin-bottom: 0;
}
#work.work-introduction .work-intro-bottom {
  align-self: end;
  margin-bottom: 0;
}

/* The How I Work internal grid owns the vertical padding: never count it
   both on the section and on its content frame. */
#approach.approach-reimagined {
  padding-block: 0;
}
#approach .approach-reimagined__frame {
  box-sizing: border-box;
  min-height: var(--frame-room);
  height: auto;
  padding-block: var(--frame-entry) var(--frame-exit);
}
#approach .approach-reimagined__kicker--rail {
  top: var(--frame-entry);
}

/* Company retains its existing illustrated product and other-work summary.
   The latter is the Company FRAME FOOTER, not a second floating page.
   Keep the summary and both project names, with a genuine bottom rail. */
#company.company-section.company-showcase {
  grid-template-rows: minmax(min-content, 1fr) auto;
  align-content: stretch;
}
#company .company-showcase__hero {
  min-height: 0;
  height: auto;
  padding-top: var(--frame-entry);
  padding-bottom: clamp(10px, 1.5svh, 18px);
}
#company .company-showcase__body {
  min-width: 0;
  min-height: 0;
}
#company .company-showcase__separate {
  padding-inline: var(--frame-gutter);
  padding-top: clamp(12px, 1.7svh, 21px);
  padding-bottom: var(--frame-exit);
}

/* Contact: one label rail, one balanced main row, one low footer rail.
   Keep the real form, provider protection and natural mobile form height. */
#message.contact-section.contact-unified {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(min-content, 1fr) auto;
  align-content: stretch;
  row-gap: clamp(12px, 1.8svh, 24px);
  padding: var(--frame-entry) var(--frame-gutter) var(--frame-exit);
}
#message .contact-unified-layout {
  align-self: center;
  min-width: 0;
  padding-block: clamp(9px, 1.2svh, 17px);
}
#message .footerline {
  align-self: end;
  margin-block: 0;
  padding-top: clamp(9px, 1.4svh, 16px);
}

/* The three cinematic chapters must use exactly the SAME outer X and
   top/bottom label insets. Leave their separate product scenes intact. */
body:not(.case-body) #projects .chapter-trackside,
body:not(.case-body) #projects .chapter-inner,
body:not(.case-body) #projects .chapter-bottom {
  padding-inline: var(--frame-gutter);
}
body:not(.case-body) #projects .chapter-trackside {
  padding-top: var(--frame-entry);
}
body:not(.case-body) #projects .chapter-bottom {
  padding-top: clamp(10px, 1.5svh, 17px);
  padding-bottom: var(--frame-exit);
}

/* The three Work case studies keep six independent content frames each.
   Content and controls never disappear under an artificially fixed height. */
.case-body #case-main > :is(.case-hero, .case-section, .case-depth, .case-honesty, .case-next) {
  box-sizing: border-box;
  min-height: var(--frame-room);
  height: auto;
  padding-inline: var(--frame-gutter);
  padding-top: var(--frame-entry);
  padding-bottom: var(--frame-exit);
}
.case-body .case-footer {
  padding-inline: var(--frame-gutter);
  padding-bottom: var(--frame-exit);
}

/* Short laptop / landscape-height screens must not crop the project
   illustrations inside a fixed-height horizontal work stage.
   Reduced-motion visitors must be able to see ALL three chapters. */
@media (min-width: 801px) and (max-height: 740px),
       (min-width: 801px) and (prefers-reduced-motion: reduce) {
  body:not(.case-body) #projects.work-theatre {
    height: auto;
  }
  body:not(.case-body) #projects .work-pin {
    position: relative;
    top: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  body:not(.case-body) #projects .work-track {
    display: block;
    width: 100%;
    transform: none !important;
    will-change: auto;
  }
  body:not(.case-body) #projects .chapter {
    width: 100%;
    height: auto;
    min-height: var(--frame-room);
    overflow: hidden;
  }
  body:not(.case-body) #projects .chapter-inner {
    grid-template-columns: minmax(0, 1.14fr) minmax(0, .86fr);
    min-height: 0;
    padding-block: clamp(22px, 3svh, 36px);
  }
  body:not(.case-body) #projects .work-timeline {
    display: none;
  }
}
@media (min-width: 801px) and (max-height: 740px) {
  #intro .manifesto-work__photo {
    max-height: min(62svh, 480px);
    width: auto;
    max-width: 100%;
    object-fit: contain;
  }
  #projects .chapter h3 {
    font-size: clamp(64px, 8.8vw, 140px);
  }
  #projects .chapter-description {
    margin-block: clamp(12px, 2svh, 21px);
  }
}

/* Tablet and phone pages remain independent natural-height cards.
   All have the same minimum available window and entry/exit insets.
   The long skills list, contact form and case narratives can grow. */
@media (max-width: 800px) {
  body:not(.case-body) #top.hero {
    min-height: 100svh;
    height: auto;
    padding-top: calc(var(--frame-header) + var(--frame-entry));
    padding-bottom: calc(var(--frame-exit) + 55px);
  }
  body:not(.case-body) #top .hero-name-wrap {
    margin-top: clamp(30px, 9svh, 90px);
  }
  body:not(.case-body) #top .hero-bottom {
    margin-top: clamp(16px, 4svh, 42px);
    margin-bottom: auto;
  }
  #skills.skills-section {
    display: block;
  }
  #skills.skills-section .skills-grid {
    margin-bottom: 0;
  }
  #message .contact-unified-layout {
    align-self: start;
    padding-block: clamp(8px, 1.2svh, 16px);
  }
  body:not(.case-body) #projects .chapter {
    min-height: var(--frame-room);
    height: auto;
  }
  .case-body #case-main > :is(.case-hero, .case-section, .case-depth, .case-honesty, .case-next) {
    min-height: var(--frame-room);
    height: auto;
  }
}

/* Portfolio external website destinations, 14 October 2026.
   Use the existing chapter theme and case button language. Keep originals. */
#projects .chapter-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: center;
  gap: clamp(9px, 1.3svh, 15px) clamp(10px, 1.3vw, 18px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
#projects .chapter-actions .chapter-open {
  min-width: 0;
  max-width: 100%;
}
#projects .chapter-actions .project-live-link {
  display: inline-flex;
  box-sizing: border-box;
  flex: 0 1 auto;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  width: fit-content;
  min-height: 52px;
  padding: 12px clamp(12px, 1.35vw, 20px);
  border: 1.5px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: var(--ui, Arial, sans-serif);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  overflow-wrap: break-word;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
#projects .chapter-actions .project-live-link:is(:hover,:focus-visible) {
  background: var(--action-bg);
  color: var(--action-ink);
  border-color: var(--action-bg);
}
#projects .chapter-actions .project-live-link:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}
#projects .chapter-actions .project-story-row {
  flex: 0 0 100%;
  min-width: 0;
}
#projects .chapter-actions .project-story-row .project-deep-link {
  max-width: 100%;
  margin: 0 0 clamp(7px, 1.3svh, 15px) 2px;
}
.case-body #case-main .case-actions {
  max-width: 100%;
  min-width: 0;
  row-gap: clamp(10px, 1.6svh, 16px);
}
.case-body #case-main .case-actions .case-cta-live {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  min-height: 51px;
  white-space: normal;
  overflow-wrap: break-word;
  text-decoration: none;
}
.case-body #case-main .case-actions .case-cta-live:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}
@media (max-width: 600px) {
  #projects .chapter-actions {
    align-items: flex-start;
    row-gap: 12px;
  }
  #projects .chapter-actions .project-live-link {
    min-height: 48px;
  }
  .case-body #case-main .case-actions .case-cta-live {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  #projects .chapter-actions .project-live-link { transition: none; }
}

/* 15 Nov 2026 — three homepage Work project links only.
   Keep the approved project buttons and footer rails, but pair each
   "Read the project story" link with the external website/demo button
   on desktop so it cannot drop into the fixed chapter-bottom label.
   Stacked mobile chapters retain their existing natural-height layout. */
@media (min-width: 801px) {
  body:not(.case-body) #projects .chapter-actions {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    justify-content: start;
    column-gap: clamp(14px, 2vw, 24px);
    row-gap: clamp(9px, 1.3svh, 15px);
  }
  body:not(.case-body) #projects .chapter-actions > .chapter-open {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: start;
  }
  body:not(.case-body) #projects .chapter-actions > .project-live-link {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }
  body:not(.case-body) #projects .chapter-actions > .project-story-row {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    width: auto;
    align-self: center;
  }
  body:not(.case-body) #projects .chapter-actions .project-story-row .project-deep-link {
    margin: 0;
    padding: 4px 0 6px;
  }
}
/* 15 Nov 2026 — compact the final Next Project transition on all three
   standalone Work case studies. The shared full-viewport minimum at the
   end of this stylesheet must not apply to a two-line navigation section.
   Keep the existing grid, theme, links and footer fully intact. */
.case-body #case-main > .case-next {
  min-height: 0;
  height: auto;
  grid-template-rows: auto auto;
  align-content: center;
  row-gap: clamp(12px, 1.8svh, 20px);
  padding-block: clamp(32px, 5svh, 58px);
}
@media (max-width: 750px) {
  .case-body #case-main > .case-next {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    row-gap: clamp(12px, 2svh, 20px);
    padding-block: clamp(28px, 4.5svh, 48px);
  }
}
