/* ============================================================================
   SHIELD Studio front door — `/` signed out and `/login` (TODO-stacey note 72;
   re-theme plan Phase 2). Loaded only by templates/_studio_shell.html, after
   style.css, so the shared tokens, form controls and flashes all still apply.

   Values are ported from the design package's shield-studio.css
   (shield-labs design.zip → shield_studio_hybrid_package.zip). The layout is
   NOT: the reference is a fixed 1536x1024 stage scaled to the viewport; this
   is a grid that matches it at >=1280px and reflows (decision D2):

     >= 1280px  three columns, as the render
     900–1279   two columns
     <  900     one column; the hero art is dropped for a plain gradient

   Same rule as style.css: colour literals live only in custom properties.
   The landing keeps its own teal (#12ddd0) inside this page, as the plan
   allows ("the landing keeps its own values inside the hero block"). The one
   deliberate deviation: the reference footer grey #4e6f7b is ~3.7:1 on the
   canvas, so it is lifted to #6f8c97 (~5.6:1).
   ------------------------------------------------------------------------ */

.studio-body {
  --sl-teal:        #12ddd0;
  --sl-paper:       #f4f2ef;
  --sl-ink-2:       #d4d1ce;
  --sl-ink-3:       #c5c2bf;
  --sl-line:        #30363c;
  --sl-line-2:      #39434b;
  --sl-line-hi:     #4e616b;
  --sl-footer:      #6f8c97;
  --sl-node-fill:   #05090d;
  --sl-card:        linear-gradient(180deg, rgba(5, 13, 20, 0.78), rgba(2, 8, 13, 0.92));
  --sl-card-hover:  linear-gradient(180deg, rgba(7, 18, 25, 0.9), rgba(3, 10, 15, 0.96));
  --sl-canvas:
    radial-gradient(900px 720px at 30% 30%, rgba(0, 85, 103, 0.10), transparent 56%),
    radial-gradient(560px 420px at 80% 10%, rgba(0, 89, 105, 0.05), transparent 64%),
    linear-gradient(135deg, #02060b 0%, #02070c 54%, #01060b 100%);
  --sl-cta:         linear-gradient(135deg, #12d4c9 0%, #0fcfc5 55%, #0bc3bb 100%);
  --sl-cta-solid:   #0fcfc5;  /* under the gradient; also what contrast is measured against */
  --sl-cta-ink:     #001113;
  --sl-cta-rim:     rgba(18, 221, 208, 0.76);
  --sl-cta-glow:    0 0 18px rgba(0, 215, 206, 0.10);
  --sl-cta-inset:   inset 0 0 0 1px rgba(255, 255, 255, 0.09), 0 0 14px rgba(18, 221, 208, 0.16);
  --sl-cta-edge:    rgba(0, 0, 0, 0.75);
  --sl-mark-glow:   drop-shadow(0 0 10px rgba(18, 221, 208, 0.24));
  --sl-hero-mask:   radial-gradient(ellipse 72% 70% at 50% 50%, #000 62%, transparent 100%);

  background: var(--sl-canvas);
  background-attachment: fixed;
  min-height: 100vh;
}

.studio-main {
  max-width: none;
  padding: 0;
}

/* --- Icon colours (templates/_studio_icons.html) ----------------------- */
.studio .si-ink       { fill: var(--sl-paper); }
.studio .si-teal      { fill: var(--sl-teal); }
.studio .si-ink-line  { stroke: var(--sl-paper); }
.studio .si-line      { stroke: var(--sl-ink-2); }
.studio .si-teal-line { stroke: var(--sl-teal); }
.studio .si-node      { fill: var(--sl-node-fill); stroke: var(--sl-paper); }

/* --- The grid ---------------------------------------------------------- */
.studio {
  --studio-gap: 40px;
  display: grid;
  max-width: 1536px;
  margin: 0 auto;
  padding: 48px 42px 40px;
  column-gap: var(--studio-gap);
  row-gap: 24px;
  color: var(--sl-paper);
  /* One column by default (phones); wider layouts below. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "brand"
    "action"
    "status"
    "icons"
    "aside"
    "legend"
    "footer";
}
.studio--signin {
  grid-template-areas:
    "brand"
    "aside"
    "icons"
    "legend"
    "footer";
}

.studio-brand  { grid-area: brand; }
.studio-hero   { grid-area: hero; display: none; }
.studio-icons  { grid-area: icons; }
.studio-aside  { grid-area: aside; }
.studio-legend { grid-area: legend; }
.studio-status { grid-area: status; }
.studio-action { grid-area: action; }
.studio-footer { grid-area: footer; }
/* /login has no status row (D5) and its action is the form in the aside. */
.studio--signin .studio-status,
.studio--signin .studio-action { display: none; }

@media (min-width: 900px) {
  .studio {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "brand  action"
      "hero   icons"
      "status status"
      "aside  aside"
      "legend legend"
      "footer footer";
  }
  /* At two columns the overview is a full-width band, so its two halves
     sit side by side instead of stacking into a tall, half-empty strip. */
  .studio--home .studio-aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--studio-gap);
  }
  .studio--home .studio-overview__intro { border-bottom: 0; }
  .studio--signin {
    grid-template-areas:
      "brand  aside"
      "hero   aside"
      "icons  icons"
      "legend legend"
      "footer footer";
  }
  .studio-hero { display: block; }
}

@media (min-width: 1280px) {
  .studio {
    grid-template-columns: minmax(0, 600px) minmax(260px, 300px) minmax(360px, 472px);
    justify-content: space-between;
    grid-template-areas:
      "brand  icons  aside"
      "hero   icons  aside"
      "legend legend aside"
      "status status action"
      "footer footer footer";
  }
  .studio--signin {
    grid-template-areas:
      "brand  icons  aside"
      "hero   icons  aside"
      "legend legend aside"
      "footer footer footer";
  }
  .studio--home .studio-aside { display: block; }
  .studio--home .studio-overview__intro { border-bottom: 1px solid var(--sl-line); }
  .studio-icons { padding-top: 98px; }
  /* The render's two rules: a vertical one left of the right column, a
     horizontal one closing off the hero/iconography block. */
  .studio-aside {
    border-left: 1px solid var(--sl-line);
    padding-left: var(--studio-gap);
    margin-left: calc(-1 * var(--studio-gap) / 2);
  }
  .studio-legend {
    border-top: 1px solid var(--sl-line);
    padding-top: 20px;
  }
}

/* --- Brand block ------------------------------------------------------- */
.studio-brand__line {
  margin: 0;
  font-size: clamp(2.5rem, 4.2vw, 3.56rem);
  line-height: 1;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--sl-paper);
}
.studio-brand__line span {
  color: var(--sl-teal);
  font-weight: 520;
}
.studio-eyebrow {
  margin: 0;
  color: var(--sl-teal);
  text-transform: uppercase;
  font-size: 1.125rem;
  font-weight: 450;
  letter-spacing: 0.035em;
}
.studio-brand .studio-eyebrow { margin-top: 15px; }
.studio-brand__copy {
  max-width: 500px;
  margin: 14px 0 0;
  color: var(--sl-ink-2);
  font-size: 1.125rem;
  line-height: 1.63;
}

/* --- Hero -------------------------------------------------------------- */
/* Stand-in (TODO-stacey note 49): the art has its near-black background
   baked in, so `screen` drops it onto the canvas, and a radial mask feathers
   the rectangle's edges away. Its top 22px (a sliver of the render's copy,
   baked into the crop) are trimmed off the file itself. */
.studio-hero {
  margin: 0;
  max-width: 600px;
}
.studio-hero img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: screen;
  -webkit-mask-image: var(--sl-hero-mask);
  mask-image: var(--sl-hero-mask);
  user-select: none;
}

