/* ============================================================
   work.css — the case-study pages (work/<slug>/)
   ------------------------------------------------------------
   Loads on top of styles.css, so every token, the titlebar, the
   sidebar, the footer and the status bar behave exactly like the
   homepage. Only the case-specific blocks live here.
   Written for RTL Persian: logical properties, no letter-spacing on
   Farsi text, ASCII values isolated with unicode-bidi.
   ============================================================ */

.case { padding-block: clamp(26px, 4vw, 52px) clamp(40px, 6vw, 76px); }

/* ---------------- head ---------------- */

.case-crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-2);
  margin-block-end: 22px;
}
.case-crumb a { color: var(--muted); text-decoration: none; }
.case-crumb a:hover { color: var(--accent); }
.case-crumb .sep { opacity: .5; }
.case-crumb .here { color: var(--text); }
.case-crumb .live-tag {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-dim);
}
.case-crumb .live-tag svg { width: 11px; height: 11px; }

.case-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 30px;
  align-items: end;
  padding-block-end: 22px;
  border-block-end: 1px solid var(--line);
}
.case-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  margin-block-end: 8px;
}
.case-kicker b { color: var(--accent); font-weight: 500; }
.case-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  line-height: 1.18;
  color: var(--text-strong);
  margin: 0;
}
.case-tagline {
  margin-block-start: 12px;
  max-width: 60ch;
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--muted);
}
.case-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }

/* the one-line facts a client actually reads */
.case-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin-block: 22px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.case-specs > div { background: var(--panel); padding: 12px 14px; }
.case-specs dt {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-2);
  margin-block-end: 5px;
}
.case-specs dd { margin: 0; font-size: 12.5px; color: var(--text); line-height: 1.75; }
.case-specs dd b { color: var(--text-strong); font-weight: 600; }

/* ---------------- hero shot ---------------- */

.case-figure { margin: clamp(20px, 3vw, 34px) 0 0; }
.case-figure .frame {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.case-figure img { display: block; width: 100%; height: auto; }
.case-figure figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-start: 9px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-2);
}
.case-figure figcaption svg { width: 11px; height: 11px; flex: 0 0 auto; }

/* ---------------- body sections ---------------- */

.case-sec {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 10px 26px;
  padding-block: clamp(24px, 3.4vw, 40px);
  margin-block-start: clamp(26px, 3.6vw, 44px);
  border-block-start: 1px solid var(--line);
}
.case-sec > header { position: relative; }
.case-sec .label,
.case-order .label {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
}
.case-sec .label svg,
.case-order .label svg { width: 11px; height: 11px; flex: 0 0 auto; color: var(--accent); }
.case-order .label i { color: var(--accent); font-style: normal; }
.case-sec h2 {
  margin-block-start: 6px;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-strong);
}
.case-sec .note { margin-block-start: 8px; font-size: 11.5px; line-height: 1.85; color: var(--muted); }

.case-sec p { margin: 0 0 12px; font-size: 13.5px; line-height: 2.05; color: var(--text); }
.case-sec p:last-child { margin-block-end: 0; }

/* solution cards */
.case-solutions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr)); gap: 12px; }
.case-solutions > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 14px 16px 15px;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.case-solutions > div:hover { border-color: var(--accent-line); background: var(--panel-2); }
.case-solutions h3 {
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 7px;
}
.case-solutions h3 svg { width: 13px; height: 13px; flex: 0 0 auto; color: var(--accent); }
.case-solutions p { margin: 0; font-size: 12.5px; line-height: 1.95; color: var(--muted); }

/* process timeline */
.case-flow { margin: 0; padding: 0; list-style: none; counter-reset: flow; display: grid; gap: 0; }
.case-flow li {
  counter-increment: flow;
  position: relative;
  padding-block: 10px;
  padding-inline: 0 26px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text);
  border-block-end: 1px dashed var(--line);
}
.case-flow li:last-child { border-block-end: 0; }
.case-flow li::before {
  content: counter(flow, decimal-leading-zero);
  position: absolute;
  inset-inline-end: 0;
  top: 11px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  opacity: .75;
}

