/* ==========================================================================
   MORROW & FINCH — heritage menswear, est. 1934
   A working shop dressed as a 1930s catalogue: cream paper with real grain,
   Libre Caslon Display over EB Garamond, ruled departments, numbered plates,
   hangtag prices, and an Order Book where the cart should be.
   ========================================================================== */

:root {
  --paper: #F1E9D6;
  --paper-deep: #E7DCC2;
  --card: #F7F1E2;
  --ink: #362A1E;
  --ink-soft: #6F6250;
  --burgundy: #6E3B34;
  --burgundy-deep: #572C26;
  --rule: #C9BB9C;
  --tan: #A98F63;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  position: relative;
}

/* Paper grain over everything, fixed so it reads as the page, not the content. */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 90;
  opacity: .05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { font-family: 'Libre Caslon Display', 'EB Garamond', serif; font-weight: 400; line-height: 1.1; }

img { display: block; max-width: 100%; height: auto; }
a { color: var(--burgundy); }
button { font: inherit; cursor: pointer; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--burgundy); color: var(--paper); padding: 10px 18px; z-index: 99; }
.skip:focus { left: 12px; top: 12px; }

/* ---------- Header ---------- */

.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 12px clamp(18px, 4vw, 48px);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}

.mark { text-decoration: none; color: var(--ink); display: grid; line-height: 1.15; }
.mark-name { font-family: 'Libre Caslon Display', serif; font-size: 1.35rem; letter-spacing: .02em; }
.mark-est { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }

.top-nav { display: flex; gap: 20px; margin-left: auto; }
.top-nav a { text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: .95rem; letter-spacing: .03em; }
.top-nav a:hover { color: var(--burgundy); }

.book-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1.5px solid var(--burgundy); color: var(--burgundy);
  border-radius: 3px; padding: 7px 14px; font-weight: 600; font-size: .92rem;
  transition: background .15s ease, color .15s ease;
}
.book-btn:hover { background: var(--burgundy); color: var(--paper); }
.book-count {
  background: var(--burgundy); color: var(--paper);
  min-width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: .78rem; font-weight: 600;
  transition: transform .15s ease;
}
.book-btn:hover .book-count { background: var(--paper); color: var(--burgundy); }
.book-count.bump { transform: scale(1.25); }

/* ---------- Cover ---------- */

.cover { position: relative; min-height: 88vh; display: grid; align-items: end; overflow: hidden; }
.cover-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(15deg, rgba(30, 22, 14, .72) 0%, rgba(30, 22, 14, .25) 45%, rgba(30, 22, 14, 0) 70%);
}
.cover-copy { position: relative; padding: clamp(28px, 5vw, 64px); max-width: 640px; color: #F4EDDC; }
.cover-kicker { font-size: .82rem; letter-spacing: .22em; text-transform: uppercase; margin-bottom: 14px; color: #D9CCAE; }
.cover-copy h1 { font-size: clamp(2.8rem, 7vw, 5rem); margin-bottom: 16px; }
.cover-sub { max-width: 44ch; margin-bottom: 24px; font-size: 1.05rem; color: #E9DFC8; }
.btn-cover {
  display: inline-block; text-decoration: none; color: #F4EDDC;
  border: 1.5px solid #D9CCAE; border-radius: 3px; padding: 12px 26px;
  letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; font-weight: 600;
  transition: background .18s ease, color .18s ease;
}
.btn-cover:hover { background: #F4EDDC; color: var(--ink); }

/* ---------- Contents ---------- */

.contents { max-width: 560px; margin: 0 auto; padding: clamp(40px, 6vw, 70px) 24px 10px; text-align: center; }
.contents-title {
  font-family: 'Libre Caslon Display', serif; font-size: 1.1rem; letter-spacing: .3em;
  text-transform: uppercase; margin-bottom: 18px;
}
.contents-list { list-style: none; display: grid; gap: 6px; }
.contents-list a {
  display: flex; align-items: baseline; gap: 12px; text-decoration: none; color: var(--ink);
  font-size: 1.05rem;
}
.contents-list a:hover .c-name { color: var(--burgundy); font-style: italic; }
.c-num { font-size: .8rem; letter-spacing: .1em; color: var(--ink-soft); min-width: 110px; text-align: left; }
.c-line { flex: 1; border-bottom: 1px dotted var(--rule); transform: translateY(-4px); }
.c-count { font-size: .85rem; color: var(--ink-soft); }

/* ---------- Catalogue ---------- */

.catalogue { max-width: 1160px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 48px); }

.dept-head {
  display: grid; justify-items: center; gap: 4px; text-align: center;
  padding: clamp(44px, 6vw, 72px) 0 26px;
  scroll-margin-top: 80px;
}
.dept-num { font-size: .78rem; letter-spacing: .3em; text-transform: uppercase; color: var(--burgundy); }
.dept-head h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.dept-head::after {
  content: '❦'; color: var(--tan); font-size: 1.1rem; margin-top: 8px;
}

.plate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 44px); }

.plate-card {
  text-decoration: none; color: var(--ink);
  display: grid; gap: 0; align-content: start;
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 14px;
  box-shadow: 0 8px 22px rgba(54, 42, 30, .07);
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
}
.plate-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(54, 42, 30, .12); }

