/* ════════════════════════════════════════════════════════════════════════
   405 BAKEHOUSE — Gemini design system (vanilla CSS port)
   Fonts: Open Sans (body) · Chonburi (logo/display) · Instrument Serif (editorial)
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --g-cream: #FDFBF7;
  --g-dark: #2D2926;
  --g-burgundy: #921f1b;
  --g-muted-bg: #F3EFE8;
  --g-muted-hover: #E8EBE3;
  --g-border: rgba(45, 41, 38, 0.1);
  /* All text-color tokens below pass WCAG AA contrast (≥4.5:1) on cream bg */
  --g-opacity-70: rgba(45, 41, 38, 0.78);
  --g-opacity-50: rgba(45, 41, 38, 0.72);
  --g-opacity-40: rgba(45, 41, 38, 0.72);

  --g-sans: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --g-display: "Chonburi", Georgia, serif;
  --g-serif: "Instrument Serif", Georgia, serif;

  --g-max: 1280px;
  --g-pad-x: clamp(20px, 4vw, 48px);
}

/* base body — overrides the older one in the inline <style> block */
body.g-body {
  background: var(--g-cream);
  color: var(--g-dark);
  font-family: var(--g-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.g-body a {
  color: inherit;
  text-decoration: none;
  transition: opacity .2s;
}
body.g-body a:hover { opacity: .7; }

::selection { background: #000; color: #fff; }

/* ── shared utility ───────────────────────────────────────── */
.g-container {
  width: 100%;
  max-width: var(--g-max);
  margin: 0 auto;
}

.g-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-family: var(--g-sans);
}

.g-label--sm { font-size: 11px; letter-spacing: 0.2em; }

.g-italic-body {
  font-family: var(--g-serif);
  font-size: 18px;
  line-height: 1.5;
  color: var(--g-opacity-70);
}

/* ── 01 · Header / Navigation ─────────────────────────────── */
.g-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--g-pad-x);
  border-bottom: 1px solid var(--g-border);
  background: var(--g-cream);
  position: relative;
  z-index: 30;
}

.g-logo {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.g-logo img {
  height: 44px;
  width: auto;
  display: block;
}

.g-logo:hover { opacity: .75; }

@media (max-width: 480px) {
  .g-logo img { height: 36px; }
}

.g-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 12px 8px;
  min-height: 44px;
  font-family: var(--g-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--g-dark);
  cursor: pointer;
  transition: opacity .2s;
}

.g-nav-cta:hover { opacity: .6; }
.g-nav-cta svg { width: 16px; height: 16px; stroke-width: 2; }

/* ── 02 · Hero ────────────────────────────────────────────── */
.g-hero {
  padding: 60px var(--g-pad-x) 40px;
}

.g-hero__inner {
  max-width: var(--g-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
}

.g-hero__title {
  font-family: var(--g-serif);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 14ch;
}

.g-hero__est {
  font-family: var(--g-serif);
  font-size: 18px;
  line-height: 1.5;
  color: var(--g-opacity-70);
  max-width: 22ch;
  margin: 0;
}

@media (max-width: 768px) {
  .g-hero { padding-top: 32px; }
  .g-hero__inner { flex-direction: column; align-items: flex-start; }
}

/* ── 03 · Flavours / Products ─────────────────────────────── */
.g-flavours {
  padding: 60px var(--g-pad-x) 80px;
}

.g-flavours__inner {
  max-width: var(--g-max);
  margin: 0 auto;
}

.g-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

.g-section-title {
  font-family: var(--g-serif);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.015em;
  margin: 0;
}

.g-section-aside {
  font-family: var(--g-serif);
  font-size: 18px;
  line-height: 1.5;
  color: var(--g-opacity-70);
  max-width: 22ch;
  margin: 0;
}

.g-flavours__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px 48px;
}

@media (min-width: 720px) {
  .g-flavours__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: min-content;
  }
  .g-cookie {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 5;
    row-gap: 14px;
    height: auto;
  }
  /* In subgrid mode, row-gap controls all inter-row spacing — neutralise legacy margins */
  .g-cookie > .g-cookie__media,
  .g-cookie > .g-cookie__row,
  .g-cookie > .g-cookie__tag,
  .g-cookie > .g-cookie__desc,
  .g-cookie > .g-cookie__cta {
    margin: 0;
  }
  .g-cookie > .g-cookie__cta { align-self: end; }
  .g-cookie__name { margin-bottom: 0; }
}

@media (min-width: 1024px) {
  .g-flavours__grid { grid-template-columns: repeat(4, 1fr); column-gap: 32px; }
}

.g-cookie {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  height: 100%;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.g-cookie__media {
  aspect-ratio: 1 / 1;
  margin-bottom: 20px;
  background: var(--g-muted-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background-color .5s ease;
}

.g-cookie:hover .g-cookie__media { background: var(--g-muted-hover); }

.g-cookie__media img,
.g-cookie__media picture {
  width: 100%;
  height: 100%;
  padding: 36px;
  object-fit: contain;
  filter: drop-shadow(0 24px 32px rgba(0, 0, 0, 0.18));
  transition: transform .7s ease;
}
.g-cookie__media picture { padding: 0; display: block; }
.g-cookie__media picture img { padding: 36px; filter: inherit; }

.g-cookie:hover .g-cookie__media img,
.g-cookie:hover .g-cookie__media picture img { transform: scale(1.05); }

.g-cookie__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.g-cookie__name {
  font-family: var(--g-serif);
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 4px;
  line-height: 1.15;
  flex: 1;
}

.g-cookie__price {
  font-size: 17px;
  flex-shrink: 0;
  font-family: var(--g-sans);
}

.g-cookie__tag {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--g-opacity-50);
  margin: 0 0 14px;
  font-family: var(--g-sans);
  font-weight: 500;
}

.g-cookie__desc {
  font-family: var(--g-serif);
  font-size: 18px;
  line-height: 1.45;
  color: var(--g-opacity-70);
  margin: 0 0 20px;
  flex-grow: 1;
}

.g-cookie__cta {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--g-border);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
  font-family: var(--g-sans);
  color: var(--g-dark);
  background: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
  text-align: left;
  cursor: pointer;
  transition: opacity .2s;
}

