/* Selected work (WEB-8.12, WEB-6.6, copy home.md §5): three case-study cards, image first. */

.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem 2rem; }

.work-card a { display: grid; gap: .75rem; text-decoration: none; }
.work-media { aspect-ratio: 4 / 3; border: var(--rule-strong); border-radius: var(--radius); }
img.work-media { display: block; width: 100%; height: auto; object-fit: cover; object-position: top; }   /* live site screenshots (2026-10-17) */
.work-title { font: 600 var(--text-h3)/1.15 var(--display); }
.work-result { color: var(--muted); }
.work-card a:hover .work-title { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }

/* Case study cards: Before and After, no screenshot (2026-10-17, Krishna). Used on Work and on each case study page. */
.case-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 2rem; }   /* row gap 0: the subgrid rows hold the spacing */
/* Subgrid: label, issue, what changed, brand and link line up across the cards (2026-10-17) */
.case-card { display: grid; grid-row: span 5; grid-template-rows: subgrid; }
.case-card a { display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; row-gap: .75rem; padding-top: 1.25rem; border-top: var(--rule-strong); text-decoration: none; }
.case-card-after, .case-card-brand { align-content: start; }
/* was until 2026-10-17: .case-card a { display: grid; grid-template-rows: auto 1fr auto auto auto; gap: .75rem; height: 100%; padding-top: 1.25rem; border-top: var(--rule-strong); text-decoration: none; } */
.case-card-issue { max-width: 18ch; font: 600 var(--text-fact)/1.05 var(--display); letter-spacing: var(--tracking-title); text-wrap: balance; }   /* short, bigger headline (2026-10-17) */ /* was until 2026-10-17: .case-card-issue { font: 600 var(--text-h3)/1.2 var(--display); } */
.case-card-after, .case-card-brand { display: grid; gap: .375rem; padding-top: 1rem; border-top: var(--rule); }
.case-card-after p { color: var(--muted); }
.case-card-brand { font-weight: 600; }
/* was until 2026-10-17 (Before and After rows): .case-card-rows { display: grid; gap: 1rem; margin-top: .5rem; }
.case-card-rows div { display: grid; gap: .375rem; padding-top: 1rem; border-top: var(--rule); }
.case-card-rows dd { margin: 0; color: var(--muted); } */
.case-card-number { display: block; font: 600 var(--text-fact)/1.05 var(--display); color: var(--ink); }
.case-card-link { margin-top: .5rem; font-weight: 600; }
.case-card a:hover .case-card-link, .case-card a:hover .case-card-issue { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }

