/* =========================================================
   Ms van den Boom — sewing portfolio
   Colours and fonts live in the variables below.
   ========================================================= */

:root {
  --bg: #fbfaf7;          /* warm off-white page */
  --cream: #f3eee4;       /* image backgrounds */
  --beige: #e8e0d0;
  --ink: #2a2926;         /* charcoal text */
  --ink-soft: #4a4842;
  --muted: #6c675e;       /* metadata text (passes AA on --bg) */
  --line: #e3ded4;        /* hairline dividers */
  --line-strong: #cfc8bb;
  --sage: #5d6a4b;        /* primary accent (white text on it passes AA) */
  --clay: #a5714f;
  --taupe: #9c9182;

  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "DM Sans", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 1320px;
  --ease: cubic-bezier(.2, .6, .2, 1);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}
html.viewer-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }

:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: var(--bg);
  padding: .6rem 1rem; font-size: .85rem; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

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

.section-label {
  margin: 0;
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  margin-bottom: 1.4rem;
}

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--line); }

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 2rem;
  padding-block: 1.1rem;
}

/* Logo: a woven sew-in label with zigzag-stitched ends */
.label-mark {
  display: inline-flex;
  align-items: stretch;
  align-self: center;
  background: #f4efe4;
  box-shadow: inset 0 0 0 1px rgba(42, 41, 38, .08);
  color: var(--ink);
  text-decoration: none;
}
.label-stitch {
  flex: none;
  width: 9px;
  height: auto;
  margin-inline: 3px;
}
.label-stitch path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.label-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .6rem .7rem .5rem;
  line-height: 1;
}
.label-name {
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.label-sub {
  margin-top: .4rem;
  font-size: .5rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nav ul {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  font-size: .75rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding-block: .3rem;
  border-bottom: 1px solid transparent;
  transition: border-color .2s, color .2s;
}
.nav a:hover { color: var(--ink); border-bottom-color: currentColor; }

/* ---------- Intro ---------- */

.intro {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 34rem);  /* square photo left, text beside it */
  justify-content: start;
  align-items: end;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding-block: clamp(1.75rem, 4vw, 3rem) clamp(1.75rem, 4vw, 2.75rem);
}
.intro-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;   /* square; change to e.g. 8 / 5 for a shorter, wider photo */
  object-fit: cover;
  object-position: center 30%;
  background: var(--beige);
}
.intro-title {
  margin: 0 0 .8rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  line-height: 1.1;
}
.intro-copy p {
  margin: 0;
  max-width: 35rem;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .intro { grid-template-columns: 92px minmax(0, 1fr); align-items: start; gap: 1.25rem; }
  .intro-copy p { font-size: .95rem; }
}

/* ---------- Makes: filters ---------- */

.makes { padding-bottom: clamp(3.5rem, 8vw, 6.5rem); }

.makes-count {
  margin: 0;
  font-size: .8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.filter {
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: .45rem .95rem;
  font-size: .8rem;
  letter-spacing: .03em;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.filter:hover { border-color: var(--ink-soft); color: var(--ink); }
.filter[aria-pressed="true"] {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
  font-weight: 500;
}
.filter-count {
  margin-left: .45em;
  font-size: .7rem;
  opacity: .7;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1);
    padding: 4px var(--gutter);
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: none; }
}

/* ---------- Makes: grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.25rem) clamp(1rem, 2.2vw, 1.75rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px)  { .grid { grid-template-columns: minmax(0, 1fr); } }

.make-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.make-link:focus-visible { outline-offset: 6px; }

.make-media {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--cream);
}
.make-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .9s var(--ease);
}
.make-link:hover .make-media img { transform: scale(1.025); }

.make-caption { display: block; padding-top: .85rem; }
.make-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.2;
}
.make-link:hover .make-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }


.makes-empty { margin: 1rem 0 0; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .make:not([hidden]) { animation: rise .45s var(--ease) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- About ---------- */

.about { padding-bottom: clamp(3.5rem, 8vw, 6rem); }
.about-inner {
  display: grid;
  grid-template-columns: minmax(130px, 220px) minmax(0, 38rem);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--beige); }
.about-copy p { margin: 0 0 1rem; color: var(--ink-soft); }
.about-copy .about-lede {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  line-height: 1.35;
  color: var(--ink);
}
@media (max-width: 640px) {
  .about-inner { grid-template-columns: minmax(0, 1fr); }
  .about-photo { max-width: 180px; }
}

/* ---------- Contact ---------- */

.contact { padding-bottom: clamp(3.5rem, 8vw, 6rem); }
.contact-list { margin: 0; max-width: 34rem; border-top: 1px solid var(--line); }
.contact-list div {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: .8rem;
  border-bottom: 1px solid var(--line);
}
.contact-list dt {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: .2rem;
}
.contact-list dd { margin: 0; overflow-wrap: anywhere; }
.contact-list a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.contact-list a:hover { border-bottom-color: var(--ink); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.75rem;
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--muted);
}
.footer-inner p { margin: 0; }
.footer-inner .footer-note {
  flex-basis: 100%;
  max-width: 44rem;
  letter-spacing: .02em;
  line-height: 1.6;
}

