/* ==========================================================================
   The Living Loom, core stylesheet
   Palette and type sampled from living-loom-logo.jpg
   ========================================================================== */

:root {
  /* greens: line work and text, from the logo */
  --green-deep:   #2c3c26;
  --green:        #3d5135;
  --green-mid:    #55694a;
  --sage:         #8fa47c;
  --sage-deep:    #c1cdba;   /* hero ground: soft sage */
  --ink:          #1e2b19;   /* text on the sage ground */
  --sage-pale:    #b3c2a1;

  /* creams: page grounds, from the logo field and the flower */
  --cream:        #f2eee1;
  --cream-warm:   #e9e3d1;
  --ivory:        #faf7ee;

  /* golds: the buds */
  --gold:         #c39a3e;
  --gold-soft:    #d8bd78;
  --gold-pale:    #ecdcb4;

  /* warm accents for category panels: Rajasthan textile dyes */
  --madder:       #a24a3c;
  --rose-dust:    #bf8b85;
  --plum:         #74424f;
  --indigo:       #3c4d6b;
  --marigold:     #c98b2e;

  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body:    "EB Garamond", Georgia, "Times New Roman", serif;

  --measure: 62ch;
  --gutter: 1.5rem;
  --rule: 1px solid rgba(61, 81, 53, 0.22);
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--green-deep);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

/* --------------------------------------------------------------- type --- */

h1, h2, h3, .wordmark, .eyebrow {
  font-family: var(--display);
  font-weight: 400;
  margin: 0;
}

h2 {
  font-size: clamp(1.9rem, 1.4rem + 2.2vw, 3rem);
  line-height: 1.12;
  letter-spacing: 0.02em;
}

h3 {
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

/* the logo's "THE" / "EST." / "CRAFTED. KEPT. PASSED ON." treatment */
.eyebrow {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  color: var(--green-mid);
  margin: 0 0 1.1rem;
  text-indent: 0.34em;
}

.lede {
  font-size: clamp(1.08rem, 1rem + 0.45vw, 1.3rem);
  line-height: 1.68;
  max-width: var(--measure);
}

.wrap {
  width: min(100% - (var(--gutter) * 2), 1180px);
  margin-inline: auto;
}

.wrap--narrow { width: min(100% - (var(--gutter) * 2), 760px); }

section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-block;
  font-family: var(--display);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-decoration: none;
  padding: 0.95em 1.9em;
  border: 1px solid currentColor;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.btn--gold { color: var(--gold-pale); }
.btn--gold:hover, .btn--gold:focus-visible { background: var(--gold-pale); color: var(--green-deep); }

.btn--ink { color: var(--ink); }
.btn--ink:hover, .btn--ink:focus-visible { background: var(--ink); color: var(--cream); }

.btn--solid { background: var(--green); color: var(--cream); border-color: var(--green); }
.btn--solid:hover, .btn--solid:focus-visible { background: var(--green-deep); border-color: var(--green-deep); }

/* ---------------------------------------------------------------- nav --- */

/* same height and same hairline as .sitehead on the inner pages, so the bar
   reads as one piece of chrome across the site rather than two */
.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  padding: 1.9rem 0;
  border-bottom: 1px solid rgba(44, 60, 38, 0.18);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar a {
  font-family: var(--display);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.8;
}

.topbar a:hover { opacity: 1; }

.topbar nav { display: flex; gap: clamp(1rem, 3vw, 2.4rem); }

/* the direct child anchor is the wordmark; the nav links sit inside <nav>.
   Matches .sitehead__brand so both headers are the same height. */
.topbar__inner > a {
  font-size: 1.24rem;
  letter-spacing: 0.17em;
  text-indent: 0.17em;
  opacity: 1;
}

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

.hero {
  position: relative;
  background: var(--sage-deep);
  min-height: min(100svh, 940px);
  display: grid;
  place-items: center;
  padding: clamp(6rem, 12vw, 8rem) var(--gutter) clamp(3.5rem, 8vw, 5rem);
  overflow: hidden;
  isolation: isolate;
}

/* the tonal block-print "buti" field behind the logo */
.hero__field {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  z-index: -1;
  opacity: 0.22;
}

.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 62% 66% at 50% 45%,
              rgba(46, 62, 40, 0) 0%,
              rgba(46, 62, 40, 0.06) 62%,
              rgba(46, 62, 40, 0.22) 100%);
}

