/* Tuckory first-screen layout. Page content supplies copy, art and a supporting note.
   Nothing here depends on an individual page or a specific screen height. */
.studio-edition > .shell.tk-first-screen {
  --tk-opening-gap: clamp(.7rem, 1.7svh, 1.35rem);
  --tk-opening-art-min: clamp(7rem, 20svh, 13rem);
  --tk-shell-top: 18px;
  --tk-shell-edge: 1px;
  margin-block-start: var(--tk-shell-top);
  border-block-start-width: var(--tk-shell-edge);
}
.tk-opening-slot, .tk-opening-rest, .tk-opening-chrome { min-inline-size: 0; }
.studio-edition .tk-opening-slot {
  display: grid;
  grid-template-rows: minmax(auto, 1fr) auto;
  background: var(--studio-deep);
}
@supports (grid-template-rows: subgrid) {
  .studio-edition > .shell.tk-first-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: max-content minmax(auto, 1fr) max-content max-content;
  }
  /* A sizing item spans just the chrome and opening tracks, not the page.
     Subgrid preserves the main landmark around both hero and page content. */
  .tk-first-screen::before {
    content: "";
    grid-area: 1 / 1 / 3 / 2;
    min-block-size: calc(100vh - var(--tk-shell-top) - var(--tk-shell-edge));
    min-block-size: calc(100svh - var(--tk-shell-top) - var(--tk-shell-edge));
    pointer-events: none;
  }
  .tk-first-screen > .tk-opening-chrome { grid-area: 1 / 1; }
  .studio-edition .tk-first-screen > .co-main {
    display: grid;
    grid-area: 2 / 1 / 4 / 2;
    grid-template-rows: subgrid;
    min-inline-size: 0;
  }
  .tk-first-screen > footer { grid-area: 4 / 1; }
}
.studio-edition .tk-opening-slot > .co-hero[data-studio-opening] {
  display: grid;
  grid-template-rows: minmax(auto, 1fr);
  align-items: stretch;
  min-block-size: 0;
  block-size: auto;
  padding-block: clamp(.85rem, 2.6svh, 2rem);
  padding-inline: max(var(--studio-gutter), env(safe-area-inset-left)) max(var(--studio-gutter), env(safe-area-inset-right));
}
.studio-edition .tk-opening-slot .co-hero[data-common-opening] > .studio-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(var(--tk-opening-art-min), 1fr) auto;
  grid-template-areas: "copy" "art" "note";
  align-content: stretch;
  align-items: stretch;
  gap: var(--tk-opening-gap);
  inline-size: 100%;
}
.studio-edition .tk-opening-slot .studio-hero-grid > [data-hero-copy] { min-inline-size: 0; }
.studio-edition .tk-opening-slot .co-actions { display: flex; flex-wrap: wrap; }
.studio-edition .tk-opening-slot .co-btn { white-space: normal; }
.studio-edition .tk-opening-slot .co-hero[data-studio-opening] .studio-inner-tuck {
  position: relative;
  display: grid;
  place-items: center;
  align-self: stretch;
  min-block-size: var(--tk-opening-art-min);
  inline-size: min(100%, 27rem);
  max-inline-size: 100%;
  margin: 0;
  justify-self: center;
}
.studio-edition .tk-opening-slot .co-hero[data-studio-opening] .studio-inner-tuck img {
  position: absolute;
  inset: 0;
  margin: auto;
  inline-size: auto;
  block-size: auto !important;
  max-inline-size: calc(100% - .5rem);
  max-block-size: calc(100% - .5rem);
  padding: 0;
  object-fit: contain;
}
.studio-edition .tk-opening-slot > .studio-opening-detail { margin-block: 0; }
@media (min-width: 46.3125rem) {
  .studio-edition .tk-opening-slot .co-hero[data-common-opening] > .studio-hero-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    grid-template-rows: minmax(var(--tk-opening-art-min), 1fr);
    column-gap: clamp(1.25rem, 5vw, 5rem);
  }
  .studio-edition .tk-opening-slot .co-hero[data-studio-opening] .studio-inner-tuck { justify-self: end; }
}
/* The outer gap is a design token, not an estimate of the header height. */
@media (max-width: 740px) {
  .studio-edition > .shell.tk-first-screen { --tk-shell-top: 0px; }
}
.studio-edition .tk-opening-slot [data-hero-copy] { grid-area: copy; }
.studio-edition .tk-opening-slot .studio-inner-tuck { grid-area: art; }
.studio-edition .tk-opening-slot .studio-opening-detail {
  grid-area: note;
  margin: 0;
  align-self: start;
  border: 1px solid #8d704f;
  border-radius: 12px;
  background: #23364b;
}
.studio-edition .tk-opening-slot .studio-opening-detail-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .35rem;
  padding: clamp(.65rem, 1.7svh, 1.15rem) clamp(.8rem, 2.3vw, 1.4rem);
}
.studio-edition .tk-opening-slot .studio-opening-detail-inner :is(h2, p) { margin: 0; }
@media (min-width: 46.3125rem) {
  .studio-edition .tk-opening-slot .co-hero[data-common-opening] > .studio-hero-grid {
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "copy art" "note art";
  }
  .studio-edition .tk-opening-slot .studio-opening-detail { max-inline-size: 42rem; }
}
/* Older engines keep all content and prevent a next-section peek.
   Without subgrid, the header is in normal flow above the minimum. */
