/* Kilang Kopi: the first screen is composed for a 1440 x 852 viewport (the
   coverflow preview); the rest of the page and the phone layout follow it. */

:root {
  --espresso: #2a1d16;
  --roast: #4b382c;
  --ink: #2a1d16;
  --ink-soft: rgba(42, 29, 22, 0.66);
  --ink-faint: rgba(42, 29, 22, 0.48);
  --rule: rgba(42, 29, 22, 0.16);
  --cream: #f3ece1;
  --paper: #f8f3eb;
  --kraft: #c8aa84;
  --terracotta: #a65a3f;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --ui: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;

  --gutter: 56px;
  --announce-h: 34px;
  --header-h: 76px;
  --roasting-h: 186px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
p, h1, h2, h3, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; }
[id] { scroll-margin-top: 24px; }
img { display: block; max-width: 100%; }

/* Announcement bar */
.announce {
  height: var(--announce-h);
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--espresso);
  color: #eadfcf;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.announce p:nth-child(2) { text-align: center; color: #f6efe4; }
.announce p:last-child { text-align: right; }

/* Header */
.masthead {
  position: relative;
  height: var(--header-h);
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
}

.nav { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav--utility { justify-content: flex-end; gap: 26px; }
.nav a { color: var(--ink); }
.nav--primary a[aria-current="page"] { box-shadow: inset 0 -1px 0 currentColor; padding-bottom: 2px; }

.util { display: inline-flex; align-items: center; gap: 8px; }
.util svg { color: var(--ink); }
.count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--espresso);
  color: var(--paper);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.count.is-bump { animation: bump 0.45s cubic-bezier(0.2, 0.7, 0.1, 1); }
@keyframes bump { 40% { transform: scale(1.35); background: var(--terracotta); } }

.menu-toggle { display: none; }

.brand { display: grid; justify-items: center; gap: 3px; }
.brand__name {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.015em;
}
.brand__sub {
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 44.4445% 1fr; /* 640px at 1440 */
  /* fills what the announcement, header and roasting strip leave of the first screen */
  height: clamp(460px, calc(100svh - var(--studio-bar-h, 0px) - var(--announce-h) - var(--header-h) - var(--roasting-h)), 820px);
}

.hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 48px 8px var(--gutter);
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
}

h1 {
  margin-top: 24px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 74px;
  line-height: 0.98;
  letter-spacing: -0.028em;
}
h1 em { font-style: italic; font-weight: 300; letter-spacing: -0.02em; }