.hero__inner { display: grid; justify-items: center; gap: clamp(1.5rem, 3vw, 2.2rem); }

/* the supplied logo, background removed, sitting straight on the cloth */
.logo-banner {
  margin: 0;
  /* the cut-out has no margins of its own and the wordmark is its widest
     element, so the width cap IS the wordmark width - 88vw left it almost
     touching the screen edges on a phone */
  width: min(78vw, 46vh, 460px);
}

.logo-banner img { width: 100%; height: auto; display: block; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }

.hero__note {
  color: var(--ink);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-align: center;
  margin: 0;
  max-width: 34ch;
}

/* ---------------------------------------------- printed border divider --- */

.print-rule {
  height: 34px;
  background-repeat: repeat-x;
  background-position: center;
  background-size: auto 34px;
}

.print-rule--gold { background-color: var(--sage-deep); }

/* -------------------------------------------------------------- intro --- */

.intro { background: var(--cream); text-align: center; }
.intro .lede { margin-inline: auto; }
.intro h2 { margin-bottom: 1.4rem; }

.signature {
  display: block;
  margin: 2.2rem auto 0;
  width: 92px;
  opacity: 0.75;
}

/* --------------------------------------------------------- collection --- */

.collection { background: var(--cream-warm); }

.section-head { text-align: center; margin-bottom: clamp(2.5rem, 5vw, 3.6rem); }
.section-head .lede { margin-inline: auto; margin-top: 1rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: clamp(1.2rem, 2.6vw, 2rem);
}

/* each category gets its own dye colour and its own block-print motif,
   the way a printer's sample book pairs one block with one ground */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--ivory);
  border: 1px solid rgba(61, 81, 53, 0.2);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover, .card:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 16px 34px rgba(44, 60, 38, 0.15);
}