.g-cookie__cta:hover { opacity: .6; }

/* ── 04 · 100s of Iterations ──────────────────────────────── */
.g-iterations {
  padding: 96px var(--g-pad-x);
  background: #ffffff;
  border-top: 1px solid var(--g-border);
  border-bottom: 1px solid var(--g-border);
}

.g-iterations__inner {
  max-width: var(--g-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
  align-items: center;
}

@media (min-width: 768px) {
  .g-iterations__inner { flex-direction: row; }
}

.g-iterations__text {
  flex: 1;
  padding-right: 16px;
}

.g-iterations__title {
  font-family: var(--g-serif);
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
}

.g-iterations__copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-family: var(--g-serif);
  font-size: 20px;
  line-height: 1.5;
  color: var(--g-opacity-70);
  max-width: 32rem;
}

.g-iterations__copy p { margin: 0; }

.g-iterations__media {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.g-iterations__media img {
  display: block;
  width: 100%;
  max-width: 520px;
  max-height: 720px;
  height: auto;
  object-fit: contain;
  transition: transform .7s cubic-bezier(.2,.8,.2,1);
}

.g-iterations__media img:hover { transform: scale(1.03) rotate(-0.5deg); }

@media (min-width: 768px) {
  .g-iterations__inner { align-items: stretch; gap: 72px; }
  .g-iterations__text { display: flex; flex-direction: column; justify-content: center; }
}

@media (max-width: 480px) {
  .g-iterations__media img { max-height: 560px; }
}

/* ── 05 · How to Order ────────────────────────────────────── */
.g-how {
  padding: 80px var(--g-pad-x);
  border-top: 1px solid var(--g-border);
}

.g-how__inner {
  max-width: var(--g-max);
  margin: 0 auto;
}

.g-how__head {
  text-align: center;
  margin-bottom: 64px;
}

.g-how__title {
  font-family: var(--g-serif);
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
}

.g-how__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
  max-width: 56rem;
  margin: 0 auto;
  text-align: center;
  padding: 0 24px;
}

@media (min-width: 720px) {
  .g-how__grid { grid-template-columns: 1fr 1fr; gap: 96px; }
}

.g-how__card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.g-how__icon {
  margin-bottom: 24px;
  opacity: 0.85;
}

.g-how__icon svg { width: 36px; height: 36px; stroke-width: 1.5; }

.g-how__heading {
  font-family: var(--g-sans);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
  margin: 0 0 16px;
}

.g-how__copy {
  font-family: var(--g-serif);
  font-size: 19px;
  line-height: 1.5;
  color: var(--g-opacity-70);
  max-width: 28rem;
  margin: 0;
}

.g-how__copy a {
  color: var(--g-burgundy);
  font-style: normal;
  font-family: var(--g-sans);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  display: inline-block;
  margin-top: 12px;
}

/* ── 06 · Contact ─────────────────────────────────────────── */
.g-contact {
  background: var(--g-burgundy);
  color: var(--g-cream);
  padding: 64px var(--g-pad-x);
}

.g-contact__inner {
  max-width: var(--g-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}

@media (min-width: 720px) {
  .g-contact__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 32px 48px;
  }
}

.g-contact__body {
  grid-column: 1;
  grid-row: 1;
}

.g-contact__logo {
  height: 64px;
  width: auto;
  display: block;
  opacity: 0.95;
  align-self: end;
  justify-self: start;
}

@media (min-width: 720px) {
  .g-contact__logo {
    height: 96px;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
}

.g-contact__title {
  font-family: var(--g-serif);
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 48px;
  color: var(--g-cream);
}

.g-contact__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 16px;
  font-family: var(--g-sans);
}

@media (min-width: 720px) {
  .g-contact__list { font-size: 18px; }
}

.g-contact__row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.g-contact__key {
  width: 96px;
  opacity: 0.85;
  font-family: var(--g-sans);
  text-transform: lowercase;
  flex-shrink: 0;
}

@media (min-width: 720px) {
  .g-contact__key { width: 128px; }
}

.g-contact__sep {
  opacity: 0.6;
}

.g-contact a {
  color: var(--g-cream);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
  min-width: 0;
}

@media (max-width: 480px) {
  .g-contact__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .g-contact__key { width: auto; }
  .g-contact__sep { display: none; }
}

.g-contact a:hover { opacity: 0.7; }

/* ── 07 · Footer ──────────────────────────────────────────── */
.g-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px var(--g-pad-x);
  border-top: 1px solid var(--g-border);
  flex-wrap: wrap;
  background: var(--g-cream);
}

.g-footer__copy,
.g-footer__meta {
  font-family: var(--g-sans);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--g-opacity-40);
}

.g-footer__meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.g-footer__meta a:hover { color: var(--g-dark); opacity: 1; }

@media (max-width: 720px) {
  .g-footer { flex-direction: column; align-items: flex-start; }
}

/* ── responsive paddings ──────────────────────────────────── */
@media (max-width: 480px) {
  .g-hero,
  .g-flavours,
  .g-iterations,
  .g-how,
  .g-contact { padding-left: 20px; padding-right: 20px; }
}
