/**
 * deep-work.css
 * Premium enterprise portfolio — the Work index page (/work.html).
 *
 * Scoped entirely under `.work-page`. Reuses the global design tokens
 * (--accent, --text-*, --border, --sec-px, --container-max, --sN spacing)
 * and type system (Bricolage Grotesque / DM Sans / JetBrains Mono) so it
 * matches the rest of the site. Screenshots are the primary visual; spacing
 * and hierarchy do the work, not decoration.
 */

.work-page {
  background: #ffffff;
}

.work-main {
  padding-top: clamp(20px, 4vw, 48px);
  padding-bottom: 0;
}

/* Scroll reveal (self-contained; deep-interactions.css isn't loaded here) */
.work-page .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: opacity, transform;
}
.work-page .reveal.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .work-page .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Shared section rhythm — generous, spacious, enterprise. */
.work-main > section {
  padding-block: clamp(3.5rem, 7vw, 6.5rem);
}
.work-page .work-hero {
  padding-block: 0 clamp(2.5rem, 5vw, 4rem);
}
.work-section-head {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* ── 01 — Hero ─────────────────────────────────────────── */
.work-hero {
  max-width: var(--container-max, 1480px);
  margin-inline: auto;
}
.work-hero-eyebrow {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--s5);
}
.work-hero-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  color: var(--text-0);
  margin: 0 0 var(--s6);
  max-width: 18ch;
}
.work-hero-lead {
  font-size: clamp(1.08rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--text-1);
  font-weight: 300;
  margin: 0;
  max-width: 60ch;
}

/* ── 02 — Featured case study (dominant) ───────────────── */
.work-featured {
  border-top: 1px solid var(--border);
}
.work-featured-inner {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}
.work-featured-media {
  display: block;
  text-decoration: none;
  position: relative;
}

/* Flagship / commercial-product badge (Portfolio Enhancement — Phase 1) */
.work-flagship-badge {
  position: absolute;
  top: clamp(12px, 1.6vw, 18px);
  left: clamp(12px, 1.6vw, 18px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent, #e84612);
  padding: 7px 12px;
  border-radius: 999px;
  box-shadow: 0 6px 18px -6px rgba(232, 70, 18, 0.55);
}

.work-featured-product {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: calc(-1 * var(--s3)) 0 var(--s5);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--text-2);
}
.work-featured-product-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
  flex-shrink: 0;
}
.work-featured-frame {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  padding: clamp(16px, 2.4vw, 34px);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04),
    0 40px 80px -32px rgba(15, 23, 42, 0.28);
  transition: transform 360ms cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 360ms ease;
}
.work-featured-media:hover .work-featured-frame {
  transform: translateY(-4px);
  border-color: rgba(24, 24, 27, 0.18);
}
.work-featured-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  box-shadow: 0 18px 44px -20px rgba(15, 23, 42, 0.22),
    0 6px 16px -10px rgba(15, 23, 42, 0.1);
}
.work-featured-cat {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s4);
}
.work-featured-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text-0);
  margin: 0 0 var(--s5);
}
.work-featured-summary {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.65;
  color: var(--text-1);
  font-weight: 300;
  margin: 0 0 var(--s6);
  max-width: 46ch;
}
.work-featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s6);
  margin: 0 0 var(--s7);
  padding: var(--s5) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.work-featured-meta dt {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--s2);
}
.work-featured-meta dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-1);
}
.work-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.work-stack li {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.work-featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  font-weight: 500;
  color: var(--text-0);
  text-decoration: none;
}
.work-featured-cta svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms ease;
}
.work-featured-cta:hover {
  color: var(--accent);
}
.work-featured-cta:hover svg {
  transform: translateX(4px);
}

