/* ════════════════════════════════════════════════════════
   Currently brewing — editorial brew journal
   Bodoni Moda × Fragment Mono · warm dark theme
   ════════════════════════════════════════════════════════ */

:root {
  --bg:       #14110d;
  --bg-rise:  #1c1812;
  --bg-deep:  #0c0a07;

  --ink:      #f2e9d4;
  --ink-2:    #d4c8ad;
  --ink-3:    #8c8270;
  --ink-4:    #5a5246;

  --rule:     #2b251c;
  --rule-2:   #3a3226;

  --accent:   #ec5340;
  --accent-2: #f47a4a;

  --serif:  "Bodoni Moda", "Didot", "Times New Roman", serif;
  --mono:   "Fragment Mono", ui-monospace, monospace;

  --gutter: clamp(20px, 4.5vw, 56px);
  --max:    1320px;
}

/* ── reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 380;
  font-optical-sizing: auto;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ── atmosphere: warm lamp glow + film grain ───────────── */
.lamp {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 50% at 78% -10%,
      rgba(236, 130, 64, .14) 0%,
      rgba(236, 130, 64, .07) 28%,
      transparent 70%),
    radial-gradient(90% 70% at 50% 120%,
      rgba(20, 8, 4, .55) 0%,
      transparent 60%);
}
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

main { position: relative; z-index: 2; }

/* skip link */
.skip {
  position: absolute;
  top: -100px; left: 12px;
  background: var(--accent);
  color: #0a0805;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 13px;
  z-index: 1000;
}
.skip:focus { top: 12px; }

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

/* ════════════════════  CONTAINER  ══════════════════════ */
.brews {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 6vw, 96px) var(--gutter) clamp(80px, 10vw, 160px);
}

/* ════════════════════  EMPTY STATE  ════════════════════ */
.empty {
  text-align: center;
  padding: clamp(80px, 16vw, 220px) 0;
  color: var(--ink-3);
}
.empty__mark {
  margin: 0 0 24px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(80px, 12vw, 160px);
  font-weight: 400;
  line-height: 1;
  color: var(--ink-4);
}
.empty__msg {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 2.4vw, 32px);
  color: var(--ink-2);
}
.empty__hint {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .04em;
}
.empty__hint code {
  background: var(--bg-rise);
  border: 1px solid var(--rule);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 2px;
  font-family: inherit;
  font-size: 12.5px;
}

/* ════════════════════  BREW SPREAD  ════════════════════ */
.brew {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: stretch;
  padding: clamp(56px, 8vw, 120px) 0;
  border-top: 1px dotted var(--rule-2);
  position: relative;
}
.brew:first-child { border-top: 0; padding-top: clamp(20px, 4vw, 48px); }

.brew__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: clamp(20px, 3vw, 40px);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 14px;
}
.brew__no {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--accent);
  font-feature-settings: "tnum";
}
/* five-star rating, supports halves via width % */
.brew__rating {
  position: relative;
  display: inline-block;
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1;
  letter-spacing: .22em;
  user-select: none;
}
.brew__rating-bg,
.brew__rating-fill {
  display: block;
  white-space: nowrap;
}
.brew__rating-bg   { color: var(--ink-4); }
.brew__rating-fill {
  position: absolute;
  top: 0; left: 0;
  overflow: hidden;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(236, 83, 64, .35);
}

/* media column — figure stacks: main frame + thumbnail strip below */
.brew__media {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── main image frame ── */
.brew__frame {
  position: relative;
  flex: 1;
  min-height: 360px;
  overflow: hidden;
  background: linear-gradient(135deg, #28201a 0%, #1a140f 60%, #14110d 100%);
  border: 1px solid var(--rule);
  box-shadow:
    inset 0 0 60px rgba(0,0,0,.5),
    0 24px 40px -20px rgba(0,0,0,.6);
}
.brew__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .35s ease;
}
.brew__media:not(.brew__media--empty) .brew__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,8,4,0) 60%, rgba(20,8,4,.45) 100%);
  pointer-events: none;
}

/* empty placeholder */
.brew__placeholder {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 3vw, 44px);
  font-weight: 400;
  color: var(--ink-4);
  padding: clamp(24px, 4vw, 56px);
  text-align: center;
  line-height: 1.1;
  letter-spacing: -.01em;
}
.brew__media--empty .brew__placeholder { display: grid; }
.brew__media--empty .brew__frame::before {
  content: "no photo";
  position: absolute;
  top: 14px; left: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-4);
  z-index: 1;
}