/* All projects list on the Work page (WEB-10.8): one hairline row per project */
/* Since 2026-10-17 (Krishna): a short selection as bullet points; the detail opens on hover or keyboard focus, always open on touch screens */
.projects { border-top: var(--rule-strong); }
.project { padding-block: 1.25rem; border-bottom: var(--rule); }
.project-head { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; padding-left: 1.0625rem; }   /* type and year line up under the name when they wrap */ /* was until 2026-10-17: .project-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; } */
.project-name { font: 600 var(--text-h3)/1.15 var(--display); } /* was until 2026-10-17: .project-name { display: flex; align-items: baseline; gap: .75rem; font: 600 var(--text-h3)/1.15 var(--display); } */
.project-name::before { content: ""; position: absolute; left: 0; top: .55em; width: .3125rem; height: .3125rem; background: var(--spark); } /* was until 2026-10-17: .project-name::before { content: ""; flex: none; width: .3125rem; height: .3125rem; background: var(--spark); transform: translateY(-.25em); } */
.project-type { font-size: var(--text-sm); color: var(--muted); }
.project-more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--open) var(--ease), opacity var(--open) var(--ease); }
.project-more > div { display: grid; gap: .75rem; overflow: hidden; padding-left: 1.0625rem; }   /* lines up with the name, after the square */
.project-more > div > :first-child { margin-top: .75rem; }
.project-result { max-width: var(--measure); color: var(--muted); }
.project-points { max-width: var(--measure); font-size: .9375rem; color: var(--muted); }   /* 2026-10-17: a few points under each project */
/* Screenshot in the open detail, to the right of the text on wider screens (2026-10-17, Krishna) */
.project-more > div:has(.project-shot) { grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); grid-template-rows: auto auto auto 1fr; column-gap: 2.5rem; }   /* the empty last row takes the image height, so the link stays under the text (a row added for the points, 2026-10-17) */
.project-more > div:has(.project-shot) > :not(.project-shot) { grid-column: 1; }
.project-shot { grid-column: 2; grid-row: 1 / -1; align-self: start; margin-top: .75rem; }   /* framed by .shot-frame */
/* was until 2026-10-18 (Krishna: the same frame for every screenshot on the site): .project-shot { grid-column: 2; grid-row: 1 / -1; align-self: start; width: 100%; height: auto; margin-top: .75rem; border: var(--rule-strong); border-radius: var(--radius); } */
.project:hover .project-more, .project:focus-within .project-more { grid-template-rows: 1fr; opacity: 1; }
@media (hover: none) { .project-more { grid-template-rows: 1fr; opacity: 1; transition: none; } }   /* always open, no animation on touch screens */
/* was until 2026-10-17 (one table row per project):
.projects { border-top: var(--rule-strong); }
.projects li {
  display: grid; grid-template-columns: 1.4fr 1fr .5fr 2fr; gap: .25rem 2rem;
  padding-block: 1.25rem;
  border-bottom: var(--rule);
}
.project-name { font-weight: 600; }
.project-result { color: var(--muted); }
*/

