/* ==========================================================================
   Ninth & Rye — a warm shopfront over a working sheet.

   The layout follows a conventional bakery storefront: banded header, hero,
   a row of marks, a feature, a product grid, about, visit. What sits inside
   the grid is not conventional — the cards read the clock, so the shelf on
   the page empties at the same rate the shelf in the room does.

   Two voices, as the case study documents: Instrument Serif for anything
   spoken, DM Mono for anything counted.
   ========================================================================== */

:root {
  /* the case study's palette */
  --night: #14110e;
  --crust: #d98a3f;
  --cream: #f2e8d5;
  --ash:   #9a8f7e;

  /* bands and ink derived from it */
  --tan:      #ecd3a5;
  --tan-deep: #e2c288;
  --paper:    #fdf8ec;
  --terra:    #b0561f;
  --ink:      #2c231a;
  --ink-soft: #6b5c4a;
  --rule:     #e0d2b8;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono:  'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --bay:  clamp(56px, 7vw, 104px);
  --wrap: 1180px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 40px);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--night);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px 18px;
}
.skip:focus { left: 0; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* every line-art icon shares one stroke treatment */
svg { stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------- concept note */

.concept {
  background: var(--night);
  color: #a89880;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 9px 16px;
}
.concept a { color: var(--crust); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 30px;
  background: var(--terra);
  color: #fff;
  border: 1px solid var(--terra);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}
.btn:hover { background: #96461a; border-color: #96461a; }
.btn:focus-visible { outline: 2px solid var(--night); outline-offset: 3px; }

.btn-line { background: transparent; color: var(--terra); }
.btn-line:hover { background: var(--terra); color: #fff; }

/* ---------------------------------------------------------------- topbar */

.topbar { background: var(--tan); }

.topbar-in {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding-block: 16px;
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-self: start;
  width: min(260px, 100%);
  padding: 9px 15px;
  border: 1px solid #cfae74;
  border-radius: 999px;
  background: rgba(255,255,255,0.34);
  color: var(--ink-soft);
  transition: border-color 200ms ease, background 200ms ease;
}
.search:focus-within { border-color: var(--terra); background: rgba(255,255,255,0.7); }
.search .ic { width: 15px; height: 15px; flex: none; }
.search input {
  width: 100%;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
}
.search input::placeholder { color: #93805f; }
.search input:focus { outline: none; }

.mark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--terra);
  text-decoration: none;
}
.mark-ic { width: 32px; height: 24px; flex: none; }
.mark span {
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1;
  letter-spacing: 0.01em;
}

.tools { display: flex; align-items: center; gap: 6px; justify-self: end; }

.tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  background: none;
  color: var(--terra);
  cursor: pointer;
  padding: 0;
  transition: color 200ms ease;
}
.tool:hover { color: var(--night); }
.tool:focus-visible { outline: 2px solid var(--terra); outline-offset: 1px; }
.tool .ic { width: 20px; height: 20px; }

.count {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--terra);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 17px;
  text-align: center;
}

/* ------------------------------------------------------------- main nav */

.mainnav { border-top: 1px solid #d9b982; }
.mainnav-in {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(24px, 6vw, 88px);
  padding-block: 15px;
}
.mainnav a {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  padding: 5px 2px;
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}
.mainnav a:hover { color: var(--terra); border-bottom-color: var(--terra); }

/* ----------------------------------------------------------------- hero */

.hero { background: var(--tan); padding-bottom: clamp(34px, 5vw, 60px); }

.hero-say {
  font-family: var(--serif);
  font-size: clamp(35px, 6.4vw, 72px);
  line-height: 1.07;
  text-align: center;
  color: var(--ink);
  padding-block: clamp(34px, 5vw, 62px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: clamp(12px, 1.8vw, 22px);
  align-items: stretch;
}

.shot { margin: 0; overflow: hidden; background: var(--tan-deep); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot-a, .shot-b { aspect-ratio: 3 / 4; }

.hero-side { display: grid; grid-template-rows: 1fr auto; gap: clamp(12px, 1.8vw, 22px); }
.shot-c { min-height: 150px; }

.hero-cta { display: grid; gap: 15px; align-content: start; }
.hero-cta p { font-size: 17px; line-height: 1.5; color: #5a4a35; }
.hero-cta .btn { width: 100%; }

/* ---------------------------------------------------------------- marks */

.marks { padding: clamp(40px, 5.5vw, 74px) 0; }

.marks-in {
  list-style: none;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(16px, 2.6vw, 34px);
}
.marks-in li {
  display: grid;
  justify-items: center;
  gap: 13px;
  text-align: center;
  color: var(--ink-soft);
}
.marks-in svg { width: 40px; height: 40px; color: var(--terra); }
.marks-in span {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: 0.03em;
}

/* -------------------------------------------------------------- feature */

.feature {
  margin-bottom: clamp(48px, 6vw, 84px);
  background:
    linear-gradient(90deg, rgba(15,12,9,0.93) 0%, rgba(15,12,9,0.86) 42%, rgba(15,12,9,0.34) 100%),
    url('https://images.unsplash.com/photo-1555507036-ab1f4038808a?w=1600&q=85&auto=format&fit=crop') center/cover no-repeat;
  color: var(--cream);
}

.feature-in { padding-block: clamp(52px, 7vw, 104px); }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--crust);
  margin-bottom: 16px;
}

.feature-say { font-size: clamp(29px, 4.4vw, 50px); line-height: 1.12; max-width: 17ch; }

.feature-price { font-family: var(--mono); margin: 20px 0 26px; }
.feature-price .money { font-size: 25px; }
.feature-price .per { font-size: 13px; color: var(--ash); }

/* ---------------------------------------------------------------- sheet */

.sheet { padding-bottom: var(--bay); }

.sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: clamp(22px, 3vw, 34px);
}
.sheet-head h2 { font-size: clamp(28px, 3.6vw, 42px); }

.live {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2vw, 24px);
}

.card {
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--cream);
  border: 1px solid var(--rule);
  overflow: hidden;
  transition: border-color 220ms ease;
}
.card:hover { border-color: #cdb489; }

.card-top { position: relative; aspect-ratio: 4 / 3; background: var(--tan-deep); }
.card-top img { width: 100%; height: 100%; object-fit: cover; }

.tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 10px;
  background: var(--tan);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.tag-low { background: var(--crust); color: var(--night); }
.tag-off { background: rgba(20,17,14,0.82); color: var(--cream); }

.save {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(253,248,236,0.9);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  transition: color 200ms ease;
}
.save svg { width: 17px; height: 17px; }
.save:hover,
.save[aria-pressed="true"] { color: var(--terra); }
.save[aria-pressed="true"] svg { fill: var(--terra); }
.save:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }

/* Flow, not tracks: names run to one or two lines and the buy row still has
   to sit on the same baseline across the whole grid. */
.card-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 15px 15px 16px;
}
.card-name { font-size: 21px; line-height: 1.2; }
.card-note {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ash);
}

.card-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
}
.card-price { font-family: var(--mono); font-size: 14px; }
.card-price .per { color: var(--ash); font-size: 11.5px; }

.add {
  border: 1px solid var(--terra);
  background: var(--terra);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 13px;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}
.add:hover { background: #96461a; border-color: #96461a; }
.add:focus-visible { outline: 2px solid var(--night); outline-offset: 2px; }
.add[disabled] {
  background: transparent;
  border-color: #cbbb9e;
  color: var(--ash);
  cursor: not-allowed;
}

/* a sold-out line stays on the sheet, struck through, until tomorrow */
.card.is-out .card-top img { filter: grayscale(0.85) brightness(1.06); opacity: 0.55; }
.card.is-out .card-name { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--ash); }

.no-match { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); padding: 26px 0; }

.sheet-note {
  margin-top: clamp(24px, 3vw, 36px);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------------------------------------------------------------- about */

.about { background: var(--cream); padding: var(--bay) 0; }

.about-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
}
.about-say h2 { font-size: clamp(28px, 3.6vw, 42px); margin-bottom: 20px; }
.about-say p { font-size: 17px; line-height: 1.72; color: var(--ink-soft); max-width: 54ch; }
.about-say p + p { margin-top: 14px; }
.about-say b { color: var(--ink); font-weight: 400; border-bottom: 1px solid var(--crust); }
.about-say .btn { margin-top: 26px; }

.about-shot { margin: 0; overflow: hidden; aspect-ratio: 4 / 5; background: var(--tan-deep); }
.about-shot img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- visit */

.contact { padding: var(--bay) 0; }

.contact-in {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(30px, 5vw, 70px);
  align-items: start;
}
.contact-say h2 { font-size: clamp(28px, 3.6vw, 42px); margin-bottom: 24px; }

.info { margin: 0; display: grid; gap: 20px; }
.info dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 5px;
}
.info dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}
.info a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--crust); }
.info a:hover { color: var(--terra); }
.info .shut { color: var(--terra); }

.map { border: 1px solid var(--rule); overflow: hidden; }
.map svg { width: 100%; height: auto; display: block; stroke: none; }
.m-bg    { fill: #f4ecdc; }
.m-block { fill: #e8dcc4; }
.m-park  { fill: #dfe6cf; }
.m-road  { stroke: #fdf8ec; stroke-width: 9; }
.m-main  { stroke: #f6dfae; stroke-width: 13; }
.m-pin   { fill: var(--terra); stroke: none; }
.m-pin circle { fill: #fdf8ec; }
.m-label {
  fill: #a49173;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  stroke: none;
}

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

.foot { background: var(--night); color: var(--ash); padding: clamp(34px, 4.5vw, 58px) 0; }

.foot-in {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(24px, 4vw, 50px);
  align-items: start;
}

.foot-mark { display: inline-flex; align-items: center; gap: 11px; color: var(--crust); }
.foot-mark span { font-family: var(--serif); font-size: 24px; line-height: 1; }

.foot-nav { display: grid; gap: 9px; justify-items: center; }
.foot-nav a {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--cream);
  text-decoration: none;
  transition: color 200ms ease;
}
.foot-nav a:hover { color: var(--crust); }

.foot-fine { font-family: var(--mono); font-size: 11.5px; line-height: 1.75; text-align: right; }
.foot-fine a { color: var(--crust); }

/* ----------------------------------------------------------- responsive */

@media (max-width: 1000px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .marks-in { grid-template-columns: repeat(3, 1fr); row-gap: 30px; }
  .about-in, .contact-in { grid-template-columns: 1fr; }
  .about-shot { aspect-ratio: 16 / 10; }
}

@media (max-width: 760px) {
  .topbar-in { grid-template-columns: 1fr auto; row-gap: 14px; }
  .search { grid-row: 2; grid-column: 1 / -1; width: 100%; }
  .mark { justify-self: start; }

  .hero-grid { grid-template-columns: 1fr 1fr; }
  .hero-side { grid-column: 1 / -1; grid-template-rows: auto; grid-template-columns: 1fr 1fr; align-items: center; }
  .shot-c { aspect-ratio: 4 / 3; }

  .foot-in { grid-template-columns: 1fr; justify-items: start; }
  .foot-nav { justify-items: start; }
  .foot-fine { text-align: left; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .cards { grid-template-columns: 1fr; }
  .marks-in { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .hero-side { grid-template-columns: 1fr; }
  .shot-a, .shot-b { aspect-ratio: 4 / 3; }
  .feature { background-position: 68% center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
