@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

@font-face {
  font-family: Cormorant;
  src: url("../fonts/cormorant-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f4f0e6;
  --sheet: #fffdf7;
  --ink: #102b23;
  --muted: #4b6056;
  --emerald: #1e503e;
  --brass: #c6a977;
  --champagne: #e5d2ae;
  --line: #ccd3c6;
  --mat: #e7e8df;
  --sans: "DM Sans", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 16px/1.55 var(--sans); color: var(--ink); background: var(--paper); }
body:has(dialog[open]) { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p, h1, h2, h3 { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 3px var(--sheet); }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; top: 10px; left: 10px; background: var(--sheet); padding: 12px 16px; }
.wrap { width: min(100% - 76px, 1248px); margin-inline: auto; }

.intro {
  color: var(--sheet);
  background: radial-gradient(ellipse at right top, #1e503e, transparent 70%), var(--ink);
  border-bottom: 1px solid #2b604b;
}
.intro-inner {
  min-height: 278px;
  padding-block: 52px 51px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(200px, 1fr);
  align-items: end;
  gap: 30px;
}
.eyebrow {
  color: var(--emerald);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .17em;
}
.intro .eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--champagne);
  margin-bottom: 17px;
}
.intro .eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--brass); }
h1, .device-heading h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: .99;
  letter-spacing: -.063em;
}
h1 { font-size: clamp(47px, 6.45vw, 91px); }
h1 em {
  color: var(--champagne);
  font-family: Cormorant, var(--serif);
  font-weight: 400;
  font-size: 1.16em;
  line-height: .9;
  letter-spacing: -.045em;
  white-space: nowrap;
}
.intro-copy {
  color: #e1e8dc;
  font-size: clamp(15px, 1.4vw, 18px);
  max-width: 340px;
  border-left: 1px solid var(--brass);
  padding-left: 17px;
  margin-bottom: 2px;
}

