/* =========================================================================
   Speedy B Stitchery — static recreation of the live Squarespace site
   Layout values are reproduced from the live site's fluid-engine grid.
   ========================================================================= */

/* ---------- fonts (self-hosted, SIL Open Font License 1.1) ---------- */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/newsreader-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/newsreader-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */
:root {
  /* fluid-engine grid */
  --gutter: 4vw;
  --gap: 11px;
  --grid-gutter: calc(var(--gutter) - var(--gap));
  --container: calc(100vw - var(--gutter) * 2);
  --cell-max: calc((var(--container) - var(--gap) * 23) / 24);
  --row: calc(var(--container) * 0.0215);

  /* typography scale (matches Squarespace's calc(value * (0.9vw + 4px))) */
  --hfs: calc(0.9vw + 4px);
  --para-lg: calc(0.48vw + 16px);

  /* header */
  --logo-size: 194px;
  --header-h: calc(var(--logo-size) + var(--gutter));

  /* colour */
  --ink: #000;
  --page-bg: #fff;
  --hero-bg: #dcdcdc;
  --btn-bg: #000;
  --btn-fg: #dcdcdc;
  --muted: #5a5a5a;
}

@media (max-width: 767px) {
  :root {
    --gutter: 6vw;
    --row: 24px;
    --hfs: 12.1px;
    --para-lg: 20.32px;
    --logo-size: 97px;
    --header-h: 114px;
  }
}

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

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

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
}

p { margin: 0; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 20px;
  background: #000;
  color: #fff;
}
.skip-link:focus { left: 0; }

/* ---------- fluid grid ---------- */
.fluid {
  display: grid;
  position: relative;
  gap: var(--gap);
  grid-template-columns:
    minmax(var(--grid-gutter), 1fr)
    repeat(24, minmax(0, var(--cell-max)))
    minmax(var(--grid-gutter), 1fr);
}

@media (max-width: 767px) {
  .fluid {
    /* Cell max is deliberately larger than any phone viewport, so the cells
       shrink first and the gutters stay pinned at 6vw, as on the live site. */
    --cell-max: calc((1500px - var(--gap) * 7) / 8);
    grid-template-columns:
      minmax(var(--grid-gutter), 1fr)
      repeat(8, minmax(0, var(--cell-max)))
      minmax(var(--grid-gutter), 1fr);
  }
}

/* ---------- header (transparent, sits over the first section) ---------- */
.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-h);
}

.site-header a { display: block; line-height: 0; }

.site-header img {
  width: var(--logo-size);
  height: var(--logo-size);
  object-fit: contain;
}

/* ---------- sections ---------- */
.section { position: relative; }
.section--hero { background: var(--hero-bg); padding-top: var(--header-h); }
.section--page { background: #fff; padding-top: var(--header-h); }
.section--footer { background: #fff; padding: 1vw 0; }

/* ---------- home: hero ---------- */
.hero-grid { grid-template-rows: repeat(23, minmax(var(--row), auto)); }

/* Squarespace centres the heading block's content in its grid area; the
   paragraph and button blocks sit flush with the top of theirs. */
.hero-title {
  grid-area: 6 / 2 / 11 / 13;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: calc(4 * var(--hfs));
  line-height: 1.056;
  letter-spacing: -0.02em;
}

.hero-copy {
  grid-area: 11 / 2 / 15 / 11;
  font-size: var(--para-lg);
  line-height: 1.5;
}

.hero-btn-1 { grid-area: 16 / 2 / 18 / 7; }
.hero-btn-2 { grid-area: 16 / 7 / 18 / 12; }
.hero-btn-3 { grid-area: 18 / 7 / 20 / 12; }  /* Speedy B on Etsy */
.hero-btn-4 { grid-area: 18 / 2 / 20 / 7; }  /* Custom Project Price Guide */

/* The photo is absolutely positioned so its intrinsic height never feeds back
   into the `auto` row tracks — the grid stays on the row rhythm and the image
   just fills whatever area it is given. */
.hero-image { grid-area: 2 / 15 / 23 / 26; position: relative; min-height: 0; overflow: hidden; }
.hero-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 767px) {
  .hero-grid { grid-template-rows: repeat(31, minmax(var(--row), auto)); }
  .hero-title { grid-area: 3 / 2 / 5 / 10; }
  .hero-copy  { grid-area: 5 / 2 / 10 / 10; }
  .hero-btn-1 { grid-area: 10 / 4 / 12 / 8; }
  .hero-btn-2 { grid-area: 12 / 4 / 14 / 8; }
  .hero-btn-3 { grid-area: 14 / 4 / 16 / 8; }
  .hero-btn-4 { grid-area: 16 / 4 / 18 / 8; }
  .hero-image { grid-area: 18 / 2 / 32 / 10; }
}

/* ---------- buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 0 32px;
  border: 0;
  border-radius: 300px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: "Newsreader", Georgia, serif;
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn:hover { opacity: 0.8; }

/* ---------- footer ---------- */
.footer-grid { grid-template-rows: repeat(4, minmax(var(--row), auto)); }

.footer-name  { grid-area: 2 / 2 / 4 / 10; }
.footer-social{ grid-area: 2 / 10 / 4 / 18; }
.footer-email { grid-area: 2 / 18 / 4 / 26; }

.footer-name, .footer-email {
  font-size: calc(1.4 * var(--hfs));
  line-height: 1.171;
  text-align: center;
}
.footer-email a { text-decoration: none; }
.footer-email a:hover { text-decoration: underline; }

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13.5px;
}
.footer-social a { display: block; line-height: 0; }
.footer-social svg { width: 24px; height: 24px; fill: var(--ink); }
.footer-social a:hover svg { opacity: 0.7; }