.lede {
  margin-top: 28px;
  max-width: 440px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.actions { margin-top: 36px; display: flex; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 28px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.btn--solid { background: var(--espresso); color: var(--paper); }
.btn--line { box-shadow: inset 0 0 0 1px rgba(42, 29, 22, 0.5); }

.hero__media {
  position: relative;
  overflow: hidden;
  background: #3b2b20;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 0% 50%;
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: linear-gradient(to top, rgba(24, 15, 10, 0.55), rgba(24, 15, 10, 0));
  pointer-events: none;
}
.hero__media figcaption {
  z-index: 1;
  position: absolute;
  right: 28px;
  bottom: 22px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(248, 243, 235, 0.82);
}

/* On the roaster this week */
.roasting {
  height: var(--roasting-h);
  display: grid;
  /* product cells are 236px; the second rule lands exactly on the 640px hero split */
  grid-template-columns: 28.0556% 49.1667% 1fr; /* 404 / 708 / 328px at 1440 */
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

.roasting__intro {
  padding: 26px 40px 24px var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.roasting__intro h2 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.roasting__intro p {
  margin-top: 12px;
  max-width: 290px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.link {
  margin-top: auto;
  font-size: 13px;
  font-weight: 500;
  padding-bottom: 2px;
  box-shadow: inset 0 -1px 0 currentColor;
}

.roasting__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.roasting__list li { border-left: 1px solid var(--rule); }
.roast {
  height: 100%;
  padding: 26px 24px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto 1fr;
  grid-template-areas:
    "kicker kicker"
    "name name"
    "notes notes"
    "size price";
}
.roast__kicker {
  grid-area: kicker;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-faint);
}
.roast__name {
  grid-area: name;
  margin-top: 8px;
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.roast__notes {
  grid-area: notes;
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.roast__size { grid-area: size; align-self: end; font-size: 12px; color: var(--ink-faint); }
.roast__price {
  grid-area: price;
  align-self: end;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.subscribe {
  display: grid;
  grid-template-columns: 112px 1fr;
  border-left: 1px solid var(--rule);
  background: #ece2d3;
}
.subscribe img {
  width: 112px;
  height: 100%;
  object-fit: cover;
  object-position: 42% 62%;
}
.subscribe__body {
  padding: 26px 32px 24px 24px;
  display: flex;
  flex-direction: column;
}
.subscribe__kicker {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.subscribe__title {
  margin-top: 8px;
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.subscribe__note { margin-top: auto; font-size: 12px; color: var(--ink-soft); }

/* Below the first screen */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.section-head > p { max-width: 420px; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.section-head h2,
.sub h2,
.visit h2 {
  margin-top: 18px;
  font-family: var(--display);
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.026em;
  text-wrap: balance;
}
.section-head h2 em,
.sub h2 em,
.visit h2 em { font-style: italic; font-weight: 300; }

/* This week's coffee */
.coffee { padding: 112px var(--gutter) 120px; }
.coffee__list { margin-top: 56px; border-top: 1px solid var(--ink); }
.bean {
  display: grid;
  grid-template-columns: 2.2fr 2fr 1.3fr 0.9fr auto;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}
.bean__origin h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.012em;
}
.bean__origin p { margin-top: 4px; color: var(--ink-faint); font-size: 13px; }
.bean__notes { color: var(--ink-soft); font-size: 14.5px; }
.bean__roast { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 13px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(42, 29, 22, 0.4); }
.dots i:nth-child(-n + 1) { background: var(--roast); box-shadow: none; }
[style*="--level: 2"] i:nth-child(-n + 2),
[style*="--level: 3"] i:nth-child(-n + 3),
[style*="--level: 4"] i:nth-child(-n + 4),
[style*="--level: 5"] i:nth-child(-n + 5) { background: var(--roast); box-shadow: none; }
.bean__price { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bean__price span { margin-left: 6px; color: var(--ink-faint); font-size: 12px; font-weight: 400; }
.bean__add {
  min-width: 96px;
  height: 42px;
  padding: 0 22px;
  box-shadow: inset 0 0 0 1px rgba(42, 29, 22, 0.5);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}
.bean__add:hover { background: var(--espresso); color: var(--paper); }

/* Subscription */
.sub {
  display: grid;
  grid-template-columns: 44.4445% 1fr;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.sub__media { min-height: 760px; overflow: hidden; background: #e9dccb; }
.sub__media img { width: 100%; height: 100%; object-fit: cover; object-position: 45% 50%; }
.sub__body { align-self: center; max-width: 660px; padding: 96px var(--gutter) 96px 88px; }
.sub__lede { max-width: 480px; margin-top: 24px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.6; }

.choice { margin: 36px 0 0; padding: 0; border: 0; min-width: 0; }
.choice legend {
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.choice__options { display: grid; gap: 10px; margin-top: 14px; }
.choice__options--plans { grid-template-columns: repeat(3, 1fr); }
.choice__options--grind { grid-template-columns: repeat(4, auto); justify-content: start; }
.choice label { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.choice label > span {
  display: block;
  height: 100%;
  box-shadow: inset 0 0 0 1px rgba(42, 29, 22, 0.28);
  background: var(--cream);
  transition: box-shadow 0.2s, background-color 0.2s, color 0.2s;
}
.choice label:hover > span { box-shadow: inset 0 0 0 1px var(--ink); }
.choice input:checked + span { box-shadow: inset 0 0 0 2px var(--espresso); background: #fffaf2; }
.choice input:focus-visible + span { outline: 2px solid var(--terracotta); outline-offset: 3px; }
.choice__options--plans label > span { display: grid; gap: 4px; padding: 18px; }
.choice__options--plans b { font-family: var(--display); font-size: 20px; font-weight: 400; }
.choice__options--plans em { color: var(--ink-faint); font-size: 12.5px; font-style: normal; }
.choice__options--plans strong { margin-top: 12px; font-size: 15px; font-weight: 500; }
.choice__options--grind span { padding: 11px 18px; font-size: 13.5px; }
.choice__options--grind input:checked + span { background: var(--espresso); color: var(--paper); box-shadow: none; }
.sub__body > .btn { margin-top: 36px; }

/* Brew guides */
.guides { padding: 112px var(--gutter) 120px; }
.guides__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 56px;
}
.guide { display: flex; flex-direction: column; padding: 32px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); }
.guide h3 { font-family: var(--display); font-size: 28px; font-weight: 400; letter-spacing: -0.012em; }
.guide p { margin-top: 12px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.guide dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: auto;
  padding-top: 28px;
}
.guide dl div { padding-top: 14px; border-top: 1px solid var(--rule); }
.guide dt { color: var(--ink-faint); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.guide dd { margin-top: 6px; font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* Visit the bar */
.visit {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  align-items: center;
  gap: 80px;
  padding: 0 var(--gutter) 120px;
}
.visit__copy { max-width: 480px; }
.visit__copy h2 + p { margin-top: 24px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.6; }
.visit__facts { display: grid; gap: 18px; margin: 32px 0 36px; padding-top: 24px; border-top: 1px solid var(--rule); }
.visit__facts div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; }
.visit__facts dt { color: var(--ink-faint); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.visit__facts dd { font-size: 15px; line-height: 1.5; }
.visit__media { aspect-ratio: 4 / 3; overflow: hidden; background: #3b2b20; }
.visit__media img { width: 100%; height: 100%; object-fit: cover; }

/* Footer */
.footer { padding: 72px var(--gutter) 40px; background: var(--espresso); color: #eadfcf; }
.footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(234, 223, 207, 0.14);
}
.footer .brand__name { font-size: 34px; color: var(--paper); }
.footer__brand p { max-width: 320px; margin-top: 16px; color: rgba(234, 223, 207, 0.66); font-size: 14px; line-height: 1.6; }
.footer__links { display: grid; gap: 12px; align-content: start; font-size: 14px; }
.footer__links a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 5px; }
.footer__fine { margin-top: 28px; color: rgba(234, 223, 207, 0.5); font-size: 12.5px; }

/* Narrower windows */
@media (max-width: 1240px) {
  :root { --gutter: 32px; }
  .nav { gap: 20px; }
  .util--account { display: none; }
  h1 { font-size: 62px; }
  .roasting { grid-template-columns: 1fr 2fr; }
  .roasting__list li:nth-child(3) { display: none; }
  .roasting__list { grid-template-columns: repeat(2, 1fr); }
  .subscribe { display: none; }
  .bean { grid-template-columns: 2fr 1.6fr 1.2fr auto; }
  .bean__roast { display: none; }
  .sub__body { padding-left: 48px; }
  .choice__options--grind { grid-template-columns: repeat(2, auto); }
}

/* Tablet and phone: one column, everything reflows */
@media (max-width: 880px) {
  :root { --gutter: 20px; }

  .announce { height: auto; display: block; padding: 9px var(--gutter); text-align: center; }
  .announce p:not(:nth-child(2)) { display: none; }

  .masthead { height: 64px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 10px; justify-self: start; font-size: 14px; }
  .menu-toggle__bars { display: grid; gap: 5px; width: 18px; }
  .menu-toggle__bars i { display: block; height: 1.5px; background: currentColor; transition: transform 0.3s; }
  .is-open .menu-toggle__bars i:first-child { transform: translateY(3.25px) rotate(45deg); }
  .is-open .menu-toggle__bars i:last-child { transform: translateY(-3.25px) rotate(-45deg); }
  .nav--primary {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--cream);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 24px 40px -28px rgba(42, 29, 22, 0.4);
    font-size: 17px;
  }
  .is-open .nav--primary { display: flex; }
  .nav--primary a { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .nav--primary a[aria-current="page"] { box-shadow: none; }
  .util--search { display: none; }
  .brand__name { font-size: 22px; }
  .brand__sub { font-size: 8.5px; }

  .hero { height: auto; grid-template-columns: 1fr; }
  .hero__media { order: -1; aspect-ratio: 4 / 3; }
  .hero__media figcaption { right: 14px; bottom: 12px; font-size: 11px; }
  .hero__copy { padding: 36px var(--gutter) 40px; }
  h1 { margin-top: 18px; font-size: 52px; }
  .lede { margin-top: 20px; font-size: 15.5px; }
  .actions { margin-top: 28px; flex-wrap: wrap; }

  .roasting { height: auto; display: block; }
  .roasting__intro { padding: 28px var(--gutter) 16px; }
  .roasting__intro .link { margin-top: 14px; }
  .roasting__list {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: minmax(230px, 70%);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
  }
  .roasting__list::-webkit-scrollbar { display: none; }
  .roasting__list li, .roasting__list li:nth-child(3) { display: block; scroll-snap-align: start; }
  .roasting__list li:first-child { border-left: 0; }
  .roast { min-height: 170px; padding: 22px var(--gutter); }
  .subscribe { display: grid; grid-template-columns: 96px 1fr; min-height: 132px; border-left: 0; }
  .subscribe img { width: 96px; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .section-head h2, .sub h2, .visit h2 { font-size: 38px; }
  .coffee, .guides { padding: 72px var(--gutter) 80px; }
  .coffee__list { margin-top: 36px; }
  .bean {
    grid-template-columns: 1fr auto;
    grid-template-areas: "origin price" "notes notes" "roast add";
    gap: 10px 16px;
    padding: 22px 0;
  }
  .bean__origin { grid-area: origin; }
  .bean__notes { grid-area: notes; }
  .bean__roast { grid-area: roast; display: flex; }
  .bean__price { grid-area: price; align-self: start; text-align: right; }
  .bean__price span { display: block; margin: 2px 0 0; }
  .bean__add { grid-area: add; }
  .bean__origin h3 { font-size: 21px; }

  .sub { grid-template-columns: 1fr; }
  .sub__media { min-height: 0; aspect-ratio: 4 / 3; }
  .sub__body { max-width: none; padding: 48px var(--gutter) 64px; }
  .choice__options--plans { grid-template-columns: 1fr; }
  .choice__options--plans label > span { grid-template-columns: 1fr auto; align-items: baseline; }
  .choice__options--plans em { grid-row: 2; }
  .choice__options--plans strong { grid-row: 1 / span 2; grid-column: 2; align-self: center; margin-top: 0; }
  .choice__options--grind { grid-template-columns: repeat(2, 1fr); }
  .choice__options--grind span { text-align: center; }

  .guides__grid { grid-template-columns: 1fr; margin-top: 36px; }
  .guide { padding: 24px; }

  .visit { grid-template-columns: 1fr; gap: 36px; padding: 0 var(--gutter) 80px; }
  .visit__media { order: -1; }
  .visit__facts div { grid-template-columns: 110px 1fr; }

  .footer { padding: 56px var(--gutter) 40px; }
  .footer__top { grid-template-columns: 1fr 1fr; gap: 36px 20px; padding-bottom: 40px; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .menu-toggle__label { display: none; }
  h1 { font-size: 46px; }
}
