/* L'atelier des Doud's — colors from the logo: sage, tan, charcoal on cream. */

@font-face {
  font-family: 'Bricolage';
  src: url('fonts/bricolage.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'Caveat';
  src: url('fonts/caveat.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --cream: #faf6ef;
  --paper: #fffdf9;
  --ink: #2b2a28;
  --ink-soft: #64605a;
  --line: #e8e1d4;
  --sage: #7c8b6f;
  --sage-deep: #56644b;
  --sage-tint: #e5eadd;
  --tan: #c99a5b;
  --tan-tint: #f3e5cf;
  --dark: #1c1b19;
  --gutter: 16px;
  --radius: 22px;
  --shadow: 0 1px 2px rgb(43 42 40 / 6%), 0 8px 24px -8px rgb(43 42 40 / 18%);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

/* Category accents */
.t-impression-3d, .cat-impression-3d, .chip-impression-3d { --accent: #6f8262; --accent-tint: #e3ead9; }
.t-cnc, .cat-cnc, .chip-cnc { --accent: #94613a; --accent-tint: #f1e2d3; }
.t-laser, .cat-laser, .chip-laser { --accent: #c9612f; --accent-tint: #f8e0d2; }
.t-epoxy, .cat-epoxy, .chip-epoxy { --accent: #2f7f86; --accent-tint: #d6ecec; }
.chip-tout { --accent: var(--ink); --accent-tint: var(--line); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; overflow-x: clip; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 16px/1.55 'Bricolage', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.lb-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -0.02em; font-weight: 760; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 3px solid var(--tan); outline-offset: 3px; border-radius: 8px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--cream); padding: 10px 16px; border-radius: 12px; text-decoration: none;
}
.skip:focus { top: 12px; }

.note {
  font-family: 'Caveat', cursive;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--tan);
  line-height: 1;
  margin: 0;
  transform: rotate(-3deg);
  display: inline-block;
}
.note.big { font-size: 2.2rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 2px solid var(--ink);
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-main { background: var(--ink); color: var(--cream); box-shadow: 4px 4px 0 var(--tan); }
.btn-main:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--tan); }
.btn-main:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tan); }
.btn-ghost { background: var(--paper); color: var(--ink); }
.btn-ghost:hover { background: var(--tan-tint); }
.btn-light { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.btn-light:hover { background: #fff; }
.btn-ghost-light { background: transparent; color: var(--cream); border-color: rgb(250 246 239 / 40%); }
.btn-ghost-light:hover { border-color: var(--cream); }
.btn-sm { min-height: 42px; padding: 0 16px; font-size: .95rem; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter);
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgb(250 246 239 / 82%);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.scrolled .top { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 760; letter-spacing: -0.01em; }
.brand img { width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); }
.brand em { font-family: 'Caveat', cursive; font-style: normal; font-size: 1.3em; font-weight: 600; color: var(--sage); }
.top-nav { display: flex; align-items: center; gap: 6px; }
.top-nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.top-nav a:not(.insta-btn) { display: none; }
.top-nav a:not(.insta-btn):hover { background: var(--tan-tint); }
.insta-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--sage); color: #fff; }
.insta-btn:hover { background: var(--sage-deep); }
.insta-btn svg { width: 18px; height: 18px; }
.insta-btn span { display: none; }
@media (min-width: 420px) { .insta-btn span { display: inline; } }
@media (min-width: 720px) { .top-nav a:not(.insta-btn) { display: inline-block; } }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid; gap: 8px; justify-items: center; text-align: center;
  padding: 20px var(--gutter) 48px;
  max-width: 1200px; margin: 0 auto;
  isolation: isolate;
  overflow-x: clip; /* the blobs stick out past the screen edges */
}
.hero-blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(50px); opacity: .9; }
.hero-blob.b1 { width: 60vw; max-width: 520px; aspect-ratio: 1; background: var(--sage-tint); top: 0; right: -10vw; }
.hero-blob.b2 { width: 50vw; max-width: 420px; aspect-ratio: 1; background: var(--tan-tint); bottom: 0; left: -12vw; }
.hero-logo { position: relative; order: -1; }
.hero-logo img {
  width: min(52vw, 210px); height: auto; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow);
  animation: float 7s ease-in-out infinite;
}
.hero-logo .note { position: absolute; right: -34px; bottom: -2px; transform: rotate(-12deg); font-size: 1.6rem; }
.kicker { margin: 8px 0 0; font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-deep); }
.hero h1 { font-size: clamp(2.05rem, 8.4vw, 4.1rem); margin-top: 6px; text-wrap: balance; }
.swoosh {
  background: linear-gradient(transparent 60%, var(--tan-tint) 60%, var(--tan-tint) 92%, transparent 92%);
  padding: 0 .08em;
}
.lede { max-width: 34em; margin: 16px auto 0; color: var(--ink-soft); font-size: 1.06rem; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
@media (max-width: 419px) { .cta .btn { width: 100%; } }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.25fr 1fr; text-align: left; justify-items: start; align-items: center; padding-top: 56px; padding-bottom: 80px; gap: 48px; }
  .hero-logo { order: 0; justify-self: center; }
  .hero-logo img { width: min(36vw, 420px); }
  .lede { margin-left: 0; }
  .cta { justify-content: flex-start; }
}
@keyframes float { 50% { transform: translateY(-8px) rotate(1.5deg); } }