@media (max-width: 55rem) {
  .case-cards { grid-template-columns: minmax(0, 1fr); row-gap: 2.5rem; }
  .case-card { display: block; }   /* one column: no subgrid needed */
  .case-card a { grid-template-rows: none; }
  .work-grid { grid-template-columns: 1fr 1fr; }
  /* was until 2026-10-17: .projects li { grid-template-columns: 1fr; } */
}
@media (max-width: 35rem) {
  .project-more > div:has(.project-shot) { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .project-shot { grid-column: 1; grid-row: auto; }
  .work-grid { grid-template-columns: 1fr; }
}
/* 2026-11-03 (Krishna: no text cut on small screens): on narrow screens every project detail is open, whatever the device,
   so no text waits behind a hover that a small window cannot give */
@media (max-width: 40rem) { .project-more { grid-template-rows: 1fr; opacity: 1; transition: none; } }

/* was until 2026-11-05 (Krishna, later the same day: revert these changes to the original design):
[ ---------- Work page, premium like Services and Home (2026-11-05, Krishna: refine this page, premium like the Services
   and Home pages) ----------
   The Services card look: white round cards on the stone, a live site screenshot on top of each case study card, one
   italic title size, plain body font labels (no mono capitals inside cards), a small lift and champagne edge on hover.
   The project list becomes a grid of the same cards, every detail always shown (no hover to open), screenshot first.
   Earlier rules above stay as history; these override them. ]
.work-page .case-cards { gap: 1.25rem; }
.work-page .case-card { display: flex; grid-row: auto; }
.work-page .case-card a {
  display: flex; flex-direction: column; gap: .875rem; flex: 1;
  padding: 0 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden;
  background: var(--surface);
  transition: translate var(--open) var(--ease-soft), border-color var(--open) var(--ease);
}
.work-page .case-card a > :not(.case-card-shot) { margin-inline: 1.5rem; }
.case-card-shot { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--line); }
.case-card-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: scale .8s var(--ease-soft); }
.work-page .case-card .label,
.work-page .project .label { font: 600 var(--text-sm)/1.4 var(--body); letter-spacing: 0; text-transform: none; }
.work-page .case-card .label-accent { margin-top: .375rem; color: var(--spark-deep); }
.work-page .case-card-issue { max-width: none; font: italic 500 clamp(1.625rem, 2.6vw, 2.125rem)/1.1 var(--display); }
.work-page .case-card-issue em { font-style: italic; color: var(--primary); }
.work-page .case-card-after,
.work-page .case-card-brand { gap: .25rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.work-page .case-card-after .label,
.work-page .case-card-brand .label { color: var(--muted); font-weight: 500; }
.work-page .case-card-link { margin-top: auto; padding-top: .25rem; }
@media (hover: hover) {
  .work-page .case-card a:hover { translate: 0 -.375rem; border-color: var(--spark); }
  .work-page .case-card a:hover .case-card-shot img { scale: 1.04; }
  .work-page .case-card a:hover .case-card-issue { text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) {
  .work-page .case-card a, .case-card-shot img { transition: none; }
}

[ Projects: a grid of cards, details always shown ]
.work-page .projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; border-top: 0; }
.work-page .project {
  display: flex; flex-direction: column; gap: .625rem;
  padding: 0 1.5rem 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden;
  background: var(--surface);
}
.work-page .project-more,
.work-page .project-more > div { display: contents; }
.work-page .project-more { opacity: 1; }
.work-page .project-shot { order: -1; margin: 0 -1.5rem .5rem; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.work-page .project:not(:has(.project-shot)) { padding-top: 1.5rem; }
.work-page .project-head { padding-left: 0; gap: .25rem .75rem; }
.work-page .project-name { font: italic 500 clamp(1.5rem, 2.4vw, 1.875rem)/1.1 var(--display); }
.work-page .project-name::before { content: none; }
.work-page .project-type { color: var(--spark-deep); font-weight: 600; }
.work-page .project-result { color: var(--ink); }
.work-page .project-points { font-size: var(--text-sm); }
.work-page .project-more p:has(.btn-link) { margin-top: auto; padding-top: .25rem; }
@media (max-width: 55rem) {
  .work-page .case-cards { grid-template-columns: minmax(0, 1fr); row-gap: 1rem; }
  .work-page .projects { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
}
@media (max-width: 35rem) {
  .work-page .case-card a > :not(.case-card-shot) { margin-inline: 1.25rem; }
  .work-page .project { padding: 0 1.25rem 1.25rem; }
  .work-page .project-shot { margin-inline: -1.25rem; }
  .work-page .project:not(:has(.project-shot)) { padding-top: 1.25rem; }
}
[ the page must not grow: project screenshots cropped to the case card shape (top of the page kept), three projects a row on wide screens ]
.work-page .project-shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
@media (min-width: 64rem) { .work-page .projects { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 35.01rem) and (max-width: 63.99rem) { .work-page .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
[ was until 2026-11-05 (Krishna, later the same day: no, revert it, phones the same as desktop):
[ Phones: the three projects with a case study above skip their screenshot (it is already shown on the case card), and the text is tighter ]
@media (max-width: 35rem) {
  .work-page .project.has-case .project-shot { display: none; }
  .work-page .project.has-case { padding-top: 1.25rem; }
  .work-page .project { gap: .5rem; }
  .work-page .project-points { font-size: .8125rem; line-height: 1.45; }
  .work-page .project-points li { padding-block: .125rem; }
  .work-page .case-card a { gap: .625rem; padding-bottom: 1.25rem; }
  .work-page .case-card-after p { font-size: .9375rem; }
  .work-page .case-card-shot { aspect-ratio: 16 / 9; }
}
]
*/

/* 2026-11-05 (Krishna: the selected projects on phones should open like the desktop view): on touch screens and narrow
   windows the details no longer stay open; they slide open like the desktop hover when the project's name is tapped
   (site.js adds .is-open, one project at a time), and close on a second tap. A small champagne plus turns into a minus.
   Without JavaScript the details stay open, as before. */
.js .project.is-tap .project-more { grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--open) var(--ease), opacity var(--open) var(--ease); }
.js .project.is-tap.is-open .project-more { grid-template-rows: 1fr; opacity: 1; }
.js .project.is-tap .project-head { cursor: pointer; padding-right: 2rem; }
.js .project.is-tap .project-head::after {
  content: "+"; position: absolute; right: 0; top: 50%; translate: 0 -50%;
  font: 500 1.5rem/1 var(--body); color: var(--spark-deep); transition: rotate var(--open) var(--ease);
}
.js .project.is-tap.is-open .project-head::after { content: "\2212"; }
.js .project.is-tap .project-head:focus-visible { outline: 2px solid var(--primary); outline-offset: .25rem; border-radius: .25rem; }
@media (prefers-reduced-motion: reduce) { .js .project.is-tap .project-more { transition: none; } }

