/* Sky Web Design — portfolio and case studies.
   Loaded only on pages holding a skyweb_case_* widget (Skyweb_Site::assets).
   Each case page takes on its client: --case is the client's accent, --panel
   the colour the screens sit on, --tile the logo's own background. */

.sw-case {
  --case: var(--sw-blue);
  --panel: var(--sw-soft);
  --tile: #FFFFFF;
  max-width: var(--sw-max);
  margin: 0 auto;
  padding: 140px 24px 0;
}

/* A small dash in the client's colour marks each section label. */
.sw-case__label { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--sw-muted); font-size: 15px; font-weight: 500; }
.sw-case__label::before { content: ""; flex: none; width: 18px; height: 2px; border-radius: 2px; background: var(--case); }
.sw-case__head { max-width: 760px; margin-bottom: 48px; }
.sw-case__head h2 { font-size: clamp(34px, 4.2vw, 60px); letter-spacing: -0.035em; }
.sw-case__intro { max-width: 36em; margin: 20px 0 0; color: var(--sw-muted); font-size: 18px; }

/* Browser chrome over a screenshot. */
.sw-case__bar { display: flex; align-items: center; gap: 14px; height: 38px; padding: 0 14px; background: #1A1A1E; }
.sw-case__bar span { display: flex; gap: 6px; }
.sw-case__bar i { width: 10px; height: 10px; border-radius: 50%; background: #3A3A41; }
.sw-case__bar b { flex: 1; max-width: 340px; margin: 0 auto; padding: 5px 12px; border-radius: 8px; background: #0F0F12; color: var(--sw-muted); font: 500 12.5px/1.2 var(--sw-font-body); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform: translateX(-24px); }

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

.sw-chero { padding-top: 128px; }
.sw-chero__crumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 44px; color: var(--sw-muted); font-size: 13px; }
.sw-chero__crumb a:hover { color: var(--sw-ink); }
.sw-chero__top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; align-items: end; }
.sw-chero__logo { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; height: 68px; margin-bottom: 28px; padding: 0 22px; border-radius: 16px; background: var(--tile); box-shadow: 0 0 0 1px var(--sw-line); }
body.sw-site .sw-chero__logo img { width: auto; height: 32px; max-width: 230px; object-fit: contain; }
.sw-chero h1 { font-size: clamp(48px, 7.4vw, 112px); line-height: .94; letter-spacing: -0.045em; }
.sw-chero__side p { max-width: 26em; margin: 0 0 26px; font-size: 20px; line-height: 1.45; }
.sw-chero__side .sw-btn svg { width: 14px; height: 14px; margin-left: 8px; }
.sw-chero__soon { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border: 1px solid var(--sw-line); border-radius: 999px; color: var(--sw-muted); font-size: 15px; }
.sw-chero__soon i { width: 8px; height: 8px; border-radius: 50%; background: var(--case); box-shadow: 0 0 0 4px color-mix(in srgb, var(--case) 28%, transparent); }
.sw-chero__facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 56px 0 0; border-top: 1px solid var(--sw-line); }
.sw-chero__facts div { padding: 18px 20px 0 0; }
.sw-chero__facts div + div { padding-left: 20px; border-left: 1px solid var(--sw-line); }
.sw-chero__facts dt { margin-bottom: 6px; color: var(--sw-muted); font-size: 13px; }
.sw-chero__facts dd { margin: 0; font-size: 16px; font-weight: 500; }

/* The site itself, on the client's colour: desktop rising from the bottom
   edge of the panel, the phone in front of it. */
