/* j4m5.com: company + portfolio pages, on the J4M5 Design System v1.0 (ds/j4m5.css).
   Matte riso prints for content, acrylic glass for the floating nav. Minerals everywhere, sapphire as the one gem. */
*, *::before, *::after { box-sizing: border-box; }
/* the paper and its grain live on the root, so they cover the whole page, including above the floating nav */
html { background-color: var(--background); background-image: var(--grain); background-size: 200px 200px; -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body.site {
  margin: 0; min-height: 100dvh; overflow-x: hidden;
  background: transparent;
  color: var(--foreground); font: 400 16px/26px var(--font-sans); -webkit-font-smoothing: antialiased;
}
.site a { color: var(--primary); text-underline-offset: 3px; }
.site a:focus-visible, .site button:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.eyebrow { display: block; font-family: var(--font-slab); font-weight: 600; font-size: 13px; line-height: 18px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground); }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; font-variation-settings: "SOFT" 100, "WONK" 0; text-wrap: balance; }
.lead { font-size: 18px; line-height: 29px; color: var(--muted-foreground); max-width: 62ch; text-wrap: pretty; }

/* ---------- top nav: an acrylic pill ---------- */
.topnav { position: sticky; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 20; margin: calc(10px + env(safe-area-inset-top, 0px)) auto 0; width: min(1120px, 100% - 24px);
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; border-radius: var(--shape-pill); }
.topnav .brand { display: flex; align-items: center; margin-right: auto; border-radius: 8px; }
.topnav .brand img { display: block; height: 34px; width: auto; }
.topnav nav { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.topnav nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 13px; border-radius: var(--shape-pill); color: var(--foreground); text-decoration: none; font-weight: 600; font-size: 15px; }
.topnav nav a:hover { background-color: var(--accent); color: var(--accent-foreground); }
.topnav nav a[aria-current="page"] { background-color: var(--accent); color: var(--accent-foreground); }
@media (max-width: 520px) { .topnav { padding-left: 10px; } .topnav .brand img { height: 28px; } .topnav nav a { padding: 0 9px; font-size: 14px; } .topnav .hide-sm { display: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 22px; border-radius: var(--shape-pill);
  border: 1px solid var(--border); background-color: var(--secondary); color: var(--foreground) !important; font-weight: 650; font-size: 16px; text-decoration: none;
  transition: background-color .15s, transform .15s, box-shadow .15s; }
.btn:hover { background-color: var(--accent); color: var(--accent-foreground) !important; }
.btn.primary { background-color: var(--primary); border-color: transparent; color: var(--primary-foreground) !important; box-shadow: 2px 3px 0 var(--overprint); }
.btn.primary:hover { background-color: color-mix(in oklch, var(--primary) 88%, var(--foreground)); }
.btn.primary:active { transform: translate(2px, 3px); box-shadow: 0 0 0 var(--overprint); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 24px; position: relative; }
.hero h1, .hero .h1 { margin: 10px 0 16px; font-size: clamp(38px, 7vw, 68px); line-height: 1.02; text-shadow: .045em .04em 0 var(--overprint); }
.hero .lead { margin: 0 0 26px; }

/* ---------- printed cards (riso-print without overflow:hidden) ---------- */
.card { position: relative; isolation: isolate; border-radius: var(--shape-card); color: var(--card-foreground); }
.card::before { content: ""; position: absolute; inset: 0; z-index: -2; border-radius: inherit; pointer-events: none;
  background-image: radial-gradient(circle, var(--overprint) 42%, transparent 46%); background-size: var(--halftone-size) var(--halftone-size);
  transform: translate(var(--offset-x), var(--offset-y)); transition: transform .2s ease; }
.card::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background-image: var(--grain), linear-gradient(var(--surface, var(--card)), var(--surface, var(--card))); background-size: 200px 200px, auto; }

