/* lysechko.com case studies: hub (/prosjekter/, /en/work/) and one page per project.
   Loaded after site.css and blog.css. Same tokens and shape rules: pills for chips and buttons,
   cards 20px, media 12px, one accent (cobalt). Class prefix cs- so nothing collides with older pages. */

/* ---------- Hub ---------- */
.cs-hub-hero { max-width: 940px; }
.cs-hub-hero h1 { max-width: 20ch; }
.cs-stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; }
.cs-stats div { display: flex; flex-direction: column; gap: 2px; }
.cs-stats dt { order: 2; font-size: .875rem; color: var(--muted); }
.cs-stats dd { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }

.cs-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: clamp(28px, 4vw, 44px) 0 24px; }
.cs-filters button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface);
  font: inherit; font-size: .9375rem; font-weight: 500; color: var(--ink); cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.cs-filters button:hover { border-color: var(--accent); color: var(--accent); }
.cs-filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.cs-filters .count { font-size: .8125rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.cs-filters button[aria-pressed="true"] .count { color: var(--on-dark-muted); }

.cs-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); grid-auto-flow: dense; }
.cs-grid > [hidden] { display: none !important; }
@media (min-width: 1000px) {
  .cs-card.is-wide { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .cs-card.is-wide .cs-card-media { padding: 22px 0 22px 22px; display: flex; align-items: center; background: linear-gradient(135deg, var(--bg-alt), var(--surface)); }
  .cs-card.is-wide .cs-card-media > .browser { width: 100%; }
  .cs-card.is-wide .cs-card-media .phone { right: -12px; bottom: 10px; width: 20%; }
  .cs-card.is-wide .cs-card-body { justify-content: center; padding: 28px 30px; gap: 12px; }
  .cs-card.is-wide h2, .cs-card.is-wide h3 { font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem); line-height: 1.12; letter-spacing: -.03em; }
  .cs-card.is-wide .cs-card-text { font-size: 1rem; }
  .cs-card.is-wide .cs-card-metric { margin-top: 6px; }
  .cs-card.is-wide .cs-card-more { margin-top: 4px; }
}

