/* ==========================================================================
   Z.Symonds
   Designed at 1440px: 4 columns, 24px margins and gutters.
   Sizes scale with the viewport via --px (1 design pixel at 1440 wide).
   Desktop first: tablet (<= 1023px) and phone (<= 767px) override at the end.
   ========================================================================== */

@font-face {
  font-family: "Harbour";
  src: url("../fonts/harbour-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* TASA Orbiter 400, self-hosted (SIL Open Font License: fonts/tasa-orbiter-OFL.txt).
   Split like Google Fonts: each file is only fetched if the page uses
   characters in its range. */
@font-face {
  font-family: "TASA Orbiter";
  src: url("../fonts/tasa-orbiter-400-latin-ext.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "TASA Orbiter";
  src: url("../fonts/tasa-orbiter-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  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;
}

:root {
  --px: calc(100vw / 1440);

  --black: #000;
  --white: #fff;
  --placeholder: #eee;                                  /* behind loading images */

  --font-display: "Harbour", Georgia, serif;
  --font-body: "TASA Orbiter", system-ui, sans-serif;

  /* Spacing */
  --gap: 24px;                                          /* margins + gutters */
  --space-section: clamp(96px, calc(192 * var(--px)), 240px);
  --sticky-top: var(--gap);

  /* Type */
  --text: clamp(15px, calc(20 * var(--px)), 24px);      /* Harbour: nav, labels, intro */
  --text-lh: 1.4;                                       /* 28/20 */
  --display: calc(102 * var(--px));                     /* Harbour: HAND CUT… */
  --body-size: 16px;                                    /* TASA Orbiter */
  --body-lh: 24px;
  --para-gap: var(--body-lh);
}

@media (max-width: 1023px) {
  :root { --gap: 16px; }
}

@media (max-width: 767px) {
  :root {
    --space-section: 96px;
    --text: 16px;
    --display: 11.5vw;
    --para-gap: var(--gap);
  }
}

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

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--body-lh);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

p, ul, figure, h1, h2 { margin: 0; }
ul { padding: 0; list-style: none; }

/* "→ Email" underlines the word only (.link-word), never the arrow */
a { color: inherit; text-decoration: none; }
a:hover,
a:focus-visible,
a:hover .link-word,
a:focus-visible .link-word {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:has(.link-word):hover,
a:has(.link-word):focus-visible { text-decoration: none; }
a:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }

/* ---------- Shared ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap);
}

.section { scroll-margin-top: var(--sticky-top); }
.section:focus { outline: none; }            /* focused by main.js after a menu jump */
.section + .section { margin-top: var(--space-section); }

.display,
.site-nav,
.product__name,
.product__type,
.contact__intro,
.contact__links {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text);
  line-height: var(--text-lh);
}

.display,
.product__name,
.product__type { text-transform: uppercase; }

.display {
  font-size: var(--display);
  line-height: 1;
}

.body-copy p + p { margin-top: var(--para-gap); }

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

/* Images slide up and fade in as they arrive (.is-visible, set in main.js).
   Without JS there is no .js class and everything is simply visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { transform: none; transition: opacity 0.6s ease; }
}

/* ---------- Header + menu ---------- */

.site-header { padding: var(--gap) var(--gap) 0; }

.page {
  margin-top: calc(17 * var(--px));          /* logo to menu */
  padding: 0 var(--gap);
}

/* Zero-height sticky wrapper: the menu overflows into column 1 without
   taking up space and locks once the logo has gone. It sits beneath the
   images and footer logo (z-index 2) but above the text sections, which
   would otherwise cover it and swallow clicks further down the page. */
.nav-anchor {
  position: sticky;
  top: var(--sticky-top);
  z-index: 1;
  height: 0;
}

.site-nav {
  width: calc((100% - 3 * var(--gap)) / 4);  /* one column */
  line-height: 1.5;                          /* 30/20 */
}

/* ---------- Products ----------
   --span: columns the image covers. --label-col: the column within the image
   where the product type and email link start. --label-inset: extra indent
   for those labels, so they can sit on the same line as names above/below. */

.product {
  --span: 2;
  --label-col: 2;
  --label-inset: 0px;
  position: relative;
  z-index: 2;
  grid-column: span var(--span);
  background: var(--placeholder);
}

.product figcaption {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--span), minmax(0, 1fr));
  grid-template-rows: auto 1fr auto;
  column-gap: var(--gap);
  /* No side padding here, so these columns are exactly the page columns;
     the labels carry their own side padding instead. */
  padding: var(--gap) 0;
  pointer-events: none;
}

.product.is-light figcaption { color: var(--white); }

.product__name {
  grid-area: 1 / 1;
  padding-left: var(--gap);
}

.product__type,
.product__order { padding: 0 var(--gap) 0 var(--label-inset); }
.product__type  { grid-area: 1 / var(--label-col) / auto / -1; }
.product__order { grid-area: 3 / var(--label-col) / auto / -1; }
.product__order a { pointer-events: auto; }

/* Overlay text is hidden until wanted:
   - mouse/trackpad: on hover
   - touch: first tap on an image opens it (.is-open, set in main.js), a tap
     on "→ Email" then emails; another image, outside or the same image closes it
   - keyboard: when the email link has focus
   Without JS the overlays simply stay visible. */
.js .product figcaption {
  opacity: 0;
  transition: opacity 0.25s ease;
}
.js .product.is-open figcaption,
.js .product:focus-within figcaption { opacity: 1; }