/* ── 03 — More case studies ────────────────────────────── */
.work-more {
  border-top: 1px solid var(--border);
}
.work-more-title,
.work-cap-heading,
.work-outcomes-heading {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--text-0);
  margin: var(--s3) 0 0;
  max-width: 22ch;
}
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
.work-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 320ms ease, box-shadow 320ms ease;
}
.work-card:hover {
  transform: translateY(-4px);
  border-color: rgba(24, 24, 27, 0.16);
  box-shadow: 0 24px 50px -28px rgba(15, 23, 42, 0.28);
}
.work-card-frame {
  aspect-ratio: 16 / 10;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border-bottom: 1px solid var(--border);
  padding: clamp(12px, 1.8vw, 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.work-card-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 7px;
  box-shadow: 0 10px 28px -16px rgba(15, 23, 42, 0.24);
}
/* Metric tile — graceful fallback for projects without a screenshot */
.work-card-frame--metric {
  flex-direction: column;
  gap: var(--s2);
  text-align: center;
}
.work-card-metric-value {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-0);
  line-height: 1;
}
.work-card-metric-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.work-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: clamp(1.25rem, 2vw, 1.6rem);
}
.work-card-cat {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s3);
}
.work-card-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-0);
  margin: 0 0 var(--s3);
}
.work-card-summary {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-1);
  font-weight: 300;
  margin: 0 0 var(--s4);
}
.work-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 var(--s5);
  padding: 0;
}
.work-card-tags li {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.work-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--text-2);
}
.work-card-cta svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms ease;
}
.work-card:hover .work-card-cta {
  color: var(--accent);
}
.work-card:hover .work-card-cta svg {
  transform: translateX(4px);
}

/* ── 04 — Engineering capabilities ─────────────────────── */
.work-capabilities {
  border-top: 1px solid var(--border);
}
.work-cap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}
.work-cap-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  padding: clamp(1.5rem, 2.4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 320ms ease, background 320ms ease;
}
.work-cap-card:hover {
  transform: translateY(-4px);
  border-color: rgba(24, 24, 27, 0.16);
  background: #ffffff;
}
.work-cap-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #ffffff;
  margin-bottom: var(--s5);
}
.work-cap-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.work-cap-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-0);
  margin: 0 0 var(--s2);
}
.work-cap-desc {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-1);
  font-weight: 300;
  margin: 0 0 var(--s5);
}
.work-cap-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--text-3);
}
.work-cap-cta svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms ease;
}
.work-cap-card:hover .work-cap-cta {
  color: var(--accent);
}
.work-cap-card:hover .work-cap-cta svg {
  transform: translateX(3px);
}

/* ── 05 — Outcomes ─────────────────────────────────────── */
.work-outcomes {
  border-top: 1px solid var(--border);
}
.work-outcomes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.work-outcome {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.work-outcome::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.work-outcome-value {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-0);
}
.work-outcome-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1.4;
}

/* ── 06 — Next-step CTA ────────────────────────────────── */
.work-cta {
  border-top: 1px solid var(--border);
  background: #fafafa;
}
.work-cta-inner {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
}
.work-cta-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.04;
  color: var(--text-0);
  margin: 0 0 var(--s4);
}
.work-cta-sub {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.6;
  color: var(--text-1);
  font-weight: 300;
  margin: 0 0 var(--s7);
  max-width: 40ch;
  margin-inline: auto;
}
.work-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  justify-content: center;
}

/* ── Responsive ────────────────────────────────────────── */
/* Tablet: featured stacks, more grid → 2 cols, capabilities/outcomes → 2 */
@media (max-width: 960px) {
  .work-featured-inner {
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 4vw, 2.5rem);
  }
  .work-featured-frame {
    aspect-ratio: 16 / 9;
  }
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .work-cap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .work-outcomes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile: single column, full-width screenshots, comfortable spacing */
@media (max-width: 600px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
  .work-cap-grid {
    grid-template-columns: 1fr;
  }
  .work-outcomes-grid {
    grid-template-columns: 1fr;
  }
  .work-featured-meta {
    flex-direction: column;
    gap: var(--s4);
  }
  .work-cta-actions .btn-cta,
  .work-cta-actions .btn-ghost {
    width: 100%;
    justify-content: center;
  }
}