@supports not (grid-template-rows: subgrid) {
  .studio-edition .tk-opening-slot {
    min-block-size: 100vh;
    min-block-size: 100svh;
  }
}
@media (max-width: 740px) {
  .studio-edition > .shell.tk-first-screen {
    --tk-opening-gap: clamp(.42rem, 1.35svh, .95rem);
    --tk-opening-art-min: clamp(6rem, 17svh, 12rem);
  }
  .studio-edition .tk-opening-slot > .co-hero[data-studio-opening] {
    padding-block: clamp(.62rem, 1.65svh, 1.5rem);
  }
  .studio-edition .tk-opening-slot [data-hero-copy] h1 {
    margin-block-end: clamp(.55rem, 1.45svh, 1.2rem);
  }
  .studio-edition .tk-opening-slot [data-hero-copy] .co-actions {
    margin-block-start: clamp(.55rem, 1.55svh, 1.2rem);
  }
  .studio-edition .tk-opening-slot .studio-opening-detail-inner {
    padding-block: clamp(.5rem, 1.1svh, 1rem);
  }
}

/* The shared desktop arrangement follows the portfolio: aligned copy,
   consistent art frame, and one supporting strip spanning both columns. */
@media (min-width: 46.3125rem) {
  .studio-edition .tk-opening-slot .co-hero[data-common-opening] > .studio-hero-grid {
    grid-template-rows: minmax(min-content, 1fr) auto;
    grid-template-areas: "copy art" "note note";
    align-items: start;
  }
  .studio-edition .tk-opening-slot .co-hero[data-studio-opening] .studio-inner-tuck {
    align-self: start;
    block-size: auto;
    aspect-ratio: 4 / 5;
    inline-size: min(100%, 25.25rem, 45svh);
  }
  .studio-edition .tk-opening-slot .studio-opening-detail {
    max-inline-size: none;
  }
  .studio-edition .tk-opening-slot .studio-opening-detail-inner {
    grid-template-columns: minmax(10ch, .65fr) minmax(0, 1.75fr);
    align-items: center;
    column-gap: clamp(1rem, 2vw, 2rem);
  }
  .studio-edition .tk-opening-slot .studio-opening-detail-inner:has(.studio-opening-next) {
    grid-template-columns: minmax(10ch, .65fr) minmax(0, 1.75fr) minmax(9ch, auto);
  }
}
.studio-edition .tk-opening-slot .studio-opening-detail-inner .studio-opening-next {
  display: flex;
  margin: 0;
  justify-content: flex-start;
}