/* --- Iconography column ------------------------------------------------ */
.studio-icons .studio-eyebrow { margin-bottom: 26px; font-size: 1.1875rem; }
.studio-icons__list { list-style: none; margin: 0; padding: 0; }
.studio-icons__item {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  min-height: 89px;
}
.studio-icons__glyph svg { width: 68px; height: 68px; display: block; overflow: visible; }
.studio-icons__text strong {
  display: block;
  color: var(--sl-paper);
  font-size: 1.25rem;
  font-weight: 420;
  line-height: 1.15;
}
.studio-icons__text span {
  display: block;
  margin-top: 6px;
  color: var(--sl-ink-3);
  font-size: 1rem;
}

/* --- Right column: overview (on `/`) ----------------------------------- */
.studio-overview__intro {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--sl-line);
  color: var(--sl-ink-2);
  font-size: 1.125rem;
  line-height: 1.84;
}
.studio-overview__intro p { margin: 0; }
.studio-overview__intro b { color: var(--sl-teal); font-weight: 560; }
.studio-mark {
  display: block;
  width: 64px;
  height: 72px;
  margin-bottom: 17px;
  filter: var(--sl-mark-glow);
}
.studio-overview__does { padding-top: 18px; }
.studio-overview__does .studio-eyebrow { margin-bottom: 12px; }
.studio-checklist { list-style: none; margin: 0; padding: 0; }
.studio-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 11px 0;
  color: var(--sl-ink-2);
  font-size: 0.97rem;
  line-height: 1.44;
}
.studio-checklist__tick {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border: 1.6px solid var(--sl-teal);
  border-radius: 50%;
  color: var(--sl-teal);
  font-size: 0.75rem;
  font-weight: 700;
}