/* ---------- sections ---------- */
.section { max-width: 1200px; margin: 0 auto; padding: 32px 0; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  padding: 0 var(--gutter); margin-bottom: 18px;
}
.section-head h2, .gallery-head h1 { text-wrap: balance; }
.section-head h2 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
.section-head p { margin: 0; color: var(--ink-soft); flex-basis: 100%; }
.more { font-weight: 650; text-decoration: none; color: var(--sage-deep); white-space: nowrap; }
.more:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- category cards ---------- */
.cats {
  list-style: none; margin: 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
@media (min-width: 900px) { .cats { grid-template-columns: repeat(4, 1fr); gap: 18px; } }
.cat {
  position: relative; display: flex; align-items: flex-end;
  aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: #fff;
  background: radial-gradient(circle at 70% 20%, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent));
  box-shadow: var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.cat::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--accent) 85%, #000) 0%, rgb(0 0 0 / 0%) 62%);
}
.cat:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 18px 40px -16px rgb(43 42 40 / 40%); }
.cat:hover .ph img { transform: scale(1.06); }
.cat-body { position: relative; z-index: 1; padding: 14px; width: 100%; }
.cat-icon {
  width: 38px; height: 38px; padding: 7px; border-radius: 12px;
  background: rgb(255 255 255 / 92%); color: var(--accent); margin-bottom: 10px;
}
.cat h3 { font-size: clamp(1.2rem, 4.6vw, 1.6rem); }
.cat-blurb { display: none; margin: 6px 0 0; font-size: .92rem; line-height: 1.4; opacity: .92; }
.cat-count {
  display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px;
  background: rgb(255 255 255 / 22%); font-size: .8rem; font-weight: 650;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
@media (min-width: 560px) { .cat-blurb { display: block; } .cat-body { padding: 18px; } }

/* ---------- photos ---------- */
.ph { position: relative; background: var(--c, var(--line)); aspect-ratio: var(--r, 1); overflow: hidden; }
.ph.fill { position: absolute; inset: 0; aspect-ratio: auto; }
.ph img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .5s ease, transform .6s var(--ease);
}
.ph img.loaded { opacity: 1; }

/* ---------- rails ---------- */
.rail-wrap { position: relative; }
.rail {
  list-style: none; margin: 0;
  display: flex; gap: 12px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  padding: 4px var(--gutter) 18px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > li { flex: 0 0 min(56vw, 250px); scroll-snap-align: start; }
.rail-big > li { flex-basis: min(80vw, 400px); }
.rail-btn {
  position: absolute; top: calc(50% - 30px); z-index: 2;
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  display: none; place-items: center; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .2s var(--ease), opacity .2s;
}
.rail-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rail-btn:hover { transform: scale(1.08); }
.rail-btn:disabled { opacity: 0; pointer-events: none; }
.rail-btn.prev { left: 10px; }
.rail-btn.next { right: 10px; }
@media (hover: hover) and (pointer: fine) { .rail-btn { display: grid; } }

.card { position: relative; display: block; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.card-rail {
  aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .35s var(--ease);
}
.card-rail::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgb(20 19 17 / 72%), rgb(0 0 0 / 0%) 50%); }
.card-rail:hover { transform: translateY(-4px); }
.card-rail:hover .ph img { transform: scale(1.05); }
.cap { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 14px; color: #fff; }
.cap h3 { font-size: 1.12rem; margin-top: 8px; }
.rail-big .cap h3 { font-size: 1.4rem; }
.count {
  position: absolute; z-index: 1; top: 10px; right: 10px;
  padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 650;
  background: rgb(20 19 17 / 55%); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-tint, var(--line)); color: var(--accent, var(--ink));
  font-size: .74rem; font-weight: 700; letter-spacing: .02em; text-decoration: none; white-space: nowrap;
}
.cap .tag { background: rgb(255 255 255 / 92%); }