.plate-photo { position: relative; overflow: hidden; }
.plate-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .5s ease; }
.plate-card:hover .plate-photo img { transform: scale(1.025); }

.plate-no {
  position: absolute; top: 10px; left: 10px;
  background: var(--paper); border: 1px dashed var(--burgundy);
  color: var(--burgundy); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  padding: 4px 10px;
}

.plate-body { display: grid; gap: 4px; padding: 14px 6px 6px; }
.plate-body h3 { font-size: 1.35rem; }
.plate-fabric { font-style: italic; color: var(--ink-soft); font-size: .95rem; }

.plate-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }

/* Hangtag price: a little tag with a punched hole. */
.tag {
  position: relative; background: var(--paper);
  border: 1px solid var(--tan);
  padding: 5px 12px 5px 22px; font-weight: 600; font-size: 1rem;
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
}
.tag::before {
  content: ''; position: absolute; left: 9px; top: 50%; translate: 0 -50%;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--paper); box-shadow: 0 0 0 1.5px var(--tan);
}
.plate-view { margin-left: auto; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--burgundy); }

/* ---------- Product page ---------- */

.plate-page { max-width: 1080px; margin: 0 auto; padding: 20px clamp(18px, 4vw, 48px) 40px; }
.crumb { padding: 8px 0 18px; }
.crumb a { text-decoration: none; font-style: italic; }

.plate-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(26px, 5vw, 60px); align-items: start; }

.detail-photo {
  background: var(--card); border: 1px solid var(--rule); padding: 14px;
  box-shadow: 0 8px 22px rgba(54, 42, 30, .07);
  position: relative;
}
.detail-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.detail-body { display: grid; gap: 14px; }
.detail-kicker { font-size: .78rem; letter-spacing: .3em; text-transform: uppercase; color: var(--burgundy); }
.detail-body h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.detail-fabric { font-style: italic; color: var(--ink-soft); }
.detail-desc { max-width: 52ch; }
.detail-note { font-style: italic; color: var(--ink-soft); font-size: .95rem; }

.detail-price { font-family: 'Libre Caslon Display', serif; font-size: 1.9rem; }

.size-label { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.size-row { display: flex; flex-wrap: wrap; gap: 8px; }
.size-btn {
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
  min-width: 52px; padding: 8px 12px; border-radius: 3px; font-weight: 500;
  transition: border-color .15s ease, background .15s ease;
}
.size-btn:hover { border-color: var(--burgundy); }
.size-btn.is-on { border: 1.5px solid var(--burgundy); background: #EFE0D6; color: var(--burgundy-deep); font-weight: 600; }

.detail-cta { display: flex; align-items: center; gap: 16px; margin-top: 6px; flex-wrap: wrap; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: 3px; background: var(--card); }
.qty button { width: 38px; height: 42px; border: none; background: none; font-size: 1.2rem; color: var(--burgundy); }
.qty output { min-width: 30px; text-align: center; font-weight: 600; }

.add-btn {
  background: var(--burgundy); color: var(--paper); border: none; border-radius: 3px;
  padding: 13px 26px; font-weight: 600; letter-spacing: .04em; font-size: 1rem;
  transition: background .15s ease;
}
.add-btn:hover { background: var(--burgundy-deep); }
.add-btn.added { background: #47611F; }

.not-found { text-align: center; padding: 60px 0; }

/* ---------- Shop section ---------- */

.shop { max-width: 860px; margin: 0 auto; padding: clamp(44px, 7vw, 80px) clamp(18px, 4vw, 48px) 20px; text-align: center; }
.shop-rule { height: 1px; background: var(--rule); margin-bottom: 34px; }
.shop h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 20px; }
.shop-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; text-align: left; }

/* ---------- Order book ---------- */

.book-veil {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(38, 28, 18, .45);
}
.book-veil[hidden], .book[hidden] { display: none; }

.book {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(430px, 94vw);
  background: var(--card);
  border-left: 1px solid var(--rule);
  box-shadow: -18px 0 40px rgba(38, 28, 18, .25);
  display: flex; flex-direction: column;
  overflow-y: auto;
  /* Ledger rulings */
  background-image: repeating-linear-gradient(
    to bottom, transparent 0, transparent 31px, rgba(110, 59, 52, .08) 31px, rgba(110, 59, 52, .08) 32px);
}

.book-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 20px 22px 12px; border-bottom: 1.5px solid var(--burgundy);
}
.book-head h2 { font-size: 1.6rem; }
.book-close { border: none; background: none; color: var(--burgundy); font-weight: 600; font-size: .9rem; }