/* was until 2026-11-05 (Krishna: revert it):
[ 2026-11-05 (Krishna: make each card look separate): on phones and tablets each case study and each selected project
   is its own white round card with a hairline edge and space between them, instead of rows divided by lines.
   Desktop keeps the original design. ]
@media (max-width: 55rem) {
  .case-cards { row-gap: 1rem; }
  .case-card a {
    padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-card);
    background: var(--surface);
  }
  .projects { display: grid; gap: .75rem; border-top: 0; }
  .project {
    padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-card);
    background: var(--surface);
  }
  .project-more > div { padding-left: 0; }
  .project-head { padding-left: 0; }
  .project-name::before { content: none; }
}
*/

/* 2026-11-05 (Krishna: group the related text a little, and highlight Read the case study on hover): in each case card
   the headline sits close under its label, and What changed and The brand sit together as one block with less space;
   on hover the link turns teal, an underline draws in under it and the arrow slides. Every screen. */
.case-card a { row-gap: .5rem; }
.case-card .label-accent { margin-bottom: -.125rem; }
.case-card-after, .case-card-brand { gap: .25rem; padding-top: .75rem; }
.case-card-brand { padding-top: .625rem; border-top: 0; }
.case-card-link {
  justify-self: start; margin-top: .75rem; padding-bottom: .125rem;
  background: linear-gradient(var(--primary), var(--primary)) 0 100% / 0 1px no-repeat;
  transition: color var(--fast) var(--ease), background-size var(--open) var(--ease-soft);
}
.case-card-link span[aria-hidden] { display: inline-block; transition: translate var(--fast) var(--ease); }
.case-card a:hover .case-card-link,
.case-card a:focus-visible .case-card-link { color: var(--primary); background-size: 100% 1px; text-decoration: none; }
.case-card a:hover .case-card-link span[aria-hidden],
.case-card a:focus-visible .case-card-link span[aria-hidden] { translate: .25rem 0; }
@media (prefers-reduced-motion: reduce) { .case-card-link, .case-card-link span[aria-hidden] { transition: none; } }
/* each card's text stays together (the shared rows across cards opened gaps); only the links line up at the foot; on hover only the link highlights */
.case-card { display: flex; grid-row: auto; }
.case-card a { display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.case-card-link { align-self: flex-start; margin-top: auto; }
.case-card-brand + .case-card-link { margin-top: auto; }
.case-card a > .case-card-brand { margin-bottom: .75rem; }
.case-card a:hover .case-card-issue { text-decoration: none; }

/* 2026-11-05 (Krishna: no hover on Read the case study; keep it in its own colour with the underline): the link is
   always teal with its underline showing; the hover draw in and arrow slide above are switched off. */
.case-card-link { color: var(--primary); background-size: 100% 1px; transition: none; }
.case-card-link span[aria-hidden] { transition: none; }
.case-card a:hover .case-card-link span[aria-hidden],
.case-card a:focus-visible .case-card-link span[aria-hidden] { translate: none; }
.case-card a:hover .case-card-link { text-decoration: none; }
