/* Titles: the Levilingerak font. */
@font-face {
  font-family: "Levilingerak";
  src: url("Fonts/Levilingerak/Levilingerak.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* All other text: Jost (one variable file covers every weight, 100-900). */
@font-face {
  font-family: "Jost";
  src: url("Fonts/Jost/Jost-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Jost";
  src: url("Fonts/Jost/Jost-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* Colours taken from the work itself: cotton, walnut, beech/cognac rope and denim. */
:root {
  --paper: #f7f4ef;
  --ink: #1f1813;
  --walnut: #5e3420;
  --cognac: #b4602c;
  --denim: #2f5d93;
  --line: rgba(31, 24, 19, 0.2);
  /* A running stitch, like the thread circle on the logo patch. */
  --stitch: repeating-linear-gradient(90deg, currentColor 0 7px, transparent 7px 12px);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Jost", "Avenir Next", "Segoe UI", Arial, sans-serif;
  margin: 0;
  font-weight: 300;   /* light Jost for a slimmer, cleaner look */
}

/* Lively background: soft, blurred blobs in the six material colours that slowly drift
   and change shape... */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: var(--w, 38vmax);
  height: var(--h, 32vmax);
  left: var(--x);
  top: var(--y);
  background: var(--c);
  opacity: var(--o, 0.3);
  border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%;
  filter: blur(70px);
  will-change: transform, translate;
  transition: translate 900ms cubic-bezier(0.22, 1, 0.36, 1);  /* glides after the scroll */
  animation:
    blob-drift var(--speed, 46s) ease-in-out var(--delay, 0s) infinite alternate,
    blob-morph 17s ease-in-out var(--delay, 0s) infinite alternate;
}

/* Brighter, lighter versions of the material colours, so the mix stays colourful, not muddy. */
.blob-woodwork  { --c: #d0844a; --x: -8vmax;  --y: -6vmax;  --w: 40vmax; --h: 34vmax; --o: 0.26; --speed: 52s; }
.blob-textile   { --c: #3d82d6; --x: 62%;     --y: -10vmax; --w: 46vmax; --h: 40vmax; --o: 0.36; --speed: 47s; --delay: -12s; }
.blob-metal     { --c: #9fb0c2; --x: 70%;     --y: 48%;     --w: 34vmax; --h: 30vmax; --o: 0.3;  --speed: 58s; --delay: -30s; }
.blob-stoneware { --c: #6dbb5e; --x: -6vmax;  --y: 58%;     --w: 40vmax; --h: 36vmax; --o: 0.34; --speed: 44s; --delay: -20s; }
.blob-plastics  { --c: #f7c935; --x: 34%;     --y: 30%;     --w: 34vmax; --h: 28vmax; --o: 0.34; --speed: 50s; --delay: -6s; }
.blob-other     { --c: #ee5a48; --x: 40%;     --y: 78%;     --w: 32vmax; --h: 26vmax; --o: 0.26; --speed: 55s; --delay: -38s; }

@keyframes blob-drift {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  33%  { transform: translate(9vmax, 6vmax) rotate(40deg) scale(1.12); }
  66%  { transform: translate(-6vmax, 11vmax) rotate(-25deg) scale(0.92); }
  100% { transform: translate(5vmax, -7vmax) rotate(15deg) scale(1.06); }
}

@keyframes blob-morph {
  0%   { border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%; }
  50%  { border-radius: 63% 37% 41% 59% / 58% 62% 38% 42%; }
  100% { border-radius: 35% 65% 52% 48% / 38% 55% 45% 62%; }
}

/* ...under a fine cotton-paper grain. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

@media (prefers-reduced-motion: reduce) {
  .blob,
  .project:hover .project-image,
  .home-project:hover .project-image {
    animation: none;
  }
}

button,
a {
  color: inherit;
}

/* Header + material menu: stay at the top, on frosted glass so the colours still show through. */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
}

/* The frosted glass sits behind the header and runs on a little below it, fading out there,
   so there is no hard line between the header and the page. */
.top-bar::before {
  content: "";
  position: absolute;
  inset: 0 0 -36px 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(247, 244, 239, 0.38);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
}

.site-header {
  position: relative;
  z-index: 20;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4vw;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  display: block;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 3px 4px rgba(31, 24, 19, 0.18));
  transition: transform 350ms cubic-bezier(0.34, 1.4, 0.64, 1);
}


.brand:hover img {
  transform: scale(1.08);   /* grows slightly */
}

.main-nav {
  display: flex;
  gap: clamp(20px, 4vw, 64px);
  margin-left: auto;
  margin-right: clamp(20px, 4vw, 64px);
}

.nav-link,
.category,
.text-link {
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.nav-link {
  position: relative;
  padding: 38px 0 35px;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  top: calc(50% + 0.95em);   /* just under the word, whatever the padding around it */
  height: 1px;
  color: var(--ink);
  background: currentColor;
  transition: right 220ms ease;
}

.instagram-button {
  display: grid;
  place-items: center;
  align-self: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border: 2px dashed var(--denim);
  border-radius: 50%;
  color: var(--denim);
  transition: background 180ms ease, color 180ms ease, transform 350ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

.instagram-button:hover,
.instagram-button:focus-visible {
  background: var(--denim);
  color: var(--paper);
  transform: scale(1.08);
}

.nav-link.active::after {
  right: 0;
}

main {
  min-height: calc(100vh - 164px);
}

.page {
  display: none;
  min-height: calc(100vh - 164px);
  margin: 0 4vw;
}

.page.active {
  display: block;
}

.eyebrow {
  font-size: 0.72rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.home-copy {
  position: relative;
  z-index: 2;
  padding: calc(4vh + 34px) 0 7vh;   /* 34px: clears the soft fade under the header */
}

h1,
h2 {
  font-family: "Levilingerak", "Arial Black", sans-serif;
  font-weight: normal;
  margin: 0;
  letter-spacing: -0.055em;
}

h1 {
  font-size: clamp(2.9rem, 11.5vw, 10.5rem);
  white-space: nowrap;
  line-height: 0.85;
  /* The box is stretched over the tall letters and the tail of the g (padding), without moving
     anything (negative margin), so the fade-out covers every part of every letter. */
  padding: 0.2em 0 0.32em;
  margin: 0.02em 0 -0.2em;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* "Designer & maker · Eindhoven, NL", right under the name. */
.home-subtitle {
  margin: 0 0 clamp(26px, 4vw, 48px);
  font-family: "Jost", "Segoe UI", Arial, sans-serif;
  font-size: 0.74rem;            /* same as the Home / Shop / Info / Contact menu */
  font-weight: 300;
  letter-spacing: 0.03em;
}

.intro {
  max-width: 390px;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.35;
}

.text-link {
  margin-top: 28px;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--ink);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.text-link span {
  display: inline-block;
  margin-left: 18px;
}


.portfolio-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 64px 0 38px;
}

.portfolio-heading h2,
#info h2 {
  font-size: clamp(4.2rem, 9vw, 8.5rem);
  line-height: 0.84;
  margin-top: 0.42em;   /* the title font reaches above its line, so the gap grows with the size */
}

.project-count {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ---- Material menu under the header, each in its own colour ---- */
.category-nav {
  position: relative;
  z-index: 19;
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  margin: 0 4vw;
}

.category-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 0 10px;
  font-family: "Levilingerak", sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: color 180ms ease;
}

/* A little spool of thread in the material's colour. */
.category-link::before {
  content: "";
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  position: relative;
  top: -0.16em;   /* centres the dot on the capital letters of the title font */
  border-radius: 50%;
  background: var(--project-color);
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 3px;
  border-radius: 3px;
  color: var(--project-color);
  background: currentColor;
  transition: right 220ms ease;
}

.category-link:hover,
.category-link.active {
  color: var(--project-ink);
}

.category-link:hover::before {
  transform: scale(1.25);
}

.category-link:hover::after,
.category-link.active::after {
  right: 0;
}

/* Category page and project page take on the material's colour. */
#category .eyebrow,
#category h2,
#project .eyebrow,
#project .back-link,
#project .detail-facts dt,
#project .detail-facts a {
  color: var(--project-ink, var(--cognac));
}

#category .portfolio-heading {
  position: relative;
  margin-bottom: 38px;
}

#category .portfolio-heading::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  color: var(--project-color);
  background: var(--stitch);
}

.category-empty {
  padding: 40px 0 120px;
  opacity: 0.6;
}

/* Every project card carries its first material's colour. */
.project-meta span {
  color: var(--project-ink, inherit);
}

.home-project:hover h3,
.project:hover h3 {
  color: var(--project-ink, var(--cognac));
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 30px;
  padding: 30px 0 100px;
}

@media (max-width: 1000px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Material pages: square pictures that fill the square, the name underneath
   and the date standing upright along the right edge of the picture. */
.project-grid .project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: start;
}

.project .project-image {
  grid-column: 1;
  grid-row: 1;
  aspect-ratio: 1;
}

.project .project-image img {
  object-fit: cover;
}

.project .project-meta {
  display: contents;
}

.project .project-meta h3 {
  grid-column: 1;
  grid-row: 2;
  padding-top: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project .project-meta span {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  margin: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);   /* reads from bottom to top */
  white-space: nowrap;
}

.project.hidden {
  display: none;
}

.project,
.home-project {
  display: block;
  text-decoration: none;
}

.project-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #fff;
}

.project-image.is-empty {
  background: #ded8cb;
}

/* Pictures always fill their frame: cropped to the frame's proportions, never with white bars. */
.project-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Natural hover movement: the card lifts with a little spring, the square
   straightens out and keeps swaying gently, like fabric hanging from a pin. ---- */
.project,
.home-project {
  transform: rotate(var(--tilt, 0deg));
  transition: transform 650ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project .project-image,
.home-project .project-image {
  box-shadow: 0 2px 6px rgba(31, 24, 19, 0.08);
  transition: box-shadow 450ms ease;
}

.project:hover,
.home-project:hover,
.project:focus-visible,
.home-project:focus-visible {
  transform: translateY(-8px) rotate(0deg);
}

.project:hover .project-image,
.home-project:hover .project-image,
.project:focus-visible .project-image,
.home-project:focus-visible .project-image {
  box-shadow: 0 22px 40px -12px rgba(31, 24, 19, 0.35);
  animation: sway 3.2s ease-in-out infinite;
  animation-delay: var(--sway-delay, 0s);
}

@keyframes sway {
  0%, 100% { transform: rotate(0deg) translate(0, 0); }
  25% { transform: rotate(1.1deg) translate(1px, -3px); }
  50% { transform: rotate(-0.4deg) translate(0, -5px); }
  75% { transform: rotate(-1deg) translate(-1px, -2px); }
}

/* Name left, date right. */
.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-top: 12px;
}

.project-meta span {
  flex-shrink: 0;
  white-space: nowrap;
}

.project-meta h3 {
  margin: 0;
  white-space: nowrap;
  font-family: "Levilingerak", sans-serif;
  font-size: 1.5rem;
  font-weight: normal;
}

.project-meta span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- Home: a trail like on a map, from the oldest project (bottom) up to the newest (top).
   Positions and the path are calculated in the script (layoutHome). ---- */
.home-projects {
  position: relative;
  margin: 10px 0 80px;
  min-height: 400px;
}

.home-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* The route: pieces of line from picture to picture. */
.home-path-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hover: a solid line in the project's colour is drawn around the picture. */
.stitch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
  transition: opacity 300ms ease;
}

.stitch.is-leaving {
  opacity: 0;
}

.stitch-thread {
  fill: none;
  stroke: var(--project-color, var(--denim));
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-path-stop {
  fill: var(--ink);
}

.home-path-stop.is-end {
  fill: var(--ink);
}

.path-label {
  position: absolute;
  margin: 0;
  transform: translateX(-50%);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  white-space: nowrap;
  color: var(--ink);
}

.home-project {
  position: absolute;
  z-index: 1;
}

.home-project .project-image {
  aspect-ratio: 1;
}

.home-project .project-image img {
  object-fit: cover;
}

/* Name and date scale with the square, so they also fit under very small ones. */
.home-project {
  container-type: inline-size;
}

.home-project .project-meta {
  padding-top: clamp(5px, 4cqi, 12px);
  gap: 2px 8px;
}

.home-project .project-meta h3 {
  font-size: clamp(0.72rem, 9cqi, 1.35rem);
  white-space: normal;
  line-height: 1.05;
}

.home-project .project-meta span {
  font-size: clamp(0.5rem, 5cqi, 0.68rem);
}


/* ---- Project detail page ---- */
.back-link {
  display: inline-block;
  margin-top: 40px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.back-link:hover {
  color: var(--cognac);
}

.detail-heading {
  padding: 40px 0 36px;
}

.detail-heading h2 {
  font-size: clamp(4.2rem, 9vw, 8.5rem);
  line-height: 0.84;
  margin-top: 0.42em;
}

.detail-intro {
  max-width: 560px;
  margin: 28px 0 0;
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  line-height: 1.4;
}

.detail-intro:empty {
  display: none;
}

/* Story on the left, project facts (materials, location, ...) on the right. */
.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px 6%;
  padding-bottom: 44px;
}

.detail-text p {
  max-width: 680px;
  margin: 0 0 1em;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.55;
}

.detail-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  align-content: start;
  margin: 0;
  padding-top: 14px;
  border-top: 1.5px dashed var(--line);
  font-size: 0.85rem;
  line-height: 1.4;
}

.detail-facts:empty {
  display: none;
}

.detail-facts dt {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
  padding-top: 2px;
}

.detail-facts dd {
  margin: 0;
}

.detail-facts a {
  color: var(--denim);
  text-decoration: none;
}

.info-bio {
  grid-column: 1 / -1;
  columns: 2;
  column-gap: 36px;
}

.info-bio p {
  margin: 0 0 1em;
  break-inside: avoid;
}

.info-education {
  grid-column: 1 / -1;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-top: 30px;
  border-top: 1.5px dashed var(--line);
}

.detail-gallery figure {
  margin: 0;
  background: transparent;
}

.detail-gallery figure.is-wide {
  grid-column: 1 / -1;
}

.detail-gallery img,
.detail-gallery video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-gallery figure:not(.is-wide) {
  aspect-ratio: 4 / 5;
}

.detail-gallery .is-cover img {
  height: min(85vh, 66vw);   /* a wide frame; the photo is cropped to fill it */
  object-fit: cover;
}

.detail-gallery video {
  max-height: 85vh;
  background: var(--ink);
  object-fit: contain;
}

.detail-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 60px;
  padding: 22px 0 90px;
  border-top: 1px solid var(--line);
  font-family: "Levilingerak", sans-serif;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
}

.detail-nav a {
  text-decoration: none;
}

.detail-nav a:hover {
  color: var(--cognac);
}


.info-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  column-gap: 5%;
  padding: 100px 0;
}

#info h2 {
  grid-column: 1 / -1;
  max-width: 1000px;
  margin: 48px 0 90px;
}

.info-layout > .eyebrow {
  grid-column: 1 / -1;
}

.info-copy {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px;
}

.info-copy p {
  margin: 0;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.55;
}

.contact {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-top: 50px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact a {
  text-decoration: none;
  justify-self: end;
}

.contact a:last-child {
  color: var(--denim);
}

/* ---- Contact page ---- */
.contact-page {
  padding: 64px 0 120px;
  max-width: 900px;
}

.contact-page h2 {
  font-size: clamp(4.2rem, 9vw, 8.5rem);
  line-height: 0.84;
  margin-top: 0.42em;
}

.contact-intro {
  max-width: 560px;
  margin: 34px 0 44px;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.45;
}

.contact-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 18px 40px;
  margin: 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.contact-list dt {
  padding-top: 0.5em;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.6;
}

.contact-list dd {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
}

.contact-intro a,
.contact-list a {
  color: var(--denim);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size 250ms ease;
}

.contact-intro a:hover,
.contact-intro a:focus-visible,
.contact-list a:hover,
.contact-list a:focus-visible {
  background-size: 100% 2px;
}

@media (max-width: 520px) {
  .contact-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .contact-list dd {
    margin-bottom: 14px;
    overflow-wrap: anywhere;
  }
}

footer {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4vw;
  border-top: 1px solid var(--line);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

@media (max-width: 800px) {
  .site-header {
    height: 82px;
  }

  .main-nav {
    gap: 18px;
  }

  .nav-link {
    padding: 29px 0 27px;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 18px;
  }

  .detail-body {
    grid-template-columns: 1fr;
  }

  .info-bio {
    columns: 1;
  }

  .portfolio-heading {
    padding-top: 50px;
  }

  .category-bar {
    gap: 22px;
  }

  .info-layout {
    display: block;
    padding: 70px 0;
  }

  #info h2 {
    margin: 38px 0 60px;
  }

  .info-copy {
    grid-template-columns: 1fr;
  }

  .contact {
    grid-template-columns: 1fr;
  }

  .contact a {
    justify-self: start;
  }
}

/* Narrow screens: logo + name and Instagram on the first row, menu on the second. */
@media (max-width: 640px) {
  .site-header {
    height: auto;
    flex-wrap: wrap;
    row-gap: 4px;
    padding-top: 14px;
  }

  .brand {
    flex: 1 1 auto;
  }

  .main-nav {
    flex: 1 1 100%;
    order: 3;
    margin: 0;
    justify-content: flex-start;
    gap: 32px;
    align-items: center;
  }

  .nav-link {
    padding: 14px 0 12px;
  }
}

@media (max-width: 480px) {
  .site-header,
  .page,
  footer {
    margin-left: 20px;
    margin-right: 20px;
  }

  .brand img {
    width: 48px;
    height: 48px;
  }

  .detail-gallery {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .detail-heading h2 {
    font-size: 3.8rem;
  }

  .main-nav {
    gap: 12px;
  }

  .nav-link {
    font-size: 0.65rem;
  }

  .home-subtitle {
    font-size: 0.65rem;
  }

  .project-meta {
    display: block;
  }

  .project-meta span {
    display: block;
    margin-top: 4px;
  }

  .portfolio-heading h2,
  #info h2 {
    font-size: 3.8rem;
  }
}
/* ---- Personal touches ---- */
::selection {
  background: var(--denim);
  color: var(--paper);
}

.text-link {
  border-bottom: 0;
  background: var(--stitch) left bottom / 100% 1.5px no-repeat;
  color: var(--ink);
}

.text-link:hover {
  color: var(--cognac);
}

.footer-instagram {
  text-decoration: none;
  color: var(--denim);
}

@media (max-width: 480px) {
  .instagram-button {
    width: 40px;
    height: 40px;
  }

  .instagram-button svg {
    width: 20px;
    height: 20px;
  }

  .footer-instagram {
    display: none;
  }
}

/* Material menu on smaller screens: three per row. */
@media (max-width: 800px) {
  .category-nav {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: space-between;
    column-gap: 16px;
  }

  .category-link {
    padding: 10px 0 8px;
  }
}

@media (max-width: 480px) {
  .category-nav {
    margin-left: 20px;
    margin-right: 20px;
  }

  .category-link {
    font-size: 1.05rem;
    gap: 7px;
  }
}

/* Phones: project count goes under the material name. */
@media (max-width: 640px) {
  .portfolio-heading {
    flex-wrap: wrap;
    gap: 14px;
  }

  #category .portfolio-heading h2 {
    font-size: clamp(2.6rem, 15vw, 3.8rem);
  }
}

/* Phones: one picture per row on the material pages. */
@media (max-width: 520px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Wider screens: one compact header ----
   Logo on the left, Instagram on the right, both the same size as before. In between:
   Home / Shop / Info / Contact centred on the page, with the materials spread over the full width below it.
   Narrower screens (under 900px) keep the stacked header above. */
@media (min-width: 900px) {
  .top-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: clamp(28px, 4vw, 64px);
    grid-template-rows: auto auto;
    align-items: center;
    padding: 12px 4vw 0;
  }

  .site-header {
    display: contents;
  }

  .brand {
    grid-column: 1;
    grid-row: 1 / 3;
    justify-self: start;
    align-self: stretch;
    padding-bottom: 12px;

  }

  .main-nav {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    margin: 0;
    gap: 36px;
  }

  .nav-link {
    padding: 4px 0 10px;
  }

  .nav-link::after {
    top: auto;
    bottom: 4px;
  }

  .category-nav {
    grid-column: 2;
    grid-row: 2;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    border-bottom: 0;
  }

  .category-link {
    font-size: 1.12rem;
    padding: 6px 0 14px;
    gap: 7px;
  }

  .category-link::before {
    width: 9px;
    height: 9px;
  }

  .category-link::after {
    bottom: 6px;
    height: 2px;
  }

  .instagram-button {
    grid-column: 3;
    grid-row: 1 / 3;
    justify-self: end;
    margin-bottom: 12px;
  }
}