/* stack list */
.case-stack { display: flex; flex-wrap: wrap; gap: 7px; }
.case-stack li {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 7px 11px;
  font-size: 11.5px;
  color: var(--text);
}
.case-stack li span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-2);
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 8px;
}
.case-stack b { font-weight: 600; }

/* results — the honest ones */
.case-results { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.case-results li {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 9px;
  font-size: 13px;
  line-height: 1.95;
  color: var(--text);
}
.case-results svg { width: 15px; height: 15px; margin-block-start: 4px; color: var(--accent); }

/* gallery */
.case-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.case-gallery figure { margin: 0; }
.case-gallery .frame {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--panel);
}
/* the phone shot is twice as tall as it is wide; without a ceiling it would
   make its own row three screens high next to a desktop crop */
.case-gallery img { display: block; width: 100%; max-width: 100%; height: auto; max-height: 460px; object-fit: contain; }
.case-gallery figcaption {
  margin-block-start: 7px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-2);
}

/* ---------------- closing CTA ---------------- */

.case-order {
  margin-block-start: clamp(26px, 4vw, 44px);
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  background:
    radial-gradient(60% 150% at 92% 0%, var(--accent-dim), transparent 62%),
    var(--panel);
  padding: clamp(22px, 3vw, 34px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(236px, 288px);
  gap: 22px 38px;
  align-items: center;
}
.case-order h2 {
  margin: 6px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-strong);
}
.case-order header > p { margin: 0; font-size: 12.5px; line-height: 1.95; color: var(--muted); max-width: 56ch; }
/* one column, one action: the primary button owns the width, everything under
   it is a quiet second step rather than a competing button */
.case-order .cta { display: grid; gap: 12px; }
.case-order .cta .btn { width: 100%; }
.case-order .cta .more {
  justify-self: center;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border-block-end: 1px dashed transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.case-order .cta .more:hover { color: var(--accent); border-block-end-color: var(--accent-line); }
.case-order .meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-block-start: 2px;
  padding-block-start: 11px;
  border-block-start: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-2);
}
.case-order .meta span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.case-order .meta svg { width: 11px; height: 11px; flex: 0 0 auto; color: var(--accent); }

/* previous / next */
.case-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 12px;
  margin-block-start: 14px;
}
.case-nav a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 13px 15px;
  text-decoration: none;
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.case-nav a:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.case-nav svg { width: 15px; height: 15px; color: var(--accent); }
.case-nav .who { display: block; font-family: var(--font-mono); font-size: 9.5px; color: var(--muted-2); }
.case-nav .name { display: block; font-size: 13px; font-weight: 600; color: var(--text-strong); }
.case-nav .back { grid-column: 1 / -1; display: flex; justify-content: center; }

/* ---------------- responsive ---------------- */

@media (max-width: 880px) {
  .case-top { grid-template-columns: 1fr; align-items: start; }
  .case-actions { justify-content: flex-start; }
  .case-sec { grid-template-columns: 1fr; gap: 14px; }
  .case-sec .note { max-width: 62ch; }
  .case-order { grid-template-columns: 1fr; }
  .case-order .cta { max-width: 340px; }
  .case-order header > p { max-width: 62ch; }
}

@media (max-width: 620px) {
  .case-specs { grid-template-columns: 1fr 1fr; }
  .case-crumb .live-tag { display: none; }
  /* every link here is a tap target, including the mono ones */
  .case-nav a { min-height: 56px; }
  .case-actions .btn { min-height: 44px; }
}

@media (max-width: 420px) {
  .case-specs { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .case-nav a, .case-solutions > div { transition: none; }
  .case-order .cta .more { transition: none; }
}
