/* Work / portfolio — logo wall, case studies, device frames.
   Loaded by /work and by the home-page "Selected Work" strip. */

/* ---------- Logo wall ---------- */
.logo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border-top: 1px solid var(--color-divider);
  border-left: 1px solid var(--color-divider);
}
.logo-wall a {
  display: flex; align-items: center; justify-content: center;
  min-height: 128px; padding: 28px;
  border-right: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  text-decoration: none; color: var(--color-text);
  transition: background-color 0.25s ease;
}
.logo-wall a:hover, .logo-wall a:focus-visible { background: var(--color-surface); }
.logo-wall img {
  display: block; max-width: 150px; max-height: 56px; width: auto; height: auto;
}
/* Text tile for clients shown without name/logo */
.logo-text {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 15px; letter-spacing: 0.18em; text-transform: uppercase; text-align: center; line-height: 1.4;
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
}
.logo-text small { display: block; font-size: 11px; letter-spacing: 0.2em; margin-top: 6px; color: var(--color-accent-700); }

/* ---------- Case study ---------- */
.case {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  gap: 56px; align-items: center;
  padding: 80px 0; border-top: 1px solid var(--color-divider);
  scroll-margin-top: 24px;
}
.case:nth-of-type(even) .case-media { order: -1; }
.case-num { font-family: var(--font-heading); font-feature-settings: 'tnum'; font-size: 15px; font-weight: 700;
  letter-spacing: 0.16em; color: var(--color-accent-800); }
.case-client { display: flex; align-items: center; gap: 16px; margin: 18px 0 14px; }
.case-client img { max-height: 52px; max-width: 160px; width: auto; height: auto; box-sizing: content-box;
  padding: 10px 14px; background: var(--color-neutral-900); border-radius: 4px; }
.case h2 { margin: 0; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.08; font-weight: var(--font-heading-weight); }
.case-meta { font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 58%, transparent); margin: 0 0 22px; }
.case p { margin: 0 0 22px; font-size: 16px; line-height: 1.75; color: color-mix(in srgb, var(--color-text) 84%, transparent); }
.case dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0 0 28px;
  padding: 18px 0; border-top: 1px solid var(--color-divider); border-bottom: 1px solid var(--color-divider); font-size: 14px; }
.case dt { font-family: var(--font-heading); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  font-size: 12.5px; color: var(--color-accent-800); padding-top: 2px; }
.case dd { margin: 0; line-height: 1.6; }
.case-link { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }

/* ---------- Device frames ---------- */
.case-media { position: relative; padding: 0 0 44px 0; }
.browser {
  border: 1px solid var(--color-divider); border-radius: 8px; overflow: hidden;
  background: var(--color-surface);
  box-shadow: 0 24px 48px -28px rgba(32, 31, 29, 0.45);
}
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px;
  border-bottom: 1px solid var(--color-divider); background: color-mix(in srgb, var(--color-surface) 70%, white); }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--color-neutral-300); display: block; }
