/* ============================================================
   Hum — handmade weighted textiles, Cape Town
   Plain HTML / CSS / vanilla JS. No build tools.
   ============================================================ */

:root {
  /* Brand palette */
  --roes: #815541;        /* warm brown */
  --sand: #e6e6e6;        /* dominant background */
  --blaar: #a5a587;       /* sage accent */

  /* Working tones derived from the brand */
  --sand-deep: #dcdcd6;   /* slightly warmer sand for banded sections */
  --ink: #33292420;       /* placeholder, unused directly */
  --text: #3a3029;        /* soft near-black brown for body text */
  --text-soft: #6a5f56;   /* muted brown for secondary text */
  --line: #c9c9c2;        /* hairline dividers on sand */
  --white: #f6f6f3;       /* warm off-white */

  /* Spacing rhythm */
  --gap: clamp(1rem, 2.5vw, 1.75rem);
  --section-y: clamp(4rem, 9vw, 8rem);
  --wrap: 1120px;
  --wrap-narrow: 760px;

  --radius: 4px;
}

/* -------- Reset / base -------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sand);
  color: var(--text);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 {
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-weight: 500;
  color: var(--roes);
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.15rem; color: var(--roes); }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--roes); }

/* -------- Layout helpers -------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}
.wrap--narrow { max-width: var(--wrap-narrow); }

.section { padding: var(--section-y) 0; }

.section--band { background: var(--sand-deep); }

.centered { text-align: center; }

.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  color: var(--text);
  line-height: 1.65;
}

/* Section max-width for readable paragraphs inside narrow wrap */
.wrap--narrow .lead,
.wrap--narrow > p { margin-left: auto; margin-right: auto; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 88vh;
  min-height: 88svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--sand);
  padding: 6rem 1.5rem;
}

.hero__inner { max-width: 40rem; }

.wordmark {
  font-family: "Lora", Georgia, serif;
  font-weight: 500;
  color: var(--roes);
  font-size: clamp(3.5rem, 12vw, 7rem);
  line-height: 1;
  margin: 0;
  letter-spacing: -0.01em;
}

/* Logo image in the hero (transparent PNG). Sized by width so any
   logo shape scales cleanly; height follows the file's proportions.
   The artwork sits inside a square canvas with transparent padding,
   so it is sized a little larger to compensate. */
.wordmark-img {
  display: block;
  width: clamp(150px, 31vw, 280px);
  height: auto;
  margin: 0 auto;
}

.tagline {
  font-family: "Montserrat", sans-serif;
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: lowercase;
  color: var(--text-soft);
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  margin: 1.5rem 0 0;
}

/* Quiet scroll cue */
.hero__scroll {
  position: absolute;
  bottom: 2.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 3rem;
  display: block;
}
.hero__scroll span {
  display: block;
  width: 1px;
  height: 100%;
  margin: 0 auto;
  background: linear-gradient(to bottom, transparent, var(--blaar));
}

/* ============================================================
   SPLIT (text + media)
   ============================================================ */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.split__text { max-width: 34rem; }

/* Reverse visual order on wide screens */
.split--reverse .split__text { order: 2; }
.split--reverse .split__media { order: 1; }

/* ============================================================
   PHOTO PLACEHOLDERS
   ============================================================ */
.photo {
  position: relative;
  width: 100%;
  background: var(--sand-deep);
  border: 1px dashed var(--blaar);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  overflow: hidden;
}
.section--band .photo { background: var(--sand); }

.photo--tall { aspect-ratio: 4 / 5; }
.photo--wide { aspect-ratio: 5 / 4; }

/* When a real photo is present it fills the frame and covers the label.
   If the file is missing, the onerror handler removes the <img>, leaving
   the placeholder label visible. */
.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Bias the crop towards the left so the right edge is trimmed instead,
   keeping the hand and the blanket corner in frame. */
.photo--focus-left img { object-position: 15% center; }

.photo__label {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blaar);
  padding: 0.5rem 1rem;
  text-align: center;
  line-height: 1.8;
}

/* ============================================================
   HOW IT'S MADE — feature list
   ============================================================ */
