/* Shared framing for the cover, project index and case introductions. */
:root {
  --editorial-paper: #fbfaf8;
  --editorial-ink: #242635;
  --editorial-muted: #565963;
  --editorial-line: #e2e0dc;
  --editorial-accent: #354b77;
}

body:has(.home-intro) { background: var(--editorial-paper); }
.site-header:has(+ main .home-intro) {
  width: 100%;
  padding-inline: max(48px, calc((100% - 1120px) / 2));
  background: rgb(251 250 248 / 96%);
}

.site-header:has(+ main .home-intro) .brand {
  color: var(--editorial-ink);
  font-size: 20px;
}

.site-header:has(+ main .home-intro) .nav-links { gap: 8px; }
.site-header:has(+ main .home-intro) .nav-links a {
  padding-inline: 16px;
  border-radius: 24px;
  font-size: 15px;
}

.site-header .nav-links a:is(:hover, :focus-visible, [aria-current]) {
  color: var(--editorial-accent);
  background: #ecedf3;
}

.home-intro.page-shell {
  min-height: 310px;
  padding: 48px 58px;
  border-radius: 24px;
  background: linear-gradient(115deg, #eef0f7 5%, #f4f0f3 100%);
}

.home-intro-copy {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  width: min(760px, 100%);
  margin-inline: auto;
}

.home-intro-portrait {
  display: block;
  width: 112px;
  height: 112px;
  object-fit: cover;
  object-position: 50% 30%;
  border: 4px solid #fff;
  border-radius: 50%;
}

.home-intro .hero-headline {
  color: var(--editorial-accent);
  font-size: clamp(36px, 3.75vw, 53px);
  font-weight: 450;
  line-height: 1.13;
  letter-spacing: -.045em;
}

.home-intro .hero-headline strong {
  display: block;
  color: var(--editorial-ink);
  font-weight: 600;
}

.selected-projects { padding-top: 54px; }
.selected-projects .project-group-title { margin-bottom: 18px; }
.selected-projects .project-group-title::after { content: none; }

.home-company-heading { margin: 0 0 24px; }
.home-company-heading h3 {
  margin: 0 0 7px;
  font: 400 40px/1.13 Georgia, serif;
  letter-spacing: -.055em;
}
.home-company-heading p { color: var(--editorial-muted); }

:is(.home-case-card, .lt-case-entry, .lt-related-card) {
  --case-card-surface: #ece6e9;
}
:is([href="lalatulle-navigation.html"], [data-project-href="lalatulle-navigation.html"]) { --case-card-surface: #eeedf3; }
:is([href="lalatulle-first-view.html"], [data-project-href="lalatulle-first-view.html"]) { --case-card-surface: #ebe7f3; }
:is([href="lalatulle-experiment.html"], [data-project-href="lalatulle-experiment.html"]) { --case-card-surface: #f1eae2; }

:is(.lt-case-entry, .lt-related-card):is(:hover, :focus-visible) strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lt-case-art {
  display: block;
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 2.25;
  border-radius: 8px;
}

.lt-case-art img {
  position: absolute;
  top: 0;
  left: 50%;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: top;
  transform: translateX(-50%);
}
:is([href="lalatulle-halloween.html"], [data-project-href="lalatulle-halloween.html"]) .lt-case-art img { width: 58%; object-position: 50% 21%; }
:is([href="lalatulle-navigation.html"], [data-project-href="lalatulle-navigation.html"]) .lt-case-art img { width: 93%; object-fit: contain; object-position: center; }
:is(.lt-case-ab-preview, .lt-case-first-view-preview) { position: relative; }

/* Crop case previews to the part of the screenshot the case focuses on. */
:is(.lt-case-ab-after, .lt-case-first-view-crop) {
  position: absolute;
  top: 50%;
  left: 50%;
  overflow: hidden;
  transform: translate(-50%, -50%);
}

.lt-case-ab-after { height: 94%; aspect-ratio: 786 / 1272; }
.lt-case-first-view-crop { height: 100%; aspect-ratio: 1440 / 1510; }

:is(.lt-case-art, .lt-case-ab-preview) .lt-case-ab-after img {
  position: absolute;
  inset: 0 auto auto -100%;
  width: 200%;
  max-width: none;
  height: 100%;
  object-fit: fill;
  transform: none;
}

:is(.lt-case-art, .lt-case-first-view-preview) .lt-case-first-view-crop img {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: auto;
  transform: none;
}

.intro-profile-name { display: grid; gap: 4px; line-height: 1.5; }
.intro-profile-name strong { font-size: 26px; line-height: 1.2; }
.intro-profile-name span { color: var(--editorial-muted); }
.intro-profile-name :is(a, .intro-location) { color: var(--editorial-muted); font-size: 13px; }
.intro-profile-name a { margin-top: 4px; text-underline-offset: 3px; }
.intro-profile-name a:hover { text-decoration: underline; }

/* Each case opens with a centered introduction, then its product evidence. */
.project-lalatulle .ln-cover,
.project-mongram .mg-hero,
body.project-snapside .sp-cover-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 38px;
  justify-items: center;
}

.project-lalatulle .ln-cover > div:first-child,
.project-mongram .mg-hero-copy,
body.project-snapside .sp-cover-copy {
  max-width: 740px;
  text-align: center;
}

:is(.project-lalatulle, .project-mongram, .project-snapside) :is(.ln-cover, .mg-hero, .sp-cover) .project-edition,
.project-mongram .mg-hero-copy .mg-brand,
body.project-snapside .sp-cover .sp-cover-brand {
  justify-content: center;
}

.project-lalatulle .ln-cover .ln-lead,
.project-mongram .mg-hero-copy .hero-lead,
body.project-snapside .sp-cover .cc-premise { margin-inline: auto; }

.project-lalatulle .ln-cover-image,
.project-mongram .mg-hero .mg-hero-screens,
body.project-snapside.compact-case .sp-cover .sp-gallery {
  width: min(100%, 900px);
  margin: 0;
  border-radius: 18px;
}

.project-lalatulle .ln-cover-image { gap: 24px; background: #f0edeb; }
.project-lalatulle .ln-cover-image .ln-image-link { width: min(40%, 204px); }
.project-mongram .mg-hero .mg-hero-screens { background: #eaf0e5; }
body.project-snapside.compact-case .sp-cover .sp-gallery { width: min(100%, 800px); }

.project-lalatulle .lt-case-index-title { text-align: center; }

.project-mongram #problem .n-wrap > :is(h2, .n-intro),
body.project-snapside #sp-plan .sp-section-head {
  max-width: 680px;
  margin-inline: auto;
}
.project-mongram #problem .n-wrap > h2,
body.project-snapside #sp-plan .sp-section-head h2 { text-align: center; }

@media (max-width: 740px) {
  .home-intro.page-shell { padding-inline: 26px; }
  .home-intro-copy { grid-template-columns: 1fr; gap: 16px; }
  .home-intro-portrait { width: 74px; height: 74px; }
}

.lt-related-cases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 4vw, 48px);
  width: min(100%, 720px);
  margin: 76px auto 56px;
}

.lt-related-card {
  display: grid;
  grid-template-rows: 30px auto 1fr;
  padding: 6px;
  border-radius: 10px;
  background: var(--case-card-surface);
  color: var(--editorial-ink);
}

.project-snapside .lt-related-card { color: var(--cc-ink); }

.lt-related-card[rel="prev"] { grid-column: 1; }
.lt-related-card[rel="next"] { grid-column: 2; text-align: right; }

.lt-related-card > .lt-case-art { grid-row: 2; }

.lt-related-card-mongram { --case-card-surface: #e4ebe2; }
.lt-related-card-mongram .lt-case-art img { width: 58%; object-position: center 36%; }

.lt-related-card-label {
  grid-row: 3;
  padding: 10px 7px 7px;
  font-size: 14px;
  line-height: 1.5;
}
.lt-related-card-direction {
  grid-row: 1;
  align-self: center;
  padding-inline: 7px;
  font-size: 13px;
  font-weight: 600;
}

.lt-related-card-label strong { font-weight: 600; }
.lt-related-card[href="index.html#lalatulle"] { --case-card-surface: #f1eae2; }
.lt-related-card[href="index.html#lalatulle"] .lt-case-art img { width: 64%; object-position: center 36%; }
.lt-related-card[href="snapside.html"] { --case-card-surface: #e8ece5; }
.lt-related-card[href="wivlo.html"] { --case-card-surface: #e7edf7; }

:is([data-theme="dark"], .project-snapside) .lt-related-card-mongram { --case-card-surface: #273129; }
:is([data-theme="dark"], .project-snapside) .lt-related-card[href="wivlo.html"] { --case-card-surface: #272e42; }
[data-theme="dark"] .lt-related-card[href="snapside.html"] { --case-card-surface: #252e28; }
[data-theme="dark"] .lt-related-card[href="index.html#lalatulle"] { --case-card-surface: #352c25; }

@media print {
  .lt-related-cases { display: none; }
}