.sw-chero__stage { position: relative; margin-top: 64px; padding: clamp(28px, 5vw, 72px) clamp(20px, 7vw, 110px) 0; border-radius: 32px; background: var(--panel); overflow: hidden; }
.sw-chero__desk { margin: 0; overflow: hidden; border-radius: 14px 14px 0 0; background: #FFFFFF; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6); }
body.sw-site .sw-chero__desk img,
.sw-chero__desk video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.sw-chero__phone { position: absolute; right: clamp(14px, 3.4vw, 52px); bottom: clamp(18px, 3.4vw, 52px); width: clamp(120px, 17%, 228px); margin: 0; padding: 7px; border-radius: 34px; background: #0F0F11; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 70px -24px rgba(0, 0, 0, .7); }
body.sw-site .sw-chero__phone img,
.sw-chero__phone video { display: block; width: 100%; height: auto; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; border-radius: 27px; background: #FFFFFF; }

/* One entrance: the stage rises, then the phone slides in. */
@media (prefers-reduced-motion: no-preference) {
  .sw-chero__desk { animation: sw-case-rise .9s cubic-bezier(.2, .7, .2, 1) both .1s; }
  .sw-chero__phone { animation: sw-case-rise 1s cubic-bezier(.2, .7, .2, 1) both .35s; }
}
@keyframes sw-case-rise { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }

/* --------------------------------- brief -------------------------------- */

.sw-cbrief { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 80px; align-items: start; }
.sw-cbrief h2 { margin-bottom: 28px; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.06; letter-spacing: -0.03em; }
.sw-cbrief__p { max-width: 36em; margin: 0 0 1em; color: var(--sw-muted); font-size: 18px; line-height: 1.65; }
.sw-cbrief__side { padding: 32px; border: 1px solid var(--sw-line); border-radius: 24px; background: var(--sw-surface); }
.sw-cbrief__built { display: grid; margin: 0 0 32px; padding: 0; list-style: none; }
.sw-cbrief__built li { position: relative; padding: 13px 0 13px 24px; border-top: 1px solid var(--sw-line); font-size: 15.5px; line-height: 1.5; }
.sw-cbrief__built li::before { content: ""; position: absolute; left: 2px; top: 1.3em; width: 8px; height: 8px; border-radius: 2px; background: var(--case); }
.sw-cbrief__stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sw-cbrief__stack li { padding: 7px 13px; border-radius: 999px; background: var(--sw-soft); font-size: 13.5px; }

/* ------------------------------- identity ------------------------------- */

.sw-cbrand__board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.sw-cbrand__logo { position: relative; display: grid; place-items: center; grid-column: span 7; min-height: 360px; margin: 0; padding: 48px; border-radius: 24px; background: var(--tile); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
body.sw-site .sw-cbrand__logo img { width: auto; max-width: min(80%, 440px); max-height: 150px; object-fit: contain; }
.sw-cbrand__logo figcaption { position: absolute; left: 20px; bottom: 18px; padding: 5px 11px; border-radius: 999px; background: rgba(11, 11, 12, .7); color: #FFFFFF; font-size: 12.5px; }
.sw-cbrand__palette { display: flex; flex-direction: column; grid-column: span 5; margin: 0; padding: 0; list-style: none; border-radius: 24px; overflow: hidden; }
.sw-cbrand__palette li { display: flex; flex: 1; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 64px; padding: 14px 22px; background: var(--c); color: var(--on); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.sw-cbrand__palette span { font-weight: 600; font-size: 15px; }
.sw-cbrand__palette code { font: 500 13px/1 var(--sw-font-mono); opacity: .8; }
.sw-cbrand__type { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; grid-column: 1 / -1; }
.sw-cbrand__face { display: flex; flex-direction: column; min-height: 300px; padding: 32px 36px; border: 1px solid var(--sw-line); border-radius: 24px; background: var(--sw-surface); }
.sw-cbrand__aa { font-size: clamp(96px, 11vw, 160px); line-height: .9; letter-spacing: -0.03em; }
.sw-cbrand__sample { max-width: 22em; margin: 20px 0 28px; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.15; }
.sw-cbrand__face--body .sw-cbrand__sample { font-size: 19px; line-height: 1.5; }
.sw-cbrand__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: auto 0 0; padding-top: 18px; border-top: 1px solid var(--sw-line); font: 400 14px/1.4 var(--sw-font-body); color: var(--sw-muted); }
.sw-cbrand__meta b { color: var(--sw-ink); font-weight: 600; }

/* ------------------------------- screens -------------------------------- */

.sw-cscreens__stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(20px, 3vw, 48px); align-items: end; padding: clamp(24px, 4vw, 56px); border-radius: 32px; background: var(--panel); }
.sw-cscreens__desk { margin: 0; overflow: hidden; border-radius: 14px; background: #FFFFFF; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6); }
.sw-cscreens__desk .sw-cscreens__scroll { height: clamp(360px, 44vw, 620px); }
.sw-cscreens__phone { width: clamp(200px, 21vw, 290px); margin: 0; padding: 8px; border-radius: 40px; background: #0F0F11; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 70px -24px rgba(0, 0, 0, .7); }
.sw-cscreens__phone .sw-cscreens__scroll { aspect-ratio: 390 / 800; border-radius: 32px; }
.sw-cscreens__scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; background: #FFFFFF; }
.sw-cscreens__scroll::-webkit-scrollbar { display: none; }
.sw-cscreens__scroll:focus-visible { outline: 2px solid var(--sw-blue); outline-offset: 3px; }
body.sw-site .sw-cscreens__scroll img { display: block; width: 100%; height: auto; }
.sw-cscreens__hint { position: absolute; top: 18px; right: 18px; margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(11, 11, 12, .72); color: #FFFFFF; font-size: 12.5px; pointer-events: none; transition: opacity .3s ease; }
.sw-cscreens__stage.is-touched .sw-cscreens__hint { opacity: 0; }

/* --------------------------------- next --------------------------------- */

.sw-cnext__card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 48px; align-items: center; padding: clamp(28px, 4vw, 56px); border: 1px solid var(--sw-line); border-radius: 32px; background: var(--sw-surface); overflow: hidden; transition: border-color .25s ease; }
.sw-cnext__card:hover { border-color: var(--sw-muted); }
.sw-cnext__text { display: block; }
.sw-cnext__name { display: block; margin: 4px 0 12px; font: 700 clamp(40px, 5.6vw, 84px)/.95 var(--sw-font-head); letter-spacing: -0.04em; }
.sw-cnext__type { display: block; color: var(--sw-muted); font-size: 17px; }
.sw-cnext__go { display: grid; place-items: center; width: 58px; height: 58px; margin-top: 34px; border-radius: 50%; background: var(--sw-ink); color: var(--sw-bg); transition: transform .3s ease; }
.sw-cnext__go svg { width: 18px; height: 18px; }
.sw-cnext__card:hover .sw-cnext__go { transform: rotate(45deg); }
.sw-cnext__media { display: block; aspect-ratio: 16 / 11; padding: 7% 7% 0; border-radius: 20px; background: var(--panel); overflow: hidden; }
body.sw-site .sw-cnext__media img { width: 100%; height: auto; border-radius: 10px 10px 0 0; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.sw-cnext__card:hover .sw-cnext__media img { transform: translateY(-8px); }
.sw-cnext__all { margin: 28px 0 0; text-align: center; }
.sw-cnext__all a { color: var(--sw-muted); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; }
.sw-cnext__all a:hover { color: var(--sw-ink); }

/* ------------------------------ portfolio ------------------------------- */

.sw-cgrid { padding-top: 150px; padding-bottom: 120px; }
.sw-cgrid__head { max-width: 860px; }
.sw-cgrid__head h1 { font-size: clamp(44px, 6.4vw, 96px); line-height: .96; letter-spacing: -0.045em; }
.sw-cgrid__filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 36px; }
.sw-cgrid__filters button { padding: 10px 16px; border: 1px solid var(--sw-line); border-radius: 999px; background: none; color: var(--sw-muted); font: 500 14px/1.2 var(--sw-font-body); cursor: pointer; transition: color .2s ease, border-color .2s ease, background .2s ease; }
.sw-cgrid__filters button:hover { color: var(--sw-ink); border-color: var(--sw-muted); }
.sw-cgrid__filters button span { margin-left: 4px; opacity: .6; font-variant-numeric: tabular-nums; }
.sw-cgrid__filters button.is-on { background: var(--sw-ink); border-color: var(--sw-ink); color: var(--sw-bg); }
.sw-cgrid__filters button:focus-visible { outline: 2px solid var(--sw-blue); outline-offset: 2px; }
.sw-cgrid__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px 24px; margin: 0; padding: 0; list-style: none; }
.sw-pcard[hidden] { display: none; }
.sw-pcard a { display: block; }
.sw-pcard a:focus-visible { outline: 2px solid var(--sw-blue); outline-offset: 6px; border-radius: 28px; }
.sw-pcard__media { display: block; aspect-ratio: 4 / 3; padding: 9% 9% 0; border-radius: 28px; background: var(--panel); overflow: hidden; }
/* The screenshot, with its recording laid over it on hover. */
.sw-pcard__shot { position: relative; display: block; overflow: hidden; border-radius: 10px 10px 0 0; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
body.sw-site .sw-pcard__media img { width: 100%; height: auto; }
.sw-pcard__shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .3s ease; }
.sw-pcard__shot.is-playing video { opacity: 1; }
.sw-pcard a:hover .sw-pcard__shot { transform: translateY(-10px); }
.sw-pcard__body { display: block; padding: 22px 4px 0; }
.sw-pcard__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--sw-muted); font-size: 14px; }
.sw-pcard__note { padding: 3px 10px; border: 1px solid var(--sw-line); border-radius: 999px; font-size: 12.5px; }
.sw-pcard__name { margin: 8px 0 6px; font-size: clamp(26px, 2.6vw, 38px); letter-spacing: -0.03em; }
.sw-pcard__line { display: block; max-width: 34em; color: var(--sw-muted); font-size: 16px; }

/* Rhythm in the full list: every fifth project runs the full width. */
.sw-cgrid__list:not(.is-filtered) .sw-pcard:nth-child(5n + 1) { grid-column: 1 / -1; }
.sw-cgrid__list:not(.is-filtered) .sw-pcard:nth-child(5n + 1) .sw-pcard__media { aspect-ratio: 21 / 9; padding: 5% 16% 0; }

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

@media (max-width: 1100px) {
  .sw-chero__top { grid-template-columns: 1fr; gap: 28px; }
  .sw-chero__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sw-chero__facts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .sw-chero__facts div:nth-child(n + 3) { margin-top: 18px; border-top: 1px solid var(--sw-line); }
  .sw-cbrief { grid-template-columns: 1fr; gap: 40px; }
  .sw-cbrand__logo, .sw-cbrand__palette { grid-column: 1 / -1; }
  .sw-cbrand__logo { min-height: 280px; }
  .sw-cbrand__palette { flex-direction: row; flex-wrap: wrap; }
  .sw-cbrand__palette li { flex: 1 1 30%; min-height: 120px; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 6px; }
  .sw-cnext__card { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 760px) {
  .sw-case { padding: 88px 16px 0; }
  .sw-chero { padding-top: 104px; }
  .sw-chero__crumb { margin-bottom: 28px; }
  .sw-chero__logo { height: 56px; margin-bottom: 20px; padding: 0 16px; border-radius: 14px; }
  body.sw-site .sw-chero__logo img { height: 26px; max-width: 190px; }
  .sw-chero h1 { font-size: clamp(42px, 12.5vw, 64px); }
  .sw-chero__side p { font-size: 17px; }
  .sw-chero__side .sw-btn { width: 100%; }
  .sw-chero__facts { margin-top: 36px; }
  .sw-chero__facts dd { font-size: 15px; }
  .sw-chero__stage { margin-top: 40px; padding: 22px 14px 0; border-radius: 22px; }
  .sw-chero__desk { border-radius: 9px 9px 0 0; }
  .sw-chero__phone { right: 10px; bottom: 12px; width: 30%; padding: 4px; border-radius: 20px; }
  body.sw-site .sw-chero__phone img, .sw-chero__phone video { border-radius: 16px; }
  .sw-case__bar { height: 26px; gap: 8px; padding: 0 9px; }
  .sw-case__bar i { width: 6px; height: 6px; }
  .sw-case__bar span { gap: 4px; }
  .sw-case__bar b { padding: 3px 8px; font-size: 10px; transform: none; }
  .sw-case__head { margin-bottom: 28px; }
  .sw-case__head h2 { font-size: 32px; }
  .sw-case__intro, .sw-cbrief__p { font-size: 16px; }
  .sw-cbrief__side { padding: 22px; border-radius: 20px; }
  .sw-cbrand__board { gap: 10px; }
  .sw-cbrand__logo { min-height: 200px; padding: 32px; border-radius: 20px; }
  body.sw-site .sw-cbrand__logo img { max-height: 96px; }
  .sw-cbrand__palette { border-radius: 20px; }
  .sw-cbrand__palette li { flex-basis: 45%; min-height: 96px; padding: 12px 14px; }
  .sw-cbrand__type { grid-template-columns: 1fr; gap: 10px; }
  .sw-cbrand__face { min-height: 0; padding: 24px; border-radius: 20px; }
  .sw-cscreens__stage { grid-template-columns: 1fr; justify-items: center; padding: 16px 16px 24px; border-radius: 22px; }
  .sw-cscreens__desk { width: 100%; border-radius: 10px; }
  .sw-cscreens__desk .sw-cscreens__scroll { height: 300px; }
  .sw-cscreens__phone { width: 230px; }
  .sw-cscreens__hint { top: auto; right: 50%; bottom: 10px; transform: translateX(50%); font-size: 11px; white-space: nowrap; }
  .sw-cscreens__stage { padding-bottom: 44px; }
  .sw-cnext__card { padding: 22px; border-radius: 22px; }
  .sw-cnext__name { font-size: 42px; }
  .sw-cnext__go { width: 48px; height: 48px; margin-top: 20px; }
  .sw-cgrid { padding-top: 108px; padding-bottom: 72px; }
  .sw-cgrid__head h1 { font-size: clamp(40px, 12vw, 58px); }
  .sw-cgrid__filters { flex-wrap: nowrap; margin: 0 -16px 28px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
  .sw-cgrid__filters::-webkit-scrollbar { display: none; }
  .sw-cgrid__filters button { flex: none; }
  .sw-cgrid__list { grid-template-columns: 1fr; gap: 44px; }
  .sw-cgrid__list:not(.is-filtered) .sw-pcard:nth-child(5n + 1) .sw-pcard__media,
  .sw-pcard__media { aspect-ratio: 4 / 3; padding: 9% 9% 0; border-radius: 22px; }
  .sw-pcard__name { font-size: 28px; }
}