.features {
  list-style: none;
  margin: clamp(2rem, 4vw, 3.5rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.features li {
  padding-top: 1.25rem;
  border-top: 2px solid var(--blaar);
}
.features h3 { margin-bottom: 0.4em; }
.features p {
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.6;
}

/* ============================================================
   FIND YOUR WEIGHT — table
   ============================================================ */
.table-scroll {
  margin: clamp(2rem, 4vw, 3rem) 0;
  overflow-x: auto;
}

.sizes {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}
.sizes th,
.sizes td {
  text-align: left;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.sizes thead th {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--roes);
  border-bottom: 2px solid var(--blaar);
}
.sizes tbody tr:last-child td { border-bottom: none; }
.sizes td:first-child {
  font-weight: 500;
  color: var(--roes);
}

.price {
  font-family: "Lora", Georgia, serif;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--roes);
  line-height: 1.5;
}

/* ============================================================
   BEFORE YOU BUY — note
   ============================================================ */
.note {
  border-left: 3px solid var(--blaar);
  padding: 0.25rem 0 0.25rem 1.5rem;
}
.note h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.note p { color: var(--text-soft); margin: 0; }

/* ============================================================
   HOW TO ORDER
   ============================================================ */
.section--order { background: var(--sand-deep); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0.9rem 2rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--roes);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.btn--primary {
  background: var(--roes);
  color: var(--white);
}
.btn--primary:hover { background: #6c4636; }
.btn--ghost {
  background: transparent;
  color: var(--roes);
}
.btn--ghost:hover { background: rgba(129, 85, 65, 0.08); }

/* Contact form */
.contact {
  max-width: 32rem;
  margin: 2.5rem auto 0;
  text-align: left;
}
.field { margin-bottom: 1.25rem; }
.contact label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}
.contact input[type="text"],
.contact input[type="email"],
.contact textarea {
  width: 100%;
  min-width: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
}
.contact textarea {
  resize: vertical;
  line-height: 1.6;
}
.contact input:focus,
.contact textarea:focus {
  outline: none;
  border-color: var(--blaar);
}
.contact .btn { width: 100%; margin-top: 0.25rem; }
.contact .btn:disabled { opacity: 0.6; cursor: default; }

.contact__note {
  margin-top: 1rem;
  font-size: 0.92rem;
  color: var(--text-soft);
  min-height: 1.2em;
}
.contact__note--ok { color: var(--roes); }
.contact__note--error { color: #a4442f; }

.contact-direct {
  margin-top: 2.25rem;
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.7;
}
.contact-direct a {
  color: var(--roes);
  text-decoration: none;
  border-bottom: 1px solid var(--blaar);
  white-space: nowrap;
}
.contact-direct a:hover { border-bottom-color: var(--roes); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--roes);
  color: var(--sand);
  padding: clamp(3rem, 6vw, 4.5rem) 0;
}
.footer__mark {
  font-family: "Lora", Georgia, serif;
  font-size: 2rem;
  color: var(--sand);
  margin: 0 0 0.5rem;
}
.footer__by {
  color: rgba(230, 230, 230, 0.8);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin: 0;
}

/* ============================================================
   STICKY HEADER (slides in after you scroll past the hero logo)
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sand);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(58, 48, 41, 0.05);
  /* Hidden just above the top until revealed. */
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none; /* never intercept clicks while hidden */
  transition: transform 0.35s ease, opacity 0.35s ease;
  will-change: transform, opacity;
}
.site-header.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .site-header {
    transform: none;
    transition: opacity 0.2s ease;
  }
}
.site-header__link {
  display: flex;
  align-items: center;
  line-height: 0;
}
/* logo-mark.png is a tightly cropped wordmark + star (no tagline), so it
   is simply sized by height and shown whole, nothing gets clipped. */
.site-header__logo {
  display: block;
  height: 26px;
  width: auto;
}
/* Text fallback if the logo image is missing. */
.site-header__wordmark {
  font-family: "Lora", Georgia, serif;
  font-weight: 500;
  font-size: 1.4rem;
  color: var(--roes);
  line-height: 1;
}

/* ============================================================
   SCROLL REVEAL (sections fade in as they enter the viewport)
   Only active when JS is present, so content is never hidden
   for visitors without JavaScript.
   ============================================================ */
html.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
  .split {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  /* Keep a natural reading order on mobile: text first, then image */
  .split--reverse .split__text { order: 1; }
  .split--reverse .split__media { order: 2; }
  .split__text { max-width: none; }

  .features { grid-template-columns: repeat(2, 1fr); }
}

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

  /* Stacked table cards */
  .sizes thead { display: none; }
  .sizes,
  .sizes tbody,
  .sizes tr,
  .sizes td { display: block; width: 100%; }
  .sizes tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 0.5rem 0.25rem;
  }
  .sizes td {
    border: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 1rem;
    text-align: right;
  }
  .sizes td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
    text-align: left;
  }
  .sizes td:first-child { color: var(--roes); }

  .waitlist__row { flex-direction: column; }
  .waitlist__row .btn { width: 100%; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