/* ---------- empty / about / insta ---------- */
.soon { text-align: center; padding: 32px var(--gutter); }
.soon p:not(.note) { color: var(--ink-soft); margin: 14px 0 20px; }

.about { padding-left: var(--gutter); padding-right: var(--gutter); }
.about-card {
  display: grid; gap: 24px;
  background: var(--paper); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  padding: 26px 22px; box-shadow: var(--shadow);
}
.about-card h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 6px 0 12px; }
.about-card p:not(.note) { margin: 0 0 12px; color: var(--ink-soft); max-width: 36em; }
.skills { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-content: center; }
.skills li {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border-radius: 16px; background: var(--cream); font-weight: 650; font-size: .95rem; line-height: 1.25;
}
.skills svg { width: 30px; height: 30px; color: var(--sage-deep); }
@media (min-width: 900px) { .about-card { grid-template-columns: 1.3fr 1fr; padding: 44px; gap: 44px; } }

.insta-band {
  margin: 32px var(--gutter) 0; padding: 40px 22px;
  border-radius: calc(var(--radius) + 6px);
  background: var(--sage) radial-gradient(circle at 85% 10%, rgb(255 255 255 / 16%), transparent 45%);
  color: var(--cream); text-align: center;
}
.insta-band .note { color: var(--tan-tint); }
.insta-band h2 { font-size: clamp(1.6rem, 5vw, 2.4rem); margin: 8px 0 10px; }
.insta-band p:not(.note) { margin: 0 0 22px; opacity: .9; }
@media (min-width: 1264px) { .insta-band { max-width: 1200px; margin-left: auto; margin-right: auto; } }

.foot { display: grid; justify-items: center; gap: 10px; padding: 36px var(--gutter) max(36px, env(safe-area-inset-bottom)); color: var(--ink-soft); font-size: .88rem; text-align: center; }
.foot img { border-radius: 50%; background: #fff; }
.foot p { margin: 0; }

/* ---------- gallery ---------- */
.gallery-head { max-width: 1200px; margin: 0 auto; padding: 16px var(--gutter) 18px; }
.back { display: inline-block; margin-bottom: 10px; padding: 6px 12px 6px 0; font-weight: 650; text-decoration: none; color: var(--sage-deep); }
.back:hover { text-decoration: underline; text-underline-offset: 4px; }
.gallery-head h1 { font-size: clamp(2rem, 7vw, 3.2rem); }
.gallery-sub { margin: 8px 0 0; color: var(--ink-soft); }
.chips {
  display: flex; gap: 8px; margin: 18px calc(-1 * var(--gutter)) 0; padding: 2px var(--gutter) 6px;
  overflow-x: auto; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--paper);
  font-weight: 650; text-decoration: none; transition: border-color .2s, background .2s;
}
.chip small { font-size: .78rem; color: var(--ink-soft); font-weight: 600; }
.chip:hover { border-color: var(--accent); }
.chip[aria-current='page'] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip[aria-current='page'] small { color: rgb(255 255 255 / 80%); }

.masonry { display: flex; gap: 12px; align-items: flex-start; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter) 24px; }
.masonry .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 900px) { .masonry, .masonry .col { gap: 18px; } }
.card-grid {
  border-radius: 18px; overflow: hidden; background: var(--paper); box-shadow: var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card-grid:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 16px 34px -14px rgb(43 42 40 / 35%); }
