/* LM Media Solutions — Portfolio
   Brand matched to lmmediasolutions.co.za: DM Serif Display + DM Sans, navy #0B4F8A */

:root {
  --navy: #0b4f8a;
  --navy-deep: #08365f;
  --navy-ink: #0a2540;
  --sky: #e8f1f9;
  --sky-2: #d3e4f3;
  --ink: #171717;
  --ink-2: #4a5462;
  --ink-3: #7a8494;
  --line: #e3e8ee;
  --paper: #ffffff;
  --paper-2: #f5f8fb;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(10, 37, 64, .06), 0 2px 8px rgba(10, 37, 64, .05);
  --shadow-md: 0 4px 12px rgba(10, 37, 64, .08), 0 18px 40px -12px rgba(10, 37, 64, .18);
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
button { font: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--navy); margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.eyebrow .num { font-family: var(--serif); font-size: 15px; letter-spacing: 0; color: var(--ink-3); font-weight: 400; }
.eyebrow-light { color: #9cc3e6; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 4px; font-weight: 700; font-size: 15px;
  text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
  white-space: nowrap;
}
.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy-ink); }
.btn-light:hover { background: var(--sky); }
.btn-ghost-light { border-color: rgba(255,255,255,.4); color: #fff; }
.btn-ghost-light:hover { border-color: #fff; background: rgba(255,255,255,.08); }
:focus-visible { outline: 3px solid #5aa0dc; outline-offset: 2px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 15px; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.header-nav { display: flex; gap: 28px; margin-left: auto; }
.header-nav a { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.header-nav a:hover { color: var(--navy); }

/* Hero */
.hero {
  padding: clamp(56px, 9vw, 112px) 0 clamp(48px, 7vw, 88px);
  background:
    radial-gradient(900px 400px at 85% 0%, var(--sky) 0%, transparent 70%),
    linear-gradient(180deg, var(--paper-2), var(--paper));
  border-bottom: 1px solid var(--line);
}
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--navy); }
.lede { margin-top: 22px; font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 58ch; }
.stats { display: flex; flex-wrap: wrap; gap: 12px 48px; margin: 40px 0 0; padding-top: 28px; border-top: 1px solid var(--line); max-width: 720px; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.stats dd { margin: 0; font-family: var(--serif); font-size: 40px; line-height: 1.1; color: var(--navy-ink); }

/* Sections */
.section { padding: clamp(64px, 9vw, 112px) 0; scroll-margin-top: 48px; }
.section-alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); max-width: 20ch; }
.section-head-center { justify-content: center; text-align: center; }
.section-head-center .eyebrow { justify-content: center; }
.section-head-center h2 { margin: 0 auto; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Grids */
.grid { display: grid; gap: clamp(20px, 2.4vw, 32px); }
.grid-pres { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; }
.grid-web { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-pres .card.featured { grid-column: span 2; }
.grid-web .card.featured { grid-column: 1 / -1; }

/* Cards */
.card {
  position: relative; display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .3s ease, box-shadow .3s ease, border-color .3s;
  text-align: left; padding: 0; cursor: pointer; color: inherit; font: inherit;
  animation: rise .5s ease both;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--sky-2); }
.card[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--sky); }
.card-media > img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .card-media > img { transform: scale(1.03); }
/* Whole-page covers (A4 documents): shown uncropped, like a print on a desk */
.card-media.contain { background: linear-gradient(150deg, var(--sky) 0%, var(--sky-2) 100%); }
.card-media.contain > img { object-fit: contain; padding: 18px; filter: drop-shadow(0 10px 18px rgba(10,37,64,.28)); }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-kicker { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); }
.card-title { font-family: var(--serif); font-size: 24px; line-height: 1.2; }
.card-client { font-size: 14px; color: var(--ink-3); }
.card-desc { font-size: 15px; color: var(--ink-2); margin-top: 4px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; font-size: 14px; font-weight: 700; color: var(--navy); }
.card-foot .arrow { transition: transform .2s; }
.card:hover .card-foot .arrow { transform: translateX(4px); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }

.badge-sample {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  background: #fff4d6; color: #7a5600; border: 1px solid #f1d58a;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
}
.slide-count {
  position: absolute; right: 12px; bottom: 12px; z-index: 3;
  background: rgba(10,37,64,.78); color: #fff; font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(4px);
}

/* ---------- Placeholder slide (shown until a real cover is added) ---------- */
.ph-slide {
  position: absolute; inset: 0; display: grid; grid-template-columns: 38% 1fr;
  background: #fff; container-type: inline-size;
}
.ph-slide .band { background: var(--navy); position: relative; overflow: hidden; }
.ph-slide .band::after {
  content: ""; position: absolute; width: 140%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18); left: -20%; bottom: -70%;
}
.ph-slide .band::before {
  content: ""; position: absolute; width: 90%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.12); right: -45%; top: -35%;
}
.ph-slide .copy { padding: 9cqw 7cqw; display: flex; flex-direction: column; justify-content: center; gap: 2.2cqw; }
.ph-slide .ph-type { font-size: 2.6cqw; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--navy); }
.ph-slide .ph-title { font-family: var(--serif); font-size: 6.4cqw; line-height: 1.05; color: var(--navy-ink); }
.ph-slide .ph-line { height: 1.3cqw; border-radius: 1cqw; background: var(--sky-2); }
.ph-slide .ph-line.s { width: 60%; }
.ph-slide .ph-line.m { width: 80%; }
.ph-slide.v2 { grid-template-columns: 1fr; grid-template-rows: 1fr 30%; }
.ph-slide.v2 .band { order: 2; }
.ph-slide.v2 .copy { padding: 6cqw 8cqw; }
.ph-slide.v3 { background: var(--navy-ink); grid-template-columns: 1fr 34%; }
.ph-slide.v3 .band { order: 2; background: linear-gradient(160deg, #1f6fb4, var(--navy)); }
.ph-slide.v3 .ph-title { color: #fff; }
.ph-slide.v3 .ph-type { color: #9cc3e6; }
.ph-slide.v3 .ph-line { background: rgba(255,255,255,.18); }

/* ---------- Website card: browser frame ---------- */
.browser { position: relative; margin: 22px 22px 0; border-radius: 10px 10px 0 0; overflow: hidden; background: #fff; box-shadow: 0 -1px 0 var(--line), 0 10px 30px -10px rgba(10,37,64,.25); }
.browser-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: #eef2f6; border-bottom: 1px solid var(--line); }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: #cfd7e1; display: block; }
.browser-bar .url { margin-left: 10px; flex: 1; max-width: 280px; height: 16px; border-radius: 4px; background: #fff; font-size: 10px; line-height: 16px; color: var(--ink-3); padding: 0 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.browser-view { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-2); }
.browser-view > img.shot { width: 100%; height: auto; min-height: 100%; object-fit: cover; object-position: top; transition: transform 4s ease; }
.card:hover .browser-view > img.shot.tall { transform: translateY(var(--scroll, 0)); }
.web-media { background: linear-gradient(160deg, var(--sky) 0%, var(--sky-2) 100%); position: relative; }
.grid-web .card.featured .browser-view { aspect-ratio: 16 / 8; }
.phone {
  position: absolute; right: 6%; bottom: 0; width: 18%; min-width: 80px; aspect-ratio: 9 / 19;
  border: 5px solid var(--navy-ink); border-bottom: 0; border-radius: 18px 18px 0 0; overflow: hidden; background: #fff;
  box-shadow: 0 10px 30px rgba(10,37,64,.35); z-index: 2;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* Placeholder website wireframe */
.ph-site { position: absolute; inset: 0; container-type: inline-size; background: #fff; display: flex; flex-direction: column; }
.ph-site .nav { display: flex; align-items: center; gap: 2cqw; padding: 2.4cqw 4cqw; border-bottom: 1px solid var(--line); }
.ph-site .logo { width: 3.6cqw; height: 3.6cqw; border-radius: 50%; background: var(--navy); }
.ph-site .links { margin-left: auto; display: flex; gap: 1.6cqw; }
.ph-site .links i { width: 6cqw; height: 1cqw; border-radius: 1cqw; background: var(--sky-2); display: block; }
.ph-site .hero-ph { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 4cqw; padding: 5cqw 4cqw; align-items: center; background: linear-gradient(180deg, var(--paper-2), #fff); }
.ph-site .h { font-family: var(--serif); font-size: 4.6cqw; line-height: 1.05; color: var(--navy-ink); }
.ph-site .l { height: 1.1cqw; border-radius: 1cqw; background: var(--sky-2); margin-top: 1.6cqw; }
.ph-site .b { margin-top: 2.6cqw; width: 14cqw; height: 3.6cqw; border-radius: .6cqw; background: var(--navy); }
.ph-site .img { height: 100%; min-height: 18cqw; border-radius: 1.4cqw; background: linear-gradient(140deg, var(--navy) 0%, #2f7cc0 100%); position: relative; overflow: hidden; }
.ph-site .img::after { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); right: -20%; bottom: -30%; }
.ph-site.v2 .hero-ph { grid-template-columns: 1fr; text-align: center; justify-items: center; background: var(--navy-ink); }
.ph-site.v2 .h { color: #fff; }
.ph-site.v2 .l { background: rgba(255,255,255,.2); width: 50cqw; }
.ph-site.v2 .b { background: #fff; }
.ph-site.v2 .img { display: none; }

/* ---------- Logo wall ---------- */
.logo-wall {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
}
.logo-wall li {
  flex: 0 0 calc((100% - 3 * 14px) / 4);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.logo-wall li:hover { border-color: var(--sky-2); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.logo-wall a, .logo-wall .tile {
  display: flex; align-items: center; justify-content: center; height: 150px; padding: 26px;
  text-decoration: none; position: relative;
}
/* Logos are supplied as black artwork */
.logo-wall img {
  max-height: 86px; max-width: 78%; width: auto; object-fit: contain;
  opacity: .82; transition: opacity .3s;
}
.logo-wall li:hover img { opacity: 1; }
.logo-word {
  font-family: var(--serif); font-size: 22px; line-height: 1.15; color: #111; text-align: center;
  opacity: .82; transition: opacity .3s;
}
.logo-wall li:hover .logo-word { opacity: 1; }
.logo-ph { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-weight: 700; font-size: 15px; letter-spacing: .02em; transition: color .3s; }
.logo-ph b { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--sky); color: var(--navy); font-family: var(--serif); font-weight: 400; font-size: 17px; }
.logo-wall li:hover .logo-ph { color: var(--navy-ink); }
.logo-wall .badge-sample { top: 8px; right: 8px; font-size: 9px; padding: 1px 7px; }

/* ---------- CTA ---------- */
.cta { background: var(--navy-ink); color: #fff; padding: clamp(56px, 8vw, 96px) 0; position: relative; overflow: hidden; }
.cta::after { content: ""; position: absolute; width: 520px; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(255,255,255,.07); right: -140px; top: -200px; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px 48px; flex-wrap: wrap; position: relative; z-index: 1; }
.cta h2 { font-size: clamp(30px, 4vw, 44px); max-width: 18ch; }
.cta p { color: #c5d5e6; margin-top: 14px; max-width: 52ch; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--ink-3); }
.footer-inner { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--navy); }

/* ---------- Viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: clamp(0px, 3vw, 32px); }
.viewer[hidden] { display: none; }
.viewer-backdrop { position: absolute; inset: 0; background: rgba(6, 22, 40, .82); backdrop-filter: blur(6px); animation: fade .25s ease; }
.viewer-panel {
  position: relative; width: min(1180px, 100%); max-height: 100%; overflow: auto;
  background: #fff; border-radius: var(--radius); display: flex; flex-direction: column;
  animation: pop .3s ease;
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.viewer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; }
.viewer-kicker { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); margin-bottom: 4px; }
.viewer-top h3 { font-size: clamp(22px, 2.6vw, 30px); }
.viewer-stage { position: relative; background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 64px; display: flex; align-items: center; justify-content: center; }
.viewer-media { width: 100%; max-width: 960px; }
.viewer-media .frame {
  position: relative; aspect-ratio: var(--ratio, 16 / 9); width: min(100%, calc(64vh * var(--ratio, 1.7778)));
  margin: 0 auto; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-md); background: #fff;
}
.viewer-media .frame.free { aspect-ratio: auto; width: 100%; max-height: 68vh; overflow: auto; }
.viewer-media .frame > img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.viewer-media .frame.free > img { height: auto; }
.viewer-bottom { padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.viewer-bottom p { color: var(--ink-2); font-size: 15px; max-width: 70ch; }
.viewer-meta { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--ink-3); }
.viewer-thumbs { display: flex; gap: 10px; padding: 0 24px 20px; overflow-x: auto; }
.viewer-thumbs:empty { display: none; }
.thumb { flex: 0 0 auto; height: 63px; aspect-ratio: var(--ratio, 16 / 9); border-radius: 6px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--sky); position: relative; opacity: .65; transition: opacity .2s, border-color .2s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"] { border-color: var(--navy); opacity: 1; }
.thumb:hover { opacity: 1; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; transition: background .2s, border-color .2s; }
.icon-btn:hover { border-color: var(--navy); background: var(--sky); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--navy-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.nav { position: absolute; top: 50%; transform: translateY(-50%); }
.icon-btn.prev { left: 12px; }
.icon-btn.next { right: 12px; }
.icon-btn[disabled] { opacity: .3; cursor: default; }
body.no-scroll { overflow: hidden; }
/* Inside an auto-height iframe: anchor near the clicked card */
.viewer.in-frame { position: absolute; bottom: auto; display: block; padding: 0 12px; }
.viewer.in-frame .viewer-backdrop { position: fixed; }
.viewer.in-frame .viewer-panel { margin: 0 auto; max-height: none; height: auto; }

/* Empty state */
.empty { grid-column: 1 / -1; text-align: center; padding: 48px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- Embed mode (?embed=1) ---------- */
.is-embed .site-header, .is-embed .site-footer, .is-embed .hero, .is-embed .cta { display: none; }
.is-embed body { background: transparent; }
.is-embed .section:first-of-type { padding-top: 24px; }
[data-only="presentations"] [data-section]:not([data-section="presentations"]),
[data-only="websites"] [data-section]:not([data-section="websites"]),
[data-only="clients"] [data-section]:not([data-section="clients"]) { display: none; }
[data-only] .section { padding: 24px 0; background: transparent; border: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .grid-pres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logo-wall li { flex-basis: calc((100% - 2 * 14px) / 3); }
}
@media (max-width: 720px) {
  .header-nav { display: none; }
  .header-inner { justify-content: space-between; height: 64px; }
  .brand span { display: none; }
  .grid-pres, .grid-web { grid-template-columns: 1fr; }
  .grid-pres .card.featured { grid-column: auto; }
  .logo-wall { gap: 10px; }
  .logo-wall li { flex-basis: calc((100% - 10px) / 2); }
  .logo-wall a, .logo-wall .tile { height: 112px; padding: 18px; }
  .logo-wall img { max-height: 64px; }
  .logo-word { font-size: 17px; }
  .stats { gap: 16px 32px; }
  .stats dd { font-size: 32px; }
  .viewer-stage { padding: 12px; }
  .icon-btn.nav { width: 36px; height: 36px; background: rgba(255,255,255,.92); }
  .icon-btn.prev { left: 4px; }
  .icon-btn.next { right: 4px; }
  .viewer-panel { border-radius: 0; height: 100%; }
  .browser { margin: 14px 14px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Print (save as PDF to send to clients) ---------- */
@media print {
  .site-header, .filters, .cta-actions, .viewer, .card-foot .arrow { display: none !important; }
  .card { break-inside: avoid; box-shadow: none; animation: none; }
  .section { padding: 32px 0; }
  .badge-sample { display: none; }
}
