/* =========================================================
   mariharfield.pro
   One stylesheet for the whole site. Change a colour or size
   here and every page updates.
   ========================================================= */

:root {
  --wall: #e8e7e4;      /* page background, matches the photo walls */
  --ink: #1c1b19;       /* text, lines and buttons */
  --muted: #66635d;     /* years, captions, small print */
  --line: #c9c7c2;      /* thin dividers */
  --red: #b22418;       /* accent: buttons, links on hover, current page. Same red as the logo */

  --font: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;   /* text */
  --display: "Instrument Serif", Georgia, serif;                          /* titles */
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--red); }

a:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

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

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--wall);
}

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

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.25rem;
}

.logo {
  display: block;
  width: clamp(2.75rem, 4vw, 3.5rem);
  border-radius: 50%;
}
.logo img { width: 100%; height: auto; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.nav a { text-decoration: none; }
.nav a:hover { color: var(--red); }
.nav a:hover,
.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

/* ---------- Home hero ---------- */

.hero {
  padding-block: clamp(2rem, 7vw, 6rem) clamp(3rem, 7vw, 6rem);
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 19vw, 19.5rem);
  line-height: 0.85;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--red);
}

.hero p {
  max-width: none;          /* one line on computers and tablets */
  text-align: center;
  margin: 1.75rem 0 0;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.4;
}

/* ---------- Section headings ---------- */

.section {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.section > h2 {
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
  padding-top: 0.6rem;
  border-top: 2px solid var(--ink);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0.01em;
}

/* ---------- Paintings: an even grid, 4 across ----------
   Every painting sits in the same 3:4 frame, so titles line up.
   The last row is centred, so 7 paintings sit as 4 + 3. */

.paintings {
  --cols: 4;
  --col-gap: clamp(1.25rem, 3vw, 2.75rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(2.5rem, 4vw, 3.5rem) var(--col-gap);
}

.piece {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--col-gap)) / var(--cols));
  margin: 0;
}

@media (max-width: 1100px) { .paintings { --cols: 2; } }
@media (max-width: 600px)  { .paintings { --cols: 1; } }

.piece a { display: block; text-decoration: none; }
.piece a:hover .title { color: var(--red); text-decoration: underline; }

.frame {
  display: block;
  aspect-ratio: 3 / 4;
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  transform-origin: 50% 100%;   /* grows upwards, so the title underneath stays visible */
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.35s;
}

/* Hover: paintings and design work grow and lift off the wall */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .piece a,
  .card a { position: relative; }
  .piece a:hover,
  .piece a:focus-visible,
  .card a:hover,
  .card a:focus-visible { z-index: 2; }
  .piece a:hover .frame img,
  .piece a:focus-visible .frame img,
  .card a:hover .frame img,
  .card a:focus-visible .frame img {
    transform: scale(1.1);
    filter: drop-shadow(0 18px 28px rgba(28, 27, 25, 0.28));
  }
}

.piece figcaption,
.card figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.6rem;
}

.title { font-weight: 600; }
.meta { color: var(--muted); }

/* ---------- Design work ---------- */

.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2.75rem);
}

.card { margin: 0; }
.frame--square { aspect-ratio: 1 / 1; }
.frame--square img { object-fit: cover; }
.card a { display: block; text-decoration: none; }
.card a:hover .title { color: var(--red); text-decoration: underline; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s;
}
.btn:hover { background: var(--ink); }

/* ---------- Brush set strip (home) ---------- */

.brush {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.5rem 3rem;
}
.brush p { max-width: 46ch; margin: 0 0 0.75rem; }
.brush .price { margin: 0 0 1rem; }

@media (max-width: 640px) {
  .brush { grid-template-columns: 1fr; }
}

/* ---------- Project pages ---------- */

.project {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 5rem);
  padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(3rem, 6vw, 5rem);
}

.project-images { display: grid; gap: 1.5rem; }

.project-text {
  position: sticky;
  top: 2rem;
}

.project-text h1 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.75rem, 5vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--red);
}

.project-text .meta { margin: 0 0 1.75rem; }

.project-text .body p {
  max-width: 42ch;
  margin: 0 0 1em;
}

.price {
  font-weight: 700;
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 800px) {
  .project { grid-template-columns: 1fr; }
  .project-text { position: static; }
}

/* ---------- Shop ---------- */

.page-title {
  margin: 0;
  padding-block: clamp(1.5rem, 5vw, 4rem) clamp(2rem, 4vw, 3rem);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.5rem, 11vw, 10rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: var(--red);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 3vw, 2.75rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.product { display: flex; flex-direction: column; }
.product h2 {
  margin: 0.75rem 0 0.15rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}
.product p { margin: 0 0 1rem; }
.product .btn { align-self: flex-start; margin-top: auto; }

.brush-tile {
  display: grid;
  place-items: end start;
  aspect-ratio: 3 / 4;
  padding: 1.5rem;
  background: var(--red);
  color: #fff;
}
.brush-tile span {
  font-family: var(--display);
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
}

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

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.contact h2 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  line-height: 1;
}

.contact .statement p { max-width: 46ch; margin: 0 0 1em; }

.email:hover { color: var(--red); }
.email {
  display: inline-block;
  margin-bottom: 2.5rem;
  font-weight: 700;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  line-height: 1.1;
  word-break: break-word;
  text-decoration-thickness: 2px;
}

.plain-list { list-style: none; margin: 0 0 2.5rem; padding: 0; }
.plain-list li { font-size: 1.25rem; }

@media (max-width: 800px) {
  .contact { grid-template-columns: 1fr; }
}

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

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.25rem 2.5rem;
  border-top: 2px solid var(--ink);
  color: var(--muted);
}
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--red); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Welcome screen (home page, once per visit) ----------
   Shown only when the little script in index.html adds the
   "intro" class. The mouse is hidden; js/intro.js draws its trail.
   The whole title is the way in: hover turns it italic and draws
   the line underneath out to full width. */

.intro-screen { display: none; }

html.intro body { overflow: hidden; }

html.intro .intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--red);
  cursor: none;
  touch-action: none;
  transition: opacity 0.9s ease, visibility 0.9s;
}

html.intro .intro-screen * { cursor: none; }

.intro-screen.is-leaving {
  opacity: 0;
  visibility: hidden;
}

#intro-trail {
  position: absolute;
  inset: 0;
  z-index: 0;              /* the line passes behind the title */
  pointer-events: none;
}

.intro-enter {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 1.1rem;
  padding: 1.5rem 2rem;
  border: 0;
  background: none;
  color: var(--wall);
  font: inherit;
  animation: intro-in 1.6s ease both;
}

.intro-name {
  font-family: var(--font);
  font-size: 0.9375rem;
  letter-spacing: 0.12em;
  opacity: 0.75;
}

.intro-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 8rem);
  line-height: 1;
  letter-spacing: 0.02em;
}

.intro-rule {
  width: 3.5rem;
  height: 1px;
  background: var(--wall);
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.intro-enter:hover .intro-title,
.intro-enter:focus-visible .intro-title { font-style: italic; }

.intro-enter:hover .intro-rule,
.intro-enter:focus-visible .intro-rule { width: 100%; }

.intro-enter:focus-visible { outline: none; }

@keyframes intro-in {
  from { opacity: 0; transform: translateY(0.75rem); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html.intro .intro-screen { transition: none; }
  .intro-enter { animation: none; }
  .intro-rule { transition: none; }
}
