/* Coffee Ghor, the one passion-project page.

   Loaded only by /built/coffee-ghor. It adds to the shared system and
   overrides nothing in it: the type, the rows, the rules and the buttons are
   the site's own. What it adds is room. The other builds are told in prose;
   this one is told mostly by the app's own screens, so the page opens wider
   than the reading column wherever there is a picture to show. */

.cg-wide { width: min(1080px, calc(100% - 40px)); margin-inline: auto; }

/* ---- opening: the story on the left, the app running on the right ------ */
/* In the reading column, so the headline shares its left edge with the mark
   in the header. Only the screenshots further down break wider. */
.cg-open {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 250px);
  align-items: center; gap: clamp(28px, 5vw, 56px);
  padding-top: clamp(20px, 4vw, 48px);
}
.cg-open .page-open { padding: 0; }
.cg-open .page-open h1 { max-width: 15ch; text-wrap: balance; }
.cg-lede { margin: 18px 0 0; max-width: 46ch; font-size: 16px; line-height: 1.65; }
.cg-meta { margin-top: 22px; flex-wrap: wrap; justify-content: flex-start; gap: 10px 22px; }
.cg-tag { color: var(--paper); }

.cg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 28px; }
.cg-textlink {
  min-height: 44px; display: inline-flex; align-items: center; gap: 8px;
  color: var(--gray); text-decoration: none; font: 400 13.5px/1 Archivo, sans-serif;
  transition: color .2s var(--ease);
}
.cg-textlink:hover { color: var(--paper); }
.cg-textlink .icon { color: var(--signal); transition: transform .3s var(--ease); }
.cg-textlink:hover .icon { transform: translateX(3px); }

/* The demo is the app's own recording, already in a phone frame on a clear
   ground, so it sits straight on the page. A low light under it lifts the
   phone off the near-black the way a counter light would; it is the app's
   own warm tone, at a strength that never reads as a glow on the page. */
.cg-demo { position: relative; margin: 0; justify-self: end; width: 100%; max-width: 250px; }
.cg-demo::before {
  content: ""; position: absolute; inset: 18% -14% 4%; z-index: -1;
  background: radial-gradient(closest-side, rgba(213, 157, 112, .16), transparent 72%);
  pointer-events: none;
}
.cg-demo img { display: block; width: 100%; height: auto; }
.cg-demo figcaption, .cg-figure figcaption {
  margin-top: 10px; text-align: center;
  color: var(--dim); font: 400 11.5px/1.5 "JetBrains Mono", monospace;
}

/* ---- the app's own screens, given the width they were made for -------- */
.cg-figure { margin-top: clamp(44px, 6vw, 80px); }
.cg-figure img { display: block; width: 100%; height: auto; border-radius: 12px; }

/* ---- why Banglish: the reason beside the proof of it ------------------- */
.cg-split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  align-items: center; gap: clamp(28px, 5vw, 56px);
}
.cg-pair { margin: 0; }
.cg-pair img { display: block; width: 100%; height: auto; }

/* ---- label and sentence rows ------------------------------------------
   Same hairline rhythm as the site's rows, but the sentence sits beside its
   label and reads left to right. Leaders stay for the figures below. */
.cg-defs { margin: 10px 0 0; padding: 0; }
.cg-defs > div {
  display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 6px 28px; padding: 17px 0;
}
.cg-defs > div + div { border-top: 1px solid var(--line); }
.cg-defs dt { margin: 0; color: var(--paper); font: 400 15px/1.4 Archivo, sans-serif; }
.cg-defs dd { margin: 0; color: var(--gray); font: 400 14px/1.55 Archivo, sans-serif; max-width: 52ch; }
.cg-grew dt { color: var(--signal); font: 500 12px/1.9 "JetBrains Mono", monospace; letter-spacing: .04em; }
.cg-grew > div { grid-template-columns: 72px minmax(0, 1fr); }

/* ---- close --------------------------------------------------------------- */
.cg-close .case-claim { max-width: 30ch; }
.cg-sign {
  display: flex; align-items: center; gap: 12px; margin: 34px 0 0;
  color: var(--dim); font: 400 12px/1 "JetBrains Mono", monospace; letter-spacing: .06em;
}
.cg-sign img { border-radius: 7px; }

/* ---- phones ---------------------------------------------------------------- */
@media (max-width: 760px) {
  .cg-open { grid-template-columns: 1fr; }
  .cg-demo { max-width: 240px; justify-self: center; }
  /* Four phones squeezed into 335px are unreadable, so on a phone the wide
     screenshots keep a readable size and scroll sideways inside their own
     frame. The page itself never scrolls sideways. */
  .cg-figure { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-inline: 20px; }
  .cg-figure::-webkit-scrollbar { display: none; }
  .cg-figure img { width: 760px; max-width: none; }
  .cg-figure figcaption { position: sticky; left: 0; width: calc(100vw - 40px); text-align: left; }
  .cg-split { grid-template-columns: 1fr; }
  .cg-pair { max-width: 340px; }
  .cg-figure img { border-radius: 8px; }
  /* the sentence drops under its label rather than squeezing beside it */
  .cg-defs > div { grid-template-columns: 1fr; }
  .cg-grew > div { grid-template-columns: 56px minmax(0, 1fr); }
}