.browser-bar span { margin-left: 10px; flex: 1; font-size: 11px; letter-spacing: 0.04em; padding: 3px 10px; border-radius: 4px;
  background: var(--color-bg); color: color-mix(in srgb, var(--color-text) 55%, transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.phone {
  position: absolute; right: -12px; bottom: 0; width: 25%; min-width: 96px;
  border: 5px solid var(--color-neutral-900); border-radius: 18px; overflow: hidden; background: var(--color-neutral-900);
  box-shadow: 0 20px 36px -18px rgba(32, 31, 29, 0.6);
}
.case:nth-of-type(even) .phone { right: auto; left: -12px; }
.phone img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 19.5; object-fit: cover; object-position: top; border-radius: 12px; }
.case-media a { display: block; color: inherit; text-decoration: none; }
.case-media a:hover .browser { box-shadow: 0 28px 56px -26px rgba(32, 31, 29, 0.55); }

@media (max-width: 600px) {
  .logo-wall { grid-template-columns: repeat(2, 1fr); }
  .logo-wall a { min-height: 100px; padding: 20px; }
}
@media (max-width: 860px) {
  .case { grid-template-columns: 1fr; gap: 36px; padding: 60px 0; }
  .case:nth-of-type(even) .case-media { order: 0; }
  .phone, .case:nth-of-type(even) .phone { right: 0; left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-wall a, .logo-wall img { transition: none; }
}

/* ---------- Products layout: side menu + catalog ---------- */
.products-layout {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start;
  padding: 0 0 40px; border-top: 1px solid var(--color-divider);
}
.product-menu { position: sticky; top: 24px; padding-top: 44px; }
.product-menu h2 {
  margin: 0 0 14px; font-family: var(--font-body); font-weight: 400;
  font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--color-accent-700);
}
.product-menu ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-divider); }
.product-menu li { border-bottom: 1px solid var(--color-divider); }
.product-menu a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 14px 4px 14px 14px; text-decoration: none; color: var(--color-text);
  font-family: var(--font-heading); font-size: 19px; line-height: 1.2;
  border-left: 2px solid transparent; transition: border-color 0.2s ease, background-color 0.2s ease;
}
.product-menu a:hover { background: var(--color-surface); }
.product-menu a[aria-current="true"] { border-left-color: var(--color-accent); color: var(--color-accent-800); }
.product-menu .count { font-family: var(--font-body); font-size: 12px; color: color-mix(in srgb, var(--color-text) 50%, transparent); font-feature-settings: 'tnum'; }
.product-type { padding-top: 44px; scroll-margin-top: 24px; }
.product-type-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 26px; }
.product-type-head h2 { margin: 0; font-size: clamp(30px, 3.4vw, 42px); font-weight: var(--font-heading-weight); }
.product-type-head p { margin: 0; font-size: 14px; color: color-mix(in srgb, var(--color-text) 62%, transparent); }
.product-type .case:first-of-type { margin-top: 40px; }
/* Inside the catalog column: stack — screenshot on top, write-up below */
.product-type .case { grid-template-columns: 1fr; gap: 40px; padding: 64px 0; }
.product-type .case .case-media,
.product-type .case:nth-of-type(even) .case-media { order: -1; padding-right: 20px; }
.product-type .phone, .product-type .case:nth-of-type(even) .phone { right: 0; left: auto; width: 22%; }
.product-type .case-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 0 48px; align-items: start; }
.product-type .case-body > :not(dl):not(.case-link) { grid-column: 1; }
.product-type .case-body > dl { grid-column: 2; grid-row: 1 / span 6; margin: 0 0 22px; }
.product-type .case-body > .case-link { grid-column: 1; justify-self: start; }
@media (max-width: 1000px) {
  .product-type .case-body { display: block; }
  .product-type .case-body > dl { margin: 0 0 28px; }
}
@media (max-width: 860px) {
  .products-layout { grid-template-columns: 1fr; gap: 0; }
  .product-menu { position: static; padding-top: 28px; }
  .product-menu ul { display: flex; flex-wrap: wrap; gap: 8px; border-top: 0; }
  .product-menu li { border: 0; }
  .product-menu a { padding: 8px 14px; font-size: 16px; border: 1px solid var(--color-divider); border-radius: 999px; }
  .product-menu a[aria-current="true"] { border-color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
}

/* ---------- Testimonials ---------- */
.testimonial { margin: 0 0 26px; padding: 22px 0 0 26px; border-left: 2px solid var(--color-accent); position: relative; }
.testimonial::before {
  content: "\201C"; position: absolute; left: 18px; top: -18px;
  font-family: var(--font-heading); font-size: 72px; line-height: 1; color: var(--color-accent); opacity: 0.35;
}
.testimonial blockquote { margin: 0; font-family: var(--font-heading); font-style: italic; font-size: 22px; line-height: 1.45; color: var(--color-text); }
.testimonial figcaption { margin-top: 14px; font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: color-mix(in srgb, var(--color-text) 62%, transparent); }
.testimonial figcaption b { color: var(--color-accent-800); font-weight: 700; }
.product-type .case-body > .testimonial { grid-column: 1 / -1; margin-top: 8px; }

.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px 56px; }
.testimonial-grid .testimonial { margin: 0; }
.testimonial-grid .testimonial blockquote { font-size: 20px; }

/* ---------- Our Partners (home) ---------- */
.partners { display: grid; grid-template-columns: repeat(auto-fit, 190px); justify-content: center; gap: 14px; }
.partner {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--color-divider);
  box-shadow: 0 10px 24px -18px rgba(32, 31, 29, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.partner:hover, .partner:focus-visible { transform: translateY(-3px); box-shadow: 0 16px 30px -18px rgba(32, 31, 29, 0.55); }
.partner-logo { display: flex; align-items: center; justify-content: center; height: 112px; padding: 18px; background: #fff; }
.partner--dark, .partner--dark .partner-logo { background: var(--color-neutral-900); }
.partner-logo img { display: block; max-width: 100%; max-height: 76px; width: auto; height: auto; }
.partner-name {
  display: flex; flex: 1; justify-content: space-between; align-items: center; gap: 8px; min-height: 46px;
  padding: 10px 12px; background: var(--color-neutral-900); color: #f4efe3;
  border-top: 2px solid var(--color-accent);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.3;
}
.partner-name span { color: var(--color-accent); font-size: 13px; }
@media (max-width: 480px) { .partners { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .partner { transition: none; } .partner:hover { transform: none; } }
