/* MadMade store — skeleton.
   White paper, black ink, one red. Structure only: the menu, the pages, and
   a hero on the home page. Every other page is deliberately empty. */

:root {
  --paper:  #ffffff;
  --ink:    #0d0d0d;
  --muted:  #6b6b6b;
  --faint:  #9a9a9a;
  --rule:   #e6e6e6;
  --rule-2: #f4f4f4;
  --accent: #e8331c;

  --display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
             Helvetica, Arial, sans-serif;
  --mono:    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
             "Liberation Mono", monospace;

  --gut: clamp(1.15rem, 4.5vw, 4rem);
  --max: 84rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Drafting-paper rules, fixed behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, var(--rule-2) 1px, transparent 1px);
  background-size: clamp(4rem, 12.5vw, 9rem) 100%;
  background-position: center top;
}

/* Paper grain — inline SVG, no request. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gut);
  padding-right: var(--gut);
}

/* ---------- announcement strip ---------- */

.strip {
  position: relative;
  z-index: 2;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 0.55rem 1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.strip em { font-style: normal; color: var(--accent); }

/* ---------- masthead ---------- */

.mast {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

@supports not (backdrop-filter: blur(1px)) {
  .mast { background: var(--paper); }
}

.mast__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
}

.brand {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  flex: none;
}

.brand b { font-weight: 700; }
.brand span { color: var(--accent); }

/* primary menu */
.menu {
  display: flex;
  gap: clamp(0.9rem, 2.4vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.menu a {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}

.menu a:hover,
.menu a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* utility menu */
.util {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.4rem);
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  flex: none;
}

.util a {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.util a:hover, .util a[aria-current="page"] { color: var(--ink); }
.util .bag { color: var(--ink); }
.util .bag i { font-style: normal; color: var(--accent); }

/* The menu wraps to its own row on narrow screens rather than squashing. */
@media (max-width: 60rem) {
  .mast__in { flex-wrap: wrap; }
  .menu {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    border-top: 1px solid var(--rule);
    padding-top: 0.75rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .menu::-webkit-scrollbar { display: none; }
}

/* sub-menu, shown only on shop pages */
.sub {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: relative;
  z-index: 1;
}

.sub ul {
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0.7rem 0;
  overflow-x: auto;
}

.sub a {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  text-decoration: none;
  white-space: nowrap;
}

.sub a:hover, .sub a[aria-current="page"] { color: var(--accent); }

/* ---------- hero (home only) ---------- */

.hero {
  padding-top: clamp(3rem, 11vh, 7.5rem);
  padding-bottom: clamp(3rem, 10vh, 6.5rem);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: clamp(1.75rem, 5vh, 3rem);
}

.hero__meta em { font-style: normal; color: var(--accent); }

.wordmark {
  margin: 0;
  font-size: clamp(3.4rem, 18.5vw, 15rem);
  line-height: 0.82;
  font-weight: 800;
  letter-spacing: calc(-0.055em + (var(--t, 0) * 0.02em));
  text-transform: uppercase;
}

.wordmark span { display: block; }
.wordmark .is-out { color: var(--accent); }

.hero__rule {
  height: 1px;
  background: var(--ink);
  margin: clamp(1.75rem, 5vh, 3rem) 0 clamp(1.25rem, 3.5vh, 1.85rem);
}

.hero__lede {
  max-width: 33rem;
  margin: 0;
  font-size: clamp(1.02rem, 2vw, 1.3rem);
  line-height: 1.55;
  color: var(--muted);
}

.hero__lede strong { color: var(--ink); font-weight: 600; }

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: clamp(1.75rem, 5vh, 2.5rem);
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--ink);
  color: var(--paper);
  background: var(--ink);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn:hover { background: var(--accent); border-color: var(--accent); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- inner page head ---------- */

main { flex: 1; }

.page {
  padding-top: clamp(2.5rem, 8vh, 5rem);
  padding-bottom: clamp(3rem, 10vh, 6rem);
}

.page__no {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.9rem;
}

.page__title {
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 750;
  text-transform: uppercase;
}

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

.foot {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--rule);
  padding-top: clamp(2rem, 6vh, 3.25rem);
  padding-bottom: clamp(2rem, 6vh, 3.25rem);
}

.foot__in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 2.5rem;
}

.foot nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.foot a {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.foot a:hover { color: var(--accent); }

.foot__mark {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .wordmark { letter-spacing: -0.055em; }
  * { transition: none !important; }
}

/* ---------- featured products — the infinite rail ---------- */

.feature {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--rule);
  padding-top: clamp(2.5rem, 8vh, 5rem);
  padding-bottom: clamp(2.5rem, 8vh, 5rem);
  overflow: hidden;
}

.feature__head {
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
  /* the rail is driven by scroll, so the label has to stay put while you
     travel through the section */
  position: sticky;
  top: 4.75rem;
  z-index: 4;
}

.feature__eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.85rem;
}

.feature__eyebrow em { font-style: normal; color: var(--accent); }

.feature__title {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 3.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 750;
  text-transform: uppercase;
  /* the label swaps as the rail moves, so hold a line of height */
  min-height: 1em;
}

.feature__meta {
  margin: 0.7rem 0 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.feature__meta em { font-style: normal; color: var(--accent); padding: 0 0.35rem; }

/* the thin scrub line under the label */
.scrub {
  position: relative;
  height: 1px;
  background: var(--rule);
  margin-top: clamp(1.1rem, 3vh, 1.6rem);
  max-width: 22rem;
}

.scrub__bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 12%;
  background: var(--ink);
  transform-origin: left;
}

.rail {
  position: relative;
  height: clamp(21rem, 60vh, 40rem);
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.rail.is-drag { cursor: grabbing; }

.rail__track {
  position: absolute;
  top: 50%;
  left: 0;
  display: flex;
  align-items: center;
  will-change: transform;
}

.rail__item {
  flex: none;
  display: block;
  width: clamp(10.5rem, 20vw, 20rem);
  margin-right: clamp(1.25rem, 3.5vw, 3.5rem);
  text-decoration: none;
  color: inherit;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

.rail__item img {
  display: block;
  width: 100%;
  height: auto;
  /* the shots are already on pure white, so they melt into the page */
  mix-blend-mode: multiply;
  pointer-events: none;
}

.rail__hint {
  display: block;
  margin-top: clamp(1.1rem, 3vh, 1.75rem);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.rail__hint em { font-style: normal; color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .rail { cursor: default; }
}

/* ---------- hero — the knolled field ---------- */

.knoll {
  position: relative;
  height: min(88vh, 54rem);
  min-height: 26rem;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  border-bottom: 1px solid var(--rule);
  z-index: 1;
}

.knoll.is-drag { cursor: grabbing; }

/* One tile is 5 x 3 cells; the field lays 4 x 3 tiles so there is always
   another tile beyond every edge to wrap into. */
.knoll__field {
  --cell: clamp(7rem, 13vw, 13.5rem);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(20, var(--cell));
  grid-auto-rows: var(--cell);
  will-change: transform;
}

.knoll__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.knoll__cell img {
  display: block;
  width: 100%;
  height: auto;
  /* shots are already on pure white, so they sit on the page with no edge */
  mix-blend-mode: multiply;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* Knolling wants rhythm without breaking the grid: the objects change size,
   the alignment never does. */
.knoll__cell--lg img { width: 76%; }
.knoll__cell--md img { width: 54%; }
.knoll__cell--sm img { width: 36%; }

.knoll__cell--gap { visibility: hidden; }

/* the overlay */
.knoll__over {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.15rem, 4.5vw, 4rem);
}

.knoll__mark {
  display: inline-block;
  margin: 0;
  padding: 0.4rem 0.7rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  line-height: 1;
}

.knoll__mark span { color: var(--accent); }

.knoll__sub {
  display: inline-block;
  margin: 0.4rem 0 0;
  padding: 0.35rem 0.7rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}

.knoll__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.knoll__foot > span {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
  padding: 0.35rem 0.7rem;
}

.knoll__foot em { font-style: normal; color: var(--accent); }

.knoll__read {
  color: var(--ink);
  min-height: 1em;
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  .knoll { cursor: default; }
}

.rail__item { cursor: pointer; }