.card__figure {
  position: relative;
  aspect-ratio: 1;
  background-color: var(--card-tint, var(--sage));
  background-repeat: repeat;
  background-size: 78px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* photos fill the tile edge to edge, matching .variant__figure on the shop
   page. The tint and motif underneath now show only on the cards that have no
   photograph yet. */
.card__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__soon {
  font-family: var(--display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: var(--ivory);
  background: rgba(44, 60, 38, 0.55);
  border: 1px solid rgba(250, 247, 238, 0.5);
  padding: 0.8em 1.3em;
}

.card__body { padding: 1.35rem 1.4rem 1.5rem; display: grid; gap: 0.4rem; }

.card__name { font-family: var(--display); font-size: 1.38rem; letter-spacing: 0.03em; }

.card__meta {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--green-mid);
}

.card__price { font-family: var(--display); font-size: 1.12rem; color: var(--gold); letter-spacing: 0.04em; }

/* categories that exist in the collection but are not on Etsy yet */
.card__pending,
.cat__pending { color: var(--madder); }

.card__pending {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.cat__pending { font-size: 0.92rem; margin: 0 0 1.4rem; }
.cat__pending a { color: inherit; text-underline-offset: 3px; }

/* ---------------------------------------------------------- one of one --- */

.oneofone { background: var(--cream); }

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(2rem, 4vw, 3.2rem);
  margin-top: clamp(2.4rem, 5vw, 3.4rem);
}

.pillar { text-align: center; }
.pillar svg { width: 54px; height: 54px; margin: 0 auto 1.1rem; display: block; }
.pillar h3 { margin-bottom: 0.5rem; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.98rem; }
.pillar p { margin: 0; font-size: 1.03rem; color: var(--green-mid); }

/* ------------------------------------------------------------- swatch --- */

.swatch {
  background: var(--sage-deep);
  color: var(--ink);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: stretch;
}

/* the listing photo is portrait (3:4) in a landscape band, so give the band
   more height and bias the crop upward to keep the notebook in frame rather
   than centring on the hand */
.swatch__image {
  min-height: clamp(360px, 46vw, 560px);
  background: center 30% / cover no-repeat;
}

.swatch__text { padding: clamp(2.6rem, 6vw, 4.6rem); display: grid; align-content: center; gap: 1.1rem; }
.swatch__text h2 { color: var(--green-deep); }
.swatch__text p { color: var(--ink); max-width: 46ch; margin: 0; }
.swatch__text .eyebrow { color: var(--green); }

/* --------------------------------------------------------------- etsy --- */

.etsy { background: var(--cream-warm); text-align: center; }
.etsy .lede { margin: 1rem auto 2rem; }

/* ------------------------------------------------------------- footer --- */

.footer {
  background: var(--sage-deep);
  color: var(--ink);
  padding-block: clamp(3rem, 6vw, 4.2rem);
  font-size: 0.88rem;
}

.footer__inner { display: grid; gap: 2rem; justify-items: center; text-align: center; }
.footer__mark { width: 150px; opacity: 0.9; }
.footer nav { display: flex; flex-wrap: wrap; gap: 1.6rem; justify-content: center; }

.footer a {
  text-decoration: none;
  text-transform: uppercase;
  font-family: var(--display);
  font-size: 0.86rem;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: var(--green);
}

.footer a:hover { color: var(--green-deep); }
.footer small { display: block; color: var(--green); letter-spacing: 0.05em; }

/* ------------------------------------------------------------- motion --- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------------- mobile --- */

@media (max-width: 640px) {
  .topbar nav { display: none; }
  .swatch__image { min-height: 420px; }   /* portrait photo needs the height */

  .topbar { padding: 1.3rem 0; }
  .topbar__inner > a { font-size: 1.12rem; }

  /* at this size the wordmark and three nav links cannot share a row without
     the wordmark wrapping onto three lines, so give each its own */
  .sitehead { padding: 1.3rem 0; }
  .sitehead__inner { flex-direction: column; gap: 0.85rem; }
  .sitehead__brand { font-size: 1.12rem !important; }
  .sitehead nav { gap: 1.6rem; }
}

/* ------------------------------------------------- inline svg motif fills --- */

.card__motif,
.hero__field { display: block; }

.card__motif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.card__figure > img,
.card__figure > .card__soon { position: relative; z-index: 1; }

.print-rule svg { display: block; }

/* ===================================================== inner page chrome === */

/* slim header for shop/about; the home page keeps its full-height hero */
.sitehead {
  background: var(--sage-deep);
  color: var(--ink);
  padding: 1.9rem 0;
  border-bottom: 1px solid rgba(44, 60, 38, 0.18);
}

.sitehead__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.sitehead a {
  font-family: var(--display);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.8;
}

.sitehead a:hover { opacity: 1; }
.sitehead nav { display: flex; gap: clamp(1rem, 3vw, 2.4rem); }
.sitehead__brand {
  font-size: 1.24rem !important;
  letter-spacing: 0.17em !important;
  text-indent: 0.17em !important;
  opacity: 1 !important;
}

.pagehead {
  background: var(--sage-deep);
  color: var(--ink);
  text-align: center;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.pagehead h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: 0.03em;
  margin: 0;
}

.pagehead .lede { margin: 1.1rem auto 0; color: var(--ink); }
.pagehead .eyebrow { color: var(--green); }

/* --------------------------------------------------------- anchor nav --- */

.anchornav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--cream-warm);
  border-bottom: 1px solid rgba(61, 81, 53, 0.18);
  padding: 0.8rem 0;
}

.anchornav ul {
  list-style: none;
  margin-block: 0;
  margin-inline: auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.8rem, 2.4vw, 2rem);
  justify-content: center;
}