.card-grid:hover .ph img { transform: scale(1.04); }
.cap-below { padding: 10px 12px 12px; }
.cap-below h3 { font-size: .98rem; font-weight: 680; letter-spacing: -0.01em; margin-bottom: 6px; line-height: 1.25; }
.empty { text-align: center; color: var(--ink-soft); padding: 40px var(--gutter); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-rows: auto 1fr auto auto;
  background: var(--dark); color: var(--cream);
  opacity: 0; transition: opacity .25s ease;
}
.lightbox.show { opacity: 1; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; padding: max(10px, env(safe-area-inset-top)) 12px 6px 18px; }
.lb-count { font-size: .9rem; font-variant-numeric: tabular-nums; opacity: .75; }
.lb-btn {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: rgb(255 255 255 / 10%); color: var(--cream); cursor: pointer;
  transition: background .2s, opacity .2s;
}
.lb-btn:hover { background: rgb(255 255 255 / 20%); }
.lb-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lb-btn:disabled { opacity: 0; pointer-events: none; }
.lb-stage { position: relative; min-height: 0; }
.lb-track {
  list-style: none; margin: 0; padding: 0; height: 100%;
  display: flex; overflow-x: auto; overscroll-behavior: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-track > li {
  position: relative; flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always;
  display: grid; place-items: center; padding: 4px 0; container-type: size;
}
/* The box has the photo's own ratio, as large as the stage allows (so the open/close morph fits). */
.lb-photo { width: min(100cqw, calc(100cqh * var(--rw, 1))); max-height: 100cqh; border-radius: 6px; }
.lb-photo img { object-fit: contain; }
.lb-arrow { position: absolute; top: calc(50% - 23px); z-index: 1; display: none; }
.lb-arrow.prev { left: 14px; }
.lb-arrow.next { right: 14px; }
@media (hover: hover) and (pointer: fine) { .lb-arrow { display: grid; } }
.single .lb-arrow { display: none; }
.lb-dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 2px; }
.lb-dots span { width: 7px; height: 7px; border-radius: 99px; background: rgb(255 255 255 / 30%); transition: width .25s var(--ease), background .25s; }
.lb-dots span.on { width: 20px; background: var(--tan); }
.lb-info {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px;
  width: 100%; max-width: 1000px; margin: 0 auto;
  padding: 12px 18px max(18px, env(safe-area-inset-bottom));
}
.lb-text { min-width: 0; flex: 1 1 320px; }
.lb-info h2 { font-size: clamp(1.35rem, 4.5vw, 1.9rem); margin-top: 8px; }
.lb-desc { margin: 8px 0 0; opacity: .85; max-width: 40em; max-height: 6.2em; overflow-y: auto; }
.lb-meta { margin: 6px 0 0; font-size: .85rem; opacity: .6; }
.lb-meta:empty { display: none; }
.lb-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- page transitions (see navigate() in app.js) ---------- */
::view-transition-group(*) { animation-duration: .4s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
/* A plain crossfade: the header is the same in both pages, so it stays still (a slide would move it). */
/* The old page stays opaque under the new one: fading both would flash the background through. */
html[data-vt='page']::view-transition-old(root) { animation: none; }
html[data-vt='page']::view-transition-new(root) { animation: vt-in .26s ease both; }
html[data-vt='open']::view-transition-old(root),
html[data-vt='close']::view-transition-old(root),
html[data-vt='open']::view-transition-new(root),
html[data-vt='close']::view-transition-new(root) { animation-duration: .3s; }
/* The card crops its photo, the viewer does not: cover both snapshots so nothing stretches. */
::view-transition-old(photo), ::view-transition-new(photo) { width: 100%; height: 100%; object-fit: cover; }
::view-transition-group(photo) { animation-duration: .45s; overflow: clip; border-radius: 12px; }
@keyframes vt-in { from { opacity: 0; } }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.rail > li.reveal:nth-child(2) { transition-delay: .06s; }
.rail > li.reveal:nth-child(3) { transition-delay: .12s; }
.cats > li.reveal:nth-child(2) { transition-delay: .06s; }
.cats > li.reveal:nth-child(3) { transition-delay: .12s; }
.cats > li.reveal:nth-child(4) { transition-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