/* ---------- work grid ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.section-head h2 { margin: 6px 0 0; font-size: clamp(30px, 4.5vw, 40px); line-height: 1.1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 30px 28px; padding-right: 8px; }
.work-card { display: flex; flex-direction: column; text-decoration: none; color: inherit !important; padding: 12px 12px 18px; transition: transform .2s ease; }
.work-card:hover { transform: translate(-2px, -2px); }
.work-card:hover::before { transform: translate(calc(var(--offset-x) + 3px), calc(var(--offset-y) + 3px)); }
.work-card:nth-child(3n+2) { --surface: var(--mineral-sand-100); }
.work-card:nth-child(3n+3) { --surface: var(--mineral-fog-100); }
.work-card .shot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-radius: var(--shape-tile); box-shadow: 0 0 0 1px var(--border); background: var(--muted); }
.work-card .icon-shot { display: grid; place-items: center; aspect-ratio: 16 / 8; border-radius: var(--shape-tile); background-color: var(--muted); box-shadow: 0 0 0 1px var(--border); }
.work-card .icon-shot img { width: 30%; height: auto; border-radius: var(--shape-tile); box-shadow: 0 0 0 1px var(--border), 3px 4px 0 var(--overprint); }
.work-card .body { padding: 14px 6px 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.work-card h3 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 750; }
.work-card p { margin: 0; color: var(--muted-foreground); font-size: 15px; line-height: 1.5; }
.work-card .meta { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: var(--shape-pill); font-size: 12.5px; font-weight: 600; color: var(--muted-foreground);
  background-color: var(--background); box-shadow: inset 0 0 0 1px var(--border); }
.tag.gem { background-color: var(--accent); color: var(--accent-foreground); box-shadow: none; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; padding: 0; list-style: none; }
.filters button { appearance: none; border: 1px solid var(--border); background-color: var(--card); color: var(--muted-foreground); font: 600 15px/1 var(--font-sans);
  min-height: 40px; padding: 0 16px; border-radius: var(--shape-pill); cursor: pointer; }
.filters button:hover { color: var(--foreground); }
.filters button[aria-pressed="true"] { background-color: var(--accent); color: var(--accent-foreground); border-color: color-mix(in oklch, var(--primary) 35%, transparent); box-shadow: 1px 2px 0 var(--overprint); }
.work-card[hidden] { display: none; }

/* ---------- case study ---------- */
.case-hero { padding: 48px 0 12px; }
.case-hero h1 { margin: 10px 0 14px; font-size: clamp(36px, 6.5vw, 60px); line-height: 1.04; text-shadow: .045em .04em 0 var(--overprint); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin: 26px 0 8px; padding: 0; list-style: none; }
.facts li { padding: 14px 16px; border-radius: var(--shape-tile); background-image: var(--grain), linear-gradient(var(--card), var(--card)); background-size: 200px 200px, auto; box-shadow: inset 0 0 0 1px var(--border); }
.facts b { display: block; font-size: 15px; } .facts span { color: var(--muted-foreground); font-size: 14px; line-height: 1.45; display: block; margin-top: 2px; }
.lead-shot { margin: 30px 0 10px; padding: 12px; }
.lead-shot img, .gallery img { display: block; width: 100%; height: auto; border-radius: var(--shape-tile); box-shadow: 0 0 0 1px var(--border); }
.prose { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding: 30px 0 10px; }
@media (max-width: 860px) { .prose { grid-template-columns: 1fr; gap: 10px; } }
.prose h2 { font-size: 26px; line-height: 1.25; margin: 28px 0 8px; font-weight: 750; letter-spacing: -.01em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { font-size: 17px; line-height: 1.65; max-width: 66ch; }
.prose ul, .prose ol { padding-left: 22px; } .prose li { margin: 0 0 6px; } .prose li::marker { color: var(--primary); }
.side { align-self: start; position: sticky; top: 96px; display: grid; gap: 14px; }
.side .panel { padding: 16px 18px; border-radius: var(--shape-tile); background-image: var(--grain), linear-gradient(var(--card), var(--card)); background-size: 200px 200px, auto; box-shadow: inset 0 0 0 1px var(--border); }
.side .panel h3 { margin: 0 0 8px; }
.side .panel p, .side .panel li { font-size: 15px; line-height: 1.5; margin: 0; }
.side .panel ul { margin: 0; padding-left: 18px; }
.side .tags { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 860px) { .side { position: static; } }
.gallery { display: grid; gap: 34px; margin: 20px 0 10px; padding: 0 8px 0 0; }
.gallery figure { margin: 0; padding: 12px 12px 14px; }
.gallery figcaption { padding: 12px 6px 0; font-size: 15px; line-height: 1.5; color: var(--muted-foreground); }
.gallery figcaption b { color: var(--foreground); }
.mock-note { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 0; padding: 12px 16px; border-radius: var(--shape-tile); background-color: var(--accent); color: var(--accent-foreground); font-size: 15px; line-height: 1.5; max-width: 760px; }
.next { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; margin: 10px 0 0; }
.next a { display: block; padding: 16px 18px; border-radius: var(--shape-tile); text-decoration: none; color: var(--foreground) !important; background-image: var(--grain), linear-gradient(var(--card), var(--card)); background-size: 200px 200px, auto; box-shadow: inset 0 0 0 1px var(--border); }
.next a:hover { background-image: var(--grain), linear-gradient(var(--accent), var(--accent)); }
.next small { display: block; color: var(--muted-foreground); }
.next b { font-size: 18px; }

/* ---------- about ---------- */
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 26px 24px; margin: 0; padding: 0 8px 0 0; list-style: none; }
.steps li { padding: 20px 20px 18px; }
.steps li::marker { content: none; }
.steps .n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--shape-pebble); background-color: var(--accent); color: var(--accent-foreground); font-weight: 800; margin-bottom: 10px; }
.steps h3 { margin: 0 0 6px; font-size: 19px; } .steps p { margin: 0; color: var(--muted-foreground); font-size: 15.5px; line-height: 1.55; }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 36px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.contact-card { padding: 24px; }
.contact-card h2 { margin: 6px 0 8px; font-size: 30px; line-height: 1.15; }