.anchornav a {
  font-family: var(--display);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  color: var(--green-mid);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.anchornav a:hover { color: var(--green-deep); border-bottom-color: var(--gold); }

/* --------------------------------------------------------- categories --- */

.cat { padding-block: clamp(3rem, 7vw, 5rem); scroll-margin-top: 4rem; }
.cat:nth-of-type(odd)  { background: var(--cream); }
.cat:nth-of-type(even) { background: var(--cream-warm); }

.cat__head {
  max-width: 62ch;
  margin-inline: auto;
  margin-bottom: clamp(1.8rem, 4vw, 2.6rem);
  text-align: center;
}

.cat__head h2 { margin-bottom: 0.8rem; }
.cat__head p { margin: 0 0 1.3rem; color: var(--green-mid); }

.cat__spec {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.8rem;
  margin: 0 0 1.4rem;
  padding: 0.9rem 0;
  border-block: 1px solid rgba(61, 81, 53, 0.18);
  font-size: 0.9rem;
}

.cat__spec div { display: flex; gap: 0.5rem; }
.cat__spec dt { text-transform: uppercase; letter-spacing: 0.12em; color: var(--green-mid); font-size: 0.8rem; align-self: center; }
.cat__spec dd { margin: 0; }

.cat__price {
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin: 0 0 1.4rem;
}

/* ----------------------------------------------------------- variants --- */

.variants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: clamp(1rem, 2.2vw, 1.6rem);
  justify-items: center;
}

.variant { width: 100%; max-width: 260px; }

.variant { display: grid; gap: 0.5rem; text-align: center; }

.variant__figure {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--tint, var(--sage));
  border: 1px solid rgba(61, 81, 53, 0.2);
  display: grid;
  place-items: center;
}

.variant__figure img { width: 100%; height: 100%; object-fit: cover; }

.variant__pending {
  font-family: var(--display);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: var(--ivory);
  text-align: center;
  padding: 0 1em;
  position: relative;
  z-index: 1;
}

.variant__name { font-family: var(--display); font-size: 1.12rem; letter-spacing: 0.03em; line-height: 1.2; }
.variant__colour { font-size: 0.88rem; color: var(--green-mid); line-height: 1.4; }

.variant__note {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--madder);
}

/* photos that exist but are not tied to a named design */
.extras { margin-top: clamp(2rem, 4vw, 3rem); }

.extras { text-align: center; }

.extras h3 {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--green-mid);
  margin-bottom: 1rem;
}

/* these strips hold one or two photos, so a full-width auto-fill grid left
   them stranded at the left edge; centre them instead */
.extras__strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.extras__strip img { width: min(100%, 200px); }

.extras__strip img { aspect-ratio: 1; object-fit: cover; border: 1px solid rgba(61, 81, 53, 0.2); }

/* -------------------------------------------------------------- about --- */

.about-body { background: var(--cream); }

/* one column for prose and figures alike, so their left and right edges line
   up; 660px keeps the measure near 70 characters at this size */
.about-body .wrap--narrow { width: min(100% - (var(--gutter) * 2), 660px); }
.about-body h2 { margin: 2.6rem 0 1rem; }
.about-body h2:first-child { margin-top: 0; }
.about-body p { max-width: none; }

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.6rem;
}

.about-figure { margin: 2.6rem 0; }

/* a portrait product shot: capped and cropped a little high so it does not
   run to 880px tall in a 660px column, and does not centre on the hand */
.about-figure img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  object-position: center 32%;
}

.about-figure figcaption {
  font-size: 0.8rem;
  color: var(--green-mid);
  margin-top: 0.7rem;
  letter-spacing: 0.04em;
}

/* ------------------------------------------- mobile, after the base rules --- */

@media (max-width: 640px) {
  /* the larger labels made this wrap to seven rows: 298px of sticky nav on a
     phone. One horizontally scrollable row instead. */
  .anchornav ul {
    flex-wrap: nowrap;
    justify-content: flex-start;
    /* full-bleed scroller with the gutter as inner padding, so the first
       label is not flush against the screen edge */
    width: 100%;
    padding-inline: var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .anchornav ul::-webkit-scrollbar { display: none; }
  .anchornav a { white-space: nowrap; }
}