/* --- Right column: sign-in card (on /login) ---------------------------- */
.studio-signin {
  max-width: 440px;
  width: 100%;
}
.studio-signin .auth-brand__name { color: var(--sl-paper); font-size: 1.5rem; }

/* --- Pattern line ------------------------------------------------------ */
.studio-legend {
  margin: 0;
  color: var(--sl-ink-3);
  font-size: 1.0625rem;
  line-height: 1.4;
}
.studio-accent { color: var(--sl-teal); }
.studio-legend i { padding: 0 13px; font-style: normal; }

/* --- Status cards (`/` only) ------------------------------------------- */
.studio-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 700px) {
  /* Two or three equal cards: card 3 is omitted when nothing is public. */
  .studio-status {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }
}
.studio-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  min-height: 140px;
  padding: 24px 18px;
  border: 1px solid var(--sl-line-2);
  border-radius: 17px;
  background: var(--sl-card);
  color: var(--sl-paper);
  text-decoration: none;
}
.studio-card__icon { flex: 0 0 44px; width: 44px; height: 44px; margin-top: 4px; }
.studio-card__icon svg { width: 100%; height: 100%; display: block; }
.studio-card__copy { display: flex; flex-direction: column; min-width: 0; }
.studio-card__label {
  color: var(--sl-teal);
  text-transform: uppercase;
  font-size: 0.875rem;
  line-height: 1.25;
}
.studio-card__value {
  margin-top: 9px;
  font-size: 1.5rem;
  line-height: 1.1;
  font-weight: 390;
}
/* A real title such as "Shield Labs — Operational Knowledge Systems"
   overflows the render's nowrap card, so it clamps to two lines instead. */
.studio-card__value--clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 1.25rem;
}
.studio-card__sub { margin-top: 9px; color: var(--sl-ink-3); font-size: 0.9375rem; }

.studio-card--link { transition: border-color 0.16s ease, background 0.16s ease; }
.studio-card--link:hover { border-color: var(--sl-line-hi); background: var(--sl-card-hover); }
.studio-card--link:hover .studio-card__value { text-decoration: underline; }

/* Card 2: a placeholder that reads as "not yet", not "broken" — no hover,
   no pointer, a dashed rule, muted value. Text stays at full-contrast ink-3
   (it is not a disabled control, so it gets no contrast exemption). */
.studio-card--inactive { border-style: dashed; cursor: default; }
.studio-card--inactive .studio-card__label,
.studio-card--inactive .studio-card__value { color: var(--sl-ink-3); }
.studio-card--inactive .studio-card__icon { filter: grayscale(1); }

/* --- Primary action ---------------------------------------------------- */
.studio-action {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
}
.studio-primary {
  position: relative;
  display: block;
  max-width: 354px;
  padding: 27px 72px 27px 31px;
  border: 1px solid var(--sl-cta-edge);
  border-radius: 17px;
  outline: 1px solid var(--sl-cta-rim);
  outline-offset: 8px;
  margin: 9px;
  background: var(--sl-cta);
  background-color: var(--sl-cta-solid);
  box-shadow: var(--sl-cta-inset), var(--sl-cta-glow);
  color: var(--sl-cta-ink);
  text-decoration: none;
}
.studio-primary:hover { color: var(--sl-cta-ink); filter: brightness(1.05); }
.studio-primary:focus-visible { outline: 2px solid var(--sl-paper); outline-offset: 8px; }
.studio-primary__title {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.studio-primary__sub { display: block; margin-top: 7px; font-size: 1rem; font-weight: 450; }
.studio-primary__arrow {
  position: absolute;
  right: 31px;
  top: 26px;
  font-size: 2.375rem;
  line-height: 1;
  font-weight: 300;
}
.studio-secondary:empty { display: none; }

/* --- Footer strip ------------------------------------------------------ */
.studio-footer {
  justify-self: center;
  padding-top: 16px;
  color: var(--sl-footer);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  letter-spacing: 0.12em;
  text-align: center;
}

/* --- Below the fold (`/`): the public list ----------------------------- */
.studio-below {
  border-top: 1px solid var(--sl-line);
  padding: 40px 42px 56px;
}
.studio-below .landing { max-width: 1200px; }
.studio-below .studio-eyebrow { margin-bottom: 8px; }

@media (max-width: 899px) {
  .studio { padding: 32px 16px 32px; }
  .studio-below { padding: 32px 16px 48px; }
  .studio-primary { max-width: none; }
}