/* ---------- footer ---------- */
.foot { text-align: center; padding: 40px 16px calc(28px + env(safe-area-inset-bottom, 0px)); font-size: 13px; line-height: 1.6; color: var(--muted-foreground); }
.foot nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.foot .heart { color: #ff6699; } /* the one brand-color exception, as requested */
@media (prefers-reduced-motion: reduce) { .work-card, .card::before, .btn { transition: none !important; } .work-card:hover { transform: none; } }

/* ---------- résumé ---------- */
.cv { list-style: none; margin: 0; padding: 0 8px 0 0; display: grid; gap: 26px; }
.cv-item { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 8px 24px; padding: 20px 22px 18px; }
@media (max-width: 720px) { .cv-item { grid-template-columns: 1fr; } }
.cv-when { font-family: var(--font-slab); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground); padding-top: 4px; }
.cv-body h3 { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 750; }
.cv-org { margin: 2px 0 0; color: var(--primary); font-weight: 600; font-size: 15px; }
.cv-body ul { margin: 10px 0 0; padding-left: 20px; } .cv-body li { margin: 0 0 6px; font-size: 15.5px; line-height: 1.55; } .cv-body li::marker { color: var(--primary); }
.cv-skill { margin: 0 0 16px; } .cv-skill .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cv-indie a span { display: block; margin-top: 4px; font-size: 14.5px; line-height: 1.45; color: var(--muted-foreground); }
.more-link { font-weight: 650; text-decoration: none; } .more-link:hover { text-decoration: underline; }

/* ---------- About: two views ---------- */
.about-tabs { display: inline-flex; gap: 4px; margin: 34px 0 0; padding: 5px; border-radius: var(--shape-pill); background-color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); max-width: 100%; }
.about-tabs button { appearance: none; border: 0; background: transparent; color: var(--muted-foreground); font: 650 15px/1 var(--font-sans); min-height: 42px; padding: 0 18px; border-radius: var(--shape-pill); cursor: pointer; white-space: nowrap; }
.about-tabs button:hover { color: var(--foreground); }
.about-tabs button[aria-selected="true"] { background-image: var(--grain), linear-gradient(var(--card), var(--card)); background-size: 200px 200px, auto; color: var(--foreground); box-shadow: inset 0 0 0 1px var(--border), 1px 2px 0 var(--overprint); }
.about-tabs button:focus-visible { outline: none; box-shadow: var(--focus); }
html:not(.js-tabs) .about-tabs { display: none; }
.panel-view .hero { padding-top: 26px; }
@media (max-width: 420px) { .about-tabs button { padding: 0 12px; font-size: 14px; } }