@media (max-width: 767px) {
  .footer-grid  { grid-template-rows: repeat(6, minmax(var(--row), auto)); }
  .footer-name  { grid-area: 2 / 2 / 3 / 10; }
  .footer-social{ grid-area: 3 / 2 / 5 / 10; }
  .footer-email { grid-area: 5 / 2 / 6 / 10; }
}

/* =========================================================================
   Shop
   ========================================================================= */
.shop-wrap { padding: 0 var(--gutter) calc(var(--gutter) * 2); }

.shop-title {
  font-size: calc(2.7 * var(--hfs));
  margin-bottom: 2vw;
}
@media (min-width: 768px) {
  .shop-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2vw;
  row-gap: 5vw;
}

.product-card { position: relative; display: block; text-decoration: none; }

.product-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f4f4f4;
}
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }

.product-mark {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 300px;
  background: #000;
  color: #dcdcdc;
  font-size: 13px;
  line-height: 1.4;
}

.product-card__title {
  margin-top: 16px;
  font-size: calc(1.4 * var(--hfs));
  line-height: 1.2;
}

.product-card__price { margin-top: 8px; font-size: 16px; }

.original-price { margin-left: 8px; text-decoration: line-through; color: var(--muted); }

/* =========================================================================
   Product detail
   ========================================================================= */
.product-wrap { padding: 0 var(--gutter) calc(var(--gutter) * 2); }

.breadcrumb {
  margin-bottom: 2vw;
  font-size: 16px;
}
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.5em; }

.product-layout {
  display: grid;
  grid-template-columns: 1.046fr 1fr;
  column-gap: 2vw;
  align-items: center;
}

.product-gallery { aspect-ratio: 3 / 4; overflow: hidden; background: #f4f4f4; }
.product-gallery img { width: 100%; height: 100%; object-fit: cover; }

.product-title { font-size: calc(2.7 * var(--hfs)); line-height: 1.2; }
.product-price { margin-bottom: 5px; font-size: calc(1.4 * var(--hfs)); line-height: 1.2; }
.product-excerpt { font-size: 16px; line-height: 1.5; }

.product-actions {
  display: flex;
  gap: 2vw;
  margin-top: 22px;
}

.qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 155px;
  height: 52px;
  padding: 0 14px;
  border: 1px solid #000;
  border-radius: 300px;
}
.qty button {
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
}
.qty input {
  width: 50px;
  border: 0;
  background: none;
  text-align: center;
  font-family: inherit;
  font-size: 16px;
  color: inherit;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.product-actions .btn { flex: 1; height: 52px; }

.product-additional {
  max-width: 720px;
  margin-top: 6vw;
  font-size: 16px;
  line-height: 1.5;
}

@media (max-width: 767px) {
  .product-grid { grid-template-columns: minmax(0, 1fr); row-gap: 10vw; }
  .product-layout { grid-template-columns: minmax(0, 1fr); row-gap: 6vw; }
  .product-actions { flex-wrap: wrap; row-gap: 12px; }
  .qty { width: 100%; }
  .product-actions .btn { flex: 1 0 100%; }
}

/* ---------- 404 ---------- */
.simple-page {
  padding: calc(var(--header-h) + 6vw) var(--gutter) 10vw;
  text-align: center;
}
.simple-page h1 { font-size: calc(2.8 * var(--hfs)); margin-bottom: 1rem; }
.simple-page p { font-size: var(--para-lg); }
.simple-page .btn { display: inline-flex; width: auto; height: 52px; margin-top: 2rem; }