.book-lines { list-style: none; padding: 6px 22px; }
.book-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 10px 0; border-bottom: 1px dotted var(--rule); }
.bl-name { font-weight: 600; }
.bl-detail { grid-column: 1; font-style: italic; color: var(--ink-soft); font-size: .9rem; }
.bl-price { text-align: right; font-weight: 600; }
.bl-ctl { grid-column: 1 / -1; display: flex; gap: 14px; margin-top: 2px; }
.bl-btn { border: none; background: none; color: var(--burgundy); font-size: .85rem; font-style: italic; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

.book-empty { padding: 22px; font-style: italic; color: var(--ink-soft); }

.book-tail { padding: 10px 22px 26px; display: grid; gap: 16px; }

.book-sums > div { display: flex; justify-content: space-between; padding: 4px 0; }
.sum-total { border-top: 1.5px solid var(--ink); margin-top: 6px; padding-top: 10px !important; font-size: 1.15rem; font-weight: 600; }

#orderForm { display: grid; gap: 12px; }

.fulfil-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fulfil-btn {
  border: 1px solid var(--rule); background: var(--paper); border-radius: 3px;
  padding: 10px 8px; font-weight: 500; font-size: .92rem; color: var(--ink-soft);
}
.fulfil-btn.is-on { border: 1.5px solid var(--burgundy); color: var(--burgundy-deep); background: #EFE0D6; font-weight: 600; }

.field { display: grid; gap: 4px; }
.field label { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.field input {
  border: none; border-bottom: 1.5px solid var(--rule); background: transparent;
  padding: 7px 2px; font: inherit; color: var(--ink);
}
.field input:focus { outline: none; border-bottom-color: var(--burgundy); }
.field input.bad { border-bottom-color: #A03325; }
.err { color: #A03325; font-size: .88rem; font-style: italic; }

.place-btn {
  background: var(--burgundy); color: var(--paper); border: none; border-radius: 3px;
  padding: 14px; font-weight: 600; font-size: 1.02rem; margin-top: 4px;
}
.place-btn:hover { background: var(--burgundy-deep); }
.book-fine { font-size: .85rem; font-style: italic; color: var(--ink-soft); }

.book-done { display: grid; gap: 10px; padding: 10px 0 20px; }
.book-done h3 { font-size: 1.4rem; }
.book-done p { color: var(--ink-soft); }

/* ---------- Footer ---------- */

.foot {
  margin-top: clamp(50px, 8vw, 90px);
  border-top: 1px solid var(--rule);
  padding: 40px clamp(18px, 4vw, 48px) 50px;
  text-align: center; display: grid; gap: 8px;
}
.foot-mark { font-family: 'Libre Caslon Display', serif; font-size: 1.5rem; }
.foot-line { color: var(--ink-soft); font-size: .95rem; }
.foot-fine { font-size: .85rem; color: var(--ink-soft); max-width: 72ch; margin: 8px auto 0; }

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .plate-grid { grid-template-columns: minmax(0, 1fr); max-width: 480px; margin-inline: auto; }
  .plate-detail { grid-template-columns: minmax(0, 1fr); }
  .detail-photo { max-width: 480px; }
  .shop-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .top { gap: 12px; }
  .top-nav { display: none; }
  .book-btn { margin-left: auto; }
  .cover { min-height: 74vh; }
  .fulfil-row { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plate-card, .plate-photo img { transition: none; }
}