.cs-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  transition: border-color .2s ease, transform .3s var(--ease), box-shadow .3s ease;
}
.cs-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.cs-card:has(h2 a:focus-visible), .cs-card:has(h3 a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.cs-card-media { position: relative; padding: 16px 16px 0; background: linear-gradient(180deg, var(--bg-alt), var(--surface)); }
.cs-card-media .browser { box-shadow: 0 1px 2px rgba(16, 24, 48, .06), 0 14px 30px -18px rgba(16, 24, 48, .45); }
.cs-card-media .browser-bar { height: 26px; }
.cs-card-media .browser-bar span { font-size: .6875rem; padding: 2px 10px; }
.cs-card-media .browser img { transition: transform .8s var(--ease); }
.cs-card:hover .cs-card-media .browser img { transform: scale(1.025); }
.cs-card-media .phone { left: auto; right: 10px; bottom: -6px; width: clamp(64px, 18%, 96px); padding: 4px; border-radius: 18px; }
.cs-card-media .phone img { border-radius: 14px; }
.cs-card-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 20px 20px 22px; }
.cs-kicker { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.cs-kicker span + span::before { content: "·"; margin-right: 10px; color: var(--btn-line); }
.cs-card h2, .cs-card h3 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -.02em; }
.cs-card h2 a, .cs-card h3 a { color: var(--ink); text-decoration: none; }
.cs-card h2 a::after, .cs-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.cs-card h2 a:focus-visible, .cs-card h3 a:focus-visible { outline: none; }
.cs-card-text { font-size: .9375rem; line-height: 1.55; color: var(--muted); }
.cs-card-metric { display: flex; align-items: baseline; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.cs-card-metric b { font-size: 1.625rem; letter-spacing: -.03em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-card-metric span { font-size: .875rem; line-height: 1.35; color: var(--muted); }
.cs-card-more { margin-top: auto; font-size: .9375rem; font-weight: 600; color: var(--accent); }
.cs-card-metric + .cs-card-more { margin-top: 2px; }
.cs-card-more .arrow { display: inline-block; transition: transform .3s var(--ease); }
.cs-card:hover .cs-card-more .arrow { transform: translateX(3px); }
.cs-badge {
  position: absolute; top: 26px; left: 26px; z-index: 2;
  padding: 4px 10px; border-radius: var(--radius-pill); background: rgba(14, 17, 22, .78); color: #fff;
  font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

.cs-group { margin-top: clamp(48px, 6vw, 72px); }
.cs-group > h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -.03em; }
.cs-group > p { margin: 10px 0 22px; color: var(--muted); max-width: 64ch; }

/* ---------- Case page ---------- */
.cs-hero { display: grid; gap: clamp(24px, 4vw, 56px); padding-block: clamp(24px, 4vw, 44px) clamp(24px, 3vw, 36px); }
@media (min-width: 1000px) { .cs-hero { grid-template-columns: minmax(0, 1fr) 340px; align-items: end; } }
.cs-hero h1 { margin-top: 16px; font-size: clamp(2.125rem, 1.35rem + 3vw, 3.5rem); letter-spacing: -.04em; max-width: 22ch; }
.cs-hero .lead { margin-top: 20px; font-size: clamp(1.125rem, 1.05rem + .35vw, 1.3125rem); line-height: 1.55; color: var(--ink-2); max-width: 60ch; }
.cs-hero .cta-row { margin-top: 26px; }
.cs-meta { display: grid; gap: 0; padding: 6px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
.cs-meta div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cs-meta div:last-child { border-bottom: 0; }
.cs-meta dt { font-size: .8125rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); padding-top: 2px; }
.cs-meta dd { font-size: .9375rem; line-height: 1.45; color: var(--ink); }
.cs-meta dd a { color: var(--accent); text-underline-offset: 3px; }

.cs-stage {
  position: relative; overflow: hidden; border-radius: calc(var(--radius-card) + 8px);
  padding: clamp(22px, 5vw, 64px) clamp(16px, 6vw, 96px) clamp(30px, 5vw, 64px);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(39, 71, 232, .14), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgba(39, 71, 232, .10), transparent 60%),
    var(--bg-alt);
}
.cs-stage.is-dark { background: radial-gradient(120% 90% at 0% 0%, rgba(77, 107, 255, .28), transparent 55%), var(--dark); }
.cs-stage .cs-device { position: relative; max-width: 1040px; margin-inline: auto; padding-right: clamp(26px, 6vw, 84px); }
.cs-stage .cs-device.is-solo { padding-right: 0; }
.cs-stage .browser img { aspect-ratio: 16 / 10; }
.cs-stage .phone { left: auto; right: 0; bottom: calc(-1 * clamp(10px, 2vw, 24px)); width: clamp(96px, 17vw, 210px); padding: 7px; border-radius: 32px; }
.cs-stage .phone img { border-radius: 25px; }
.cs-stage .cs-plain { max-width: 1040px; margin-inline: auto; }
.cs-stage .cs-plain img { width: 100%; border-radius: var(--radius-media); box-shadow: var(--shadow-float); }
.cs-stage figcaption { margin-top: clamp(20px, 3vw, 34px); text-align: center; font-size: .8125rem; color: var(--muted); }
.cs-stage.is-dark figcaption { color: var(--on-dark-muted); }
.cs-stage .cs-phones { display: flex; justify-content: center; gap: clamp(12px, 3vw, 40px); }
.cs-stage .cs-phones .phone { position: relative; right: auto; bottom: auto; width: clamp(140px, 24vw, 280px); }

.cs-summary { display: grid; gap: 16px; margin-top: clamp(28px, 4vw, 44px); }
@media (min-width: 1000px) { .cs-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; } }
.cs-summary .answer-box { margin-top: 0; max-width: none; display: flex; flex-direction: column; justify-content: center; }
.cs-summary .answer-box p { font-size: 1.0625rem; line-height: 1.6; color: var(--ink-2); }
.cs-metrics { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-metrics:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-metrics:has(> :only-child) { grid-template-columns: 1fr; }
@media (max-width: 520px) { .cs-metrics:has(> :nth-child(3):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cs-metric { display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.cs-metric b { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem); font-weight: 700; letter-spacing: -.035em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.cs-metric span { font-size: .9063rem; line-height: 1.4; color: var(--ink-2); }
.cs-metric small { margin-top: auto; font-size: .75rem; color: var(--muted); }
.cs-metric.is-dark { background: var(--dark); border-color: transparent; }
.cs-metric.is-dark b { color: var(--on-dark); }
.cs-metric.is-dark span { color: var(--on-dark-muted); }

.cs-body { margin-top: clamp(40px, 5vw, 64px); }
.cs-body .prose h2:first-child { margin-top: 0; }
.cs-steps { counter-reset: cs; list-style: none !important; padding-left: 0 !important; display: grid; gap: 12px; }
.cs-steps li { position: relative; padding: 14px 16px 14px 56px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin: 0 !important; }
.cs-steps li::before {
  counter-increment: cs; content: counter(cs);
  position: absolute; left: 14px; top: 13px; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .8125rem; font-weight: 700;
}
.cs-steps li b { color: var(--ink); }
.cs-stack { display: flex; flex-wrap: wrap; gap: 8px; list-style: none !important; padding-left: 0 !important; }
.cs-stack li { margin: 0 !important; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line); font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.cs-note { margin-top: 1.4em; padding: 14px 16px; border-radius: 14px; background: var(--bg-alt); font-size: .9063rem; color: var(--ink-2); }

.cs-gallery { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.cs-gallery figure { margin: 0; }
.cs-gallery .browser { box-shadow: var(--shadow-card); }
.cs-gallery .browser img { aspect-ratio: auto; }
.cs-gallery .cs-shot img { width: 100%; border-radius: var(--radius-media); border: 1px solid var(--line); background: var(--surface); }
.cs-gallery .cs-mobile { display: flex; justify-content: center; padding: 18px; border-radius: var(--radius-card); background: var(--bg-alt); }
.cs-gallery .cs-mobile .phone { position: relative; left: auto; bottom: auto; width: min(240px, 70%); }
.cs-gallery figcaption { margin-top: 10px; font-size: .875rem; color: var(--muted); line-height: 1.5; }

.cs-aside .aside-card .price-line { margin-top: 12px; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; color: var(--on-dark); }
.cs-aside .aside-card .price-line small { display: block; font-size: .8125rem; font-weight: 500; letter-spacing: 0; color: var(--on-dark-muted); }

.cs-next { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

@media (max-width: 639px) {
  .cs-meta div { grid-template-columns: 96px 1fr; }
  .cs-stage { border-radius: var(--radius-card); }
}
.cs-hero .byline { margin-top: 18px; font-size: .875rem; color: var(--muted); }
.cs-service { margin-top: 28px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-weight: 500; }
/* a wide table must scroll inside .table-wrap instead of widening the grid column on phones */
.page-grid > * { min-width: 0; }