.filter-bar { position: sticky; top: var(--brio-header-height); z-index: 2; background: var(--paper); border-bottom: 1px solid var(--line); }
.filter-inner { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 73px; padding-block: 9px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.filters a {
  display: inline-flex;
  min-height: 44px;
  padding: 7px 15px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-weight: 690;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.filters a:hover { background: #e3e8db; }
.filters [aria-current="true"], .filters [aria-current="true"]:hover { background: var(--emerald); border-color: var(--emerald); color: var(--sheet); }
.device-icon { display: inline-block; position: relative; border: 1.5px solid currentColor; border-radius: 2px; flex: none; }
.icon-desktop { width: 16px; height: 10px; margin-bottom: 2px; }
.icon-desktop::after { content: ""; width: 7px; height: 1px; position: absolute; left: 3px; bottom: -4px; background: currentColor; }
.icon-tablet { width: 14px; height: 11px; }
.icon-mobile { width: 8px; height: 13px; }
.gallery-status { color: var(--muted); font-size: 13px; font-weight: 800; white-space: nowrap; }

.gallery { scroll-margin-top: 62px; padding-block: 55px 78px; }
.device-section { scroll-margin-top: 62px; }
.device-section:not([hidden]) + .device-section:not([hidden]) { margin-top: 70px; }
.device-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 17px; margin-bottom: 22px; }
.device-heading h2 { font-size: clamp(36px, 5vw, 64px); }
.device-heading p { color: var(--muted); margin-top: 10px; }
.device-count { white-space: nowrap; color: var(--emerald); font-weight: 730; font-size: 12px; padding: 4px 9px; border: 1px solid var(--line); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
[data-device="mobile"] .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--sheet);
  transition: box-shadow .25s, transform .3s cubic-bezier(.2,.7,.2,1);
}
.card:hover, .card:focus-within { border-color: #9da99c; }
.card:hover { transform: translateY(-3px); box-shadow: 0 13px 27px #102b2316; }
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; border-radius: inherit; }
.card-image {
  --screen-mat: #e8e8df;
  min-width: 0;
  padding: clamp(12px, 2.5vw, 32px);
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  border-bottom: 1px solid var(--line);
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  aspect-ratio: 1.86;
  background: var(--screen-mat);
}
[data-device="tablette"] .card-image { --screen-mat: #e4e8dc; aspect-ratio: 1.42; }
[data-device="mobile"] .card-image { --screen-mat: #e9e7db; aspect-ratio: .97; }
.card-image img {
  width: auto;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 12px 25px #102b2325;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
[data-device="mobile"] .card-image img { border-radius: 7px; }
.card-link:hover .card-image img, .card-link:focus-visible .card-image img { transform: scale(1.025); }
.card-copy { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 17px 19px 19px; }
.card-copy h3 { font-size: clamp(17px, 2vw, 24px); font-weight: 760; letter-spacing: -.027em; line-height: 1.15; }
.card-copy p { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 6px; }
.card-arrow {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--emerald);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-weight: 750;
  transition: background .2s, color .2s;
}
.card-link:hover .card-arrow, .card-link:focus-visible .card-arrow { background: var(--emerald); border-color: var(--emerald); color: var(--sheet); }
.demo-note { margin-top: 36px; color: var(--muted); font-size: 14px; }

.viewer {
  width: min(100% - 24px, 1280px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 24px 85px #102b234d;
}
.viewer[open] { display: grid; grid-template-rows: auto minmax(100px, 1fr) auto auto; animation: appear .22s ease-out both; }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } }
.viewer::backdrop { background: #102b23ed; }
.viewer-head, .viewer-meta, .viewer-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; }
.viewer-head .eyebrow { font-size: 10px; }
.viewer-head h2 { font-size: clamp(17px, 3.1vw, 24px); font-weight: 760; line-height: 1.12; letter-spacing: -.035em; margin-top: 4px; }
.viewer-image { display: flex; justify-content: center; align-items: flex-start; min-height: 0; overflow: auto; background: var(--mat); padding: 8px; border-block: 1px solid var(--line); }
.viewer-image img { display: block; width: auto; max-height: calc(100dvh - 210px); height: auto; margin-block: auto; }
.viewer-meta p { color: var(--muted); font-size: 14px; }
.original { flex: none; color: var(--emerald); font-size: 13px; font-weight: 800; text-underline-offset: 3px; }
.viewer-controls { padding-block: 6px 12px; justify-content: center; gap: 20px; }
.viewer-count { min-width: 45px; text-align: center; font-size: 13px; font-weight: 750; }
.viewer button { min-height: 44px; min-width: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 23px; transition: background .2s; }
.viewer button:hover { background: #e3e8db; }
.viewer button:disabled { opacity: .45; cursor: default; }

@media (max-width: 850px) {
  .wrap { width: calc(100% - 44px); }
  .intro-inner { min-height: 0; padding-block: 45px 51px; gap: 18px; }
  .cards { gap: 12px; }
  .card-copy { padding: 14px 13px 16px; gap: 8px; }
  .card-copy p { font-size: 13px; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 30px); }
  .intro-inner { grid-template-columns: 1fr; gap: 19px; padding-block: 36px 40px; }
  .intro .eyebrow { margin-bottom: 14px; }
  h1 { font-size: clamp(37px, 10vw, 62px); }
  .intro-copy { font-size: 15px; max-width: 330px; padding-left: 12px; }
  .filter-inner { min-height: 62px; }
  .filters { gap: 5px; }
  .filters a { padding: 6px 10px; font-size: 12px; }
  .gallery-status { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .gallery { padding-block: 33px 49px; }
  .device-section:not([hidden]) + .device-section:not([hidden]) { margin-top: 45px; }
  .device-heading { align-items: flex-start; gap: 8px; }
  .device-heading p { font-size: 14px; }
  .device-count { margin-top: 6px; }
  .cards, [data-device="mobile"] .cards { grid-template-columns: 1fr; }
  [data-device="mobile"] .card-image { aspect-ratio: 1.13; }
  .viewer-head, .viewer-meta { padding-inline: 10px; }
  .viewer-meta { align-items: flex-start; flex-direction: column; gap: 5px; }
  .viewer-meta p { font-size: 13px; }
  .viewer-image img { max-height: calc(100dvh - 240px); }
}
@media (max-width: 360px) {
  .filters a { padding-inline: 7px; gap: 3px; }
  .filters .device-icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .card:hover, .card-link:hover .card-image img, .card-link:focus-visible .card-image img { transform: none; }
}