@media (hover: hover) {
  .js .product:hover figcaption { opacity: 1; }
}

/* On touch, a hidden email link can't be tapped by accident: the tap goes
   to the image and opens the overlay first. */
@media (hover: none) {
  .js .product:not(.is-open) .product__order a { pointer-events: none; }
}

.bonpop,
.clutches { row-gap: var(--gap); }
.bonpop { align-items: start; }

.product--purse        { --span: 3; --label-col: 3; grid-column: 2 / 5; }
.product--left         { grid-column: 1 / 3; }
.product--right        {
  grid-column: 3 / 5;
  /* % margins resolve against the grid area's width: drops it by half a
     column-pair's width, so it starts part-way down the image beside it. */
  margin-top: 50%;
}
/* Labels in column 3, indented to line up with "BONPOP" above and "OAT" below */
.product--wallet       { --span: 4; --label-col: 3; --label-inset: var(--gap); }

/* ---------- Process ----------
   The left half holds two tracks beside the verbs and copy:
   - "HAND" sticks to the top of the viewport.
   - "SMALL LEATHER GOODS" sticks to the bottom.
   Both release on the same scroll position, when "STITCHED" reaches "HAND"
   and the copy's first cap top meets the cap top of "SMALL". */

.process {
  /* (copy cap top within its 24px line) - (Harbour cap top within its 1em
     line), measured in the browser */
  --cap-shift: calc(6.6px - 0.043 * var(--display));
  --verbs-h: calc(4 * var(--display));
  /* designed position of SMALL: 80px below the verbs */
  --slg-top: calc(var(--verbs-h) + 80 * var(--px));
  /* The copy starts one viewport below "STITCHED" (never above --slg-top) */
  --copy-top: max(var(--slg-top), calc(100svh - 2 * var(--sticky-top) - var(--cap-shift)));
}

.process__left {
  grid-area: 1 / 1 / auto / 3;
  position: relative;
}

.process__right { grid-area: 1 / 3 / auto / 5; }

.process__hand-track,
.process__slg-track {
  position: absolute;
  left: 0;
  right: 0;
}

.process__hand-track {
  top: 0;
  height: var(--verbs-h);
}

.process__hand {
  position: sticky;
  top: var(--sticky-top);
  text-align: right;
}

.process__slg-track {
  top: var(--slg-top);
  height: calc(var(--copy-top) + var(--cap-shift) + 3 * var(--display) - var(--slg-top));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.process__slg {
  position: sticky;
  bottom: var(--sticky-top);
}

.process__copy {
  width: calc((100% - var(--gap)) / 2);      /* one column */
  margin-top: calc(var(--copy-top) - var(--verbs-h));
}

/* ---------- Contact ----------
   Fills the viewport: menu + text at the top, logo at the bottom, variable
   space between. On screens too short for both, the text stays level with
   the menu and the logo slides up over it. */

.contact {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: calc(4 * var(--gap));                 /* minimum space above the logo */
  min-height: 100svh;
  padding: var(--gap) 0;
  scroll-margin-top: 0;
}

/* The top padding is part of the gap between sections */
.section.contact { margin-top: calc(var(--space-section) - var(--gap)); }

.contact__text {
  position: sticky;
  top: var(--sticky-top);
  row-gap: var(--gap);
  align-items: start;
}

.contact__intro { grid-column: 3 / 5; }
.contact__links { grid-area: 1 / 2; }        /* level with the intro's first line */
.contact__col   { grid-area: 2 / 3; }

.contact__logo {
  position: relative;
  z-index: 2;
  background: var(--white);
}

/* ==========================================================================
   Tablet and below: <= 1023px
   ========================================================================== */

@media (max-width: 1023px) {
  .process__copy { width: 100%; }

  /* Body text across columns 3–4 */
  .contact__col { grid-area: 2 / 3 / auto / 5; }
}

/* ==========================================================================
   Phone: <= 767px
   Single column; the menu scrolls away and nothing is pinned.
   ========================================================================== */

@media (max-width: 767px) {
  .page { margin-top: 12px; }

  /* Menu: one centred, bullet-separated line */
  .nav-anchor {
    position: static;
    height: auto;
    margin-bottom: var(--gap);
  }
  .site-nav {
    width: auto;
    font-size: min(16px, 3.9vw);
  }
  .site-nav ul {
    display: flex;
    justify-content: center;
    white-space: nowrap;
  }
  .site-nav li + li::before {
    content: "\2022";
    margin: 0 0.35em;
    font-family: var(--font-body);           /* Harbour's bullet is a star */
  }

  .product {
    --span: 2;
    --label-col: 2;
    --label-inset: 0px;
    grid-column: 1 / -1;
    margin-top: 0;
  }

  /* Process: HAND / CUT…, copy, SMALL LEATHER GOODS, stacked and centred */
  .process__left { display: none; }
  .process__right { grid-column: 1 / -1; }
  .process__hand-inline,
  .process__slg-inline {
    position: static;
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
  .process__verbs,
  .process__slg-inline { text-align: center; }
  .process__copy { margin: var(--space-section) 0; }

  /* Contact: stacked in source order, email + Instagram last */
  .contact__text { position: static; }
  .contact__intro,
  .contact__links,
  .contact__col { grid-area: auto / 1 / auto / -1; }
}