/* ── thumbnail strip ── */
.brew__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 10px;
}
.brew__thumb {
  position: relative;
  padding: 0;
  margin: 0;
  background: var(--bg-rise);
  border: 1px solid var(--rule);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .25s ease, transform .35s cubic-bezier(.2,.7,.2,1);
  outline: none;
}
.brew__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter .35s ease, transform .6s cubic-bezier(.2,.7,.2,1);
  filter: brightness(.7) saturate(.85);
}
.brew__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  pointer-events: none;
  transition: border-color .25s ease;
}
.brew__thumb:hover { border-color: var(--ink-4); transform: translateY(-2px); }
.brew__thumb:hover img { filter: brightness(.9); transform: scale(1.04); }
.brew__thumb.is-active { border-color: var(--accent); }
.brew__thumb.is-active img { filter: brightness(1) saturate(1); }
.brew__thumb.is-active::after { border-color: var(--accent); }
.brew__thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* empty / broken states */
.brew__tile--empty {
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 56px);
}
.brew__tile--empty .brew__placeholder {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 3vw, 44px);
  color: var(--ink-4);
  text-align: center;
  line-height: 1.1;
  letter-spacing: -.01em;
}
.brew__tile--broken::before {
  content: "no photo";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* body column */
.brew__body {
  display: flex;
  flex-direction: column;
}

.brew__title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(38px, 4.8vw, 68px);
  line-height: .98;
  letter-spacing: -.025em;
  color: var(--ink);
  font-variation-settings: "opsz" 72;
}
.brew__title em {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}

.brew__sub {
  margin: 0 0 clamp(24px, 3vw, 40px);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.brew__bullet { color: var(--ink-4); }

/* tasting notes — small mono tags with hairline borders */
.brew__notes {
  list-style: none;
  margin: 0 0 clamp(24px, 3vw, 36px);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.brew__notes li {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 6px 10px;
  border: 1px solid var(--rule-2);
  border-radius: 2px;
}

/* spec sheet */
.brew__specs {
  margin: 0 0 clamp(24px, 3vw, 36px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.brew__specs > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dotted var(--rule-2);
  align-items: baseline;
}
.brew__specs > div:nth-last-child(1),
.brew__specs > div:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.brew__specs > div:nth-child(odd) { padding-right: 18px; border-right: 1px dotted var(--rule-2); }
.brew__specs > div:nth-child(even) { padding-left: 18px; }
.brew__specs dt {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.brew__specs dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  font-style: italic;
  line-height: 1.3;
}

/* prose */
.brew__prose p {
  margin: 0 0 16px;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.65;
  max-width: 56ch;
}
.brew__prose p:first-child::first-letter {
  font-family: var(--serif);
  font-style: italic;
  font-size: 2.6em;
  line-height: .85;
  float: left;
  padding: 4px 10px 0 0;
  color: var(--accent);
  font-weight: 400;
}

/* ── flipped layout: media on the right ── */
.brew--flip .brew__media { grid-column: 2; }
.brew--flip .brew__body  { grid-column: 1; grid-row: 1; }

/* ════════════════════  RESPONSIVE  ═════════════════════ */
@media (max-width: 880px) {
  .brew,
  .brew--flip {
    grid-template-columns: 1fr;
    gap: clamp(24px, 4vw, 36px);
  }
  .brew__media,
  .brew--flip .brew__media { grid-column: 1; }
  .brew__frame { aspect-ratio: 3 / 2; flex: initial; min-height: 0; }
  .brew__body,
  .brew--flip .brew__body { grid-column: 1; grid-row: auto; }
  .brew__specs { grid-template-columns: 1fr; }
  .brew__specs > div { border-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }
  .brew__specs > div { border-bottom: 1px dotted var(--rule-2); }
}

@media (max-width: 520px) {
  .brew__title { font-size: clamp(32px, 9vw, 48px); }
  .brew__media { aspect-ratio: 4 / 3; }
  .brew__specs > div { grid-template-columns: 80px 1fr; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .brew__thumb { transition: none; }
}