/* =========================================================
   Project viewer (dialog)
   ========================================================= */

.viewer {
  width: min(980px, calc(100% - 8rem));
  height: 88vh;
  height: min(88dvh, 1040px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: rgba(32, 30, 26, .55); }

@media (prefers-reduced-motion: no-preference) {
  .viewer[open] { animation: viewer-in .35s var(--ease); }
  .viewer[open]::backdrop { animation: fade-in .35s ease; }
  .gallery-main img.is-swapping { animation: fade-in .3s ease; }
}
@keyframes viewer-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* top bar */
.viewer-bar {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: .6rem clamp(.75rem, 2.5vw, 1.75rem);
  border-bottom: 1px solid var(--line);
}
.viewer-back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .25rem;
  border: 0;
  background: none;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
}
.viewer-back:hover { color: var(--ink); }
.viewer-context {
  display: flex;
  gap: .55rem;
  margin: 0;
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.viewer-filter { color: var(--ink); font-weight: 500; }
.viewer-controls { justify-self: end; display: flex; gap: .15rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  color: var(--ink);
  transition: border-color .2s;
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn:disabled { opacity: .3; cursor: default; border-color: transparent; }
.icon-btn svg { width: 20px; height: 20px; }

/* carousel filmstrip */
.filmstrip { flex: none; border-bottom: 1px solid var(--line); }
.strip {
  position: relative;
  display: flex;
  gap: .5rem;
  margin: 0;
  padding: .6rem clamp(.75rem, 2.5vw, 1.75rem);
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip li { flex: none; width: 44px; }
.strip li:first-child { margin-left: auto; }  /* centre when few items, scroll when many */
.strip li:last-child { margin-right: auto; }
.strip-item {
  display: block;
  width: 100%;
  padding: 2px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  opacity: .5;
  transition: opacity .2s, border-color .2s;
}
.strip-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--cream); }
.strip-item:hover { opacity: 1; }
.strip-item[aria-current="true"] { opacity: 1; border-color: var(--ink); }
.strip-item:focus-visible { outline-offset: 1px; }

@media (prefers-reduced-motion: no-preference) {
  .viewer-body.slide-next { animation: slide-from-right .4s var(--ease); }
  .viewer-body.slide-prev { animation: slide-from-left .4s var(--ease); }
  .viewer-body.slide-fade { animation: fade-in .3s ease; }
}
@keyframes slide-from-right { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes slide-from-left  { from { opacity: 0; transform: translateX(-32px); } to { opacity: 1; transform: none; } }

.viewer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.viewer-body {
  max-width: 1060px;
  margin-inline: auto;
  padding: clamp(1rem, 3vw, 2.25rem) clamp(1rem, 3.5vw, 2.75rem) 3.5rem;
}

/* gallery */
.gallery {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.gallery-main {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  height: 58vh;
  height: min(58dvh, 680px);
  background: var(--cream);
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }

.thumbs {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.thumb {
  display: block;
  width: 100%;
  padding: 2px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  opacity: .6;
  transition: opacity .2s, border-color .2s;
}
.thumb img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--cream); }
.thumb:hover { opacity: 1; }
.thumb[aria-current="true"] { opacity: 1; border-color: var(--ink); }

.gallery.is-single { grid-template-columns: minmax(0, 1fr); }
.gallery.is-single .gallery-main { grid-column: 1; }

/* title */
.viewer-head { margin-top: clamp(1.5rem, 3vw, 2.25rem); }
.viewer-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.05;
}
.viewer-description {
  margin: 1.25rem 0 0;
  max-width: 40rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.viewer-details {
  margin: 1.75rem 0 0;
  max-width: 40rem;
  border-top: 1px solid var(--line);
}
.detail {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--line);
}
.detail dt {
  padding-top: .2rem;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail dd { margin: 0; line-height: 1.5; color: var(--ink-soft); }
.detail dd a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.detail dd a:hover { color: var(--sage); }
.pattern-line { display: block; }
.pattern-note { color: var(--muted); }
.mod-list { margin: 0; padding: 0; list-style: none; }
.mod-list li + li { margin-top: .2rem; }
.skill-list { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.skill-list li {
  padding: .2rem .65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: .8rem;
}
@media (max-width: 720px) {
  .detail { grid-template-columns: minmax(0, 1fr); gap: .4rem; }
}

/* viewer: tablet & mobile */
@media (max-width: 1000px) {
  .viewer { width: calc(100% - 4rem); }
}
@media (max-width: 720px) {
  .viewer {
    width: 100%;
    height: 100%;
    margin: 0;
  }
  .viewer-bar { grid-template-columns: auto 1fr; }
  .viewer-back { display: none; }
  .viewer-context { justify-self: start; padding-left: .25rem; }

  .gallery { grid-template-columns: minmax(0, 1fr); }
  .gallery-main {
    grid-column: 1;
    height: auto;
    aspect-ratio: 4 / 5;
    max-height: 68vh;
    max-height: 68dvh;
  }
  .thumbs {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .thumbs::-webkit-scrollbar { display: none; }
  .thumbs li { flex: none; width: 58px; }
}
