/* ============================================================
   ORIGIN TWENTY THREE — styles
   1. Tokens   2. Reset/base   3. Typography   4. Buttons/links
   5. Header/nav   6. Hero   7. Pillars   8. Story   9. Coffee
   10. Café   11. Journal   12. Footer   13. Motion   14. Responsive
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  --espresso:      #17120e;
  --espresso-2:    #1f1811;
  --espresso-3:    #2a2018;
  --cream:         #f4ede2;
  --cream-2:       #ece3d4;
  --ink:           #26201a;   /* dark text on cream */
  --ink-soft:      #5c5044;
  --terracotta:    #c26a34;
  --terracotta-2:  #a9552a;
  --gold:          #cca86a;
  --line-dark:     rgba(244,237,226,.16);
  --line-light:    rgba(38,32,26,.14);
  --on-dark:       rgba(244,237,226,.72);
  --on-dark-dim:   rgba(244,237,226,.5);

  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:  'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1240px;
  --gutter: clamp(1.15rem, 4vw, 3rem);
  --section-y: clamp(4.5rem, 9vw, 8rem);
  --header-h: 88px;
  --radius: 14px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- 2. RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--espresso);
  line-height: 1.65;
  font-size: clamp(1rem, .96rem + .2vw, 1.075rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; border-radius: 3px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 200;
  background: var(--terracotta); color: #fff; padding: .6rem 1rem; border-radius: 6px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* section theming */
.section--dark  { background: var(--espresso); color: var(--cream); }
.section--cream { background: var(--cream); color: var(--ink); }
section[id], .footer { scroll-margin-top: var(--header-h); }

/* ---------- 3. TYPOGRAPHY ---------- */
.eyebrow {
  font-size: .72rem; font-weight: 500; letter-spacing: .28em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 1.1rem;
}
.eyebrow--accent { color: var(--terracotta); }
.section--dark .eyebrow { color: var(--gold); }

.section-title {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2.1rem, 1.4rem + 3vw, 3.6rem);
  line-height: 1.06; letter-spacing: .005em; color: var(--cream);
}
.section-title--ink { color: var(--ink); }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: clamp(2.2rem, 4vw, 3.5rem);
}

/* ---------- 4. BUTTONS / LINKS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); font-weight: 500;
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  padding: 1rem 1.9rem; border-radius: 2px; white-space: nowrap;
  transition: transform .3s var(--ease), background-color .3s, color .3s, border-color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn--sm { padding: .72rem 1.3rem; font-size: .72rem; }
.btn--solid { background: var(--terracotta); color: #fff; }
.btn--solid:hover { background: var(--terracotta-2); }
.btn--ghost {
  background: transparent; color: currentColor;
  border: 1px solid currentColor; opacity: .92;
}
.btn--ghost:hover { background: currentColor; opacity: 1; }
.section--dark .btn--ghost:hover { color: var(--espresso); }
.section--cream .btn--ghost { border-color: var(--ink); }
.section--cream .btn--ghost:hover { color: var(--cream); }

.text-link {
  font-size: .74rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: var(--terracotta); display: inline-flex; gap: .5em; align-items: center;
}
.text-link span { transition: transform .3s var(--ease); }
.text-link:hover span { transform: translateX(5px); }
.text-link--sm { font-size: .68rem; }

/* ---------- 5. HEADER / NAV ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background-color .4s var(--ease), height .4s var(--ease), box-shadow .4s;
}
.site-header::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(10,7,5,.55), transparent);
  opacity: 1; transition: opacity .4s; pointer-events: none;
}
.site-header.is-stuck {
  height: 72px; background: rgba(20,15,11,.92);
  backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line-dark);
}
.site-header.is-stuck::before { opacity: 0; }
.header__inner { display: flex; align-items: center; gap: 1.5rem; width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.brand { flex-shrink: 0; }
.brand__logo { width: auto; height: 52px; transition: height .4s var(--ease); }
.site-header.is-stuck .brand__logo { height: 42px; }

.nav { margin-left: auto; }
.nav__list { display: flex; gap: clamp(1rem, 2vw, 2.1rem); }
.nav__link {
  position: relative; color: var(--cream);
  font-size: .78rem; font-weight: 400; letter-spacing: .14em; text-transform: uppercase;
  padding: .4rem 0; opacity: .85; transition: opacity .25s;
}
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--terracotta); transition: width .3s var(--ease);
}
.nav__link:hover { opacity: 1; }
.nav__link.is-active { opacity: 1; }
.nav__link.is-active::after { width: 100%; }

.header__actions { display: flex; align-items: center; gap: 1rem; margin-left: 1.4rem; }

/* hamburger */
.nav-toggle { display: none; width: 44px; height: 44px; position: relative; }
.nav-toggle__bar {
  position: absolute; left: 10px; right: 10px; height: 1.6px; background: var(--cream);
  transition: transform .35s var(--ease), opacity .25s;
}
.nav-toggle__bar:nth-child(1) { top: 15px; }
.nav-toggle__bar:nth-child(2) { top: 21px; }
.nav-toggle__bar:nth-child(3) { top: 27px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(17,12,9,.98); backdrop-filter: blur(6px);
  display: flex; overflow-y: auto; -webkit-overflow-scrolling: touch;
  opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s;
}
.mobile-menu[hidden] { display: flex; } /* keep transition; JS toggles .is-open */
.mobile-menu.is-open { opacity: 1; visibility: visible; }
/* margin:auto centres when it fits, but keeps the top reachable (scrollable) when
   the content is taller than the viewport — avoids the flex/grid centred-overflow crop */
.mobile-menu__inner { text-align: center; width: 100%; margin: auto; padding: calc(var(--header-h) + 1.4rem) 1.5rem 2.4rem; }
.mobile-menu__list { display: flex; flex-direction: column; gap: 1.4rem; margin-bottom: 2.4rem; }
.mobile-menu__list a {
  font-family: var(--font-serif); color: var(--cream);
  font-size: 2rem; font-weight: 500; letter-spacing: .01em;
  display: inline-block;
}
.mobile-menu__list a:hover { color: var(--gold); }
.mobile-menu__cta { margin-inline: auto; }
.mobile-menu__tag {
  margin-top: 1.8rem; color: var(--gold); font-size: .7rem;
  letter-spacing: .3em; text-transform: uppercase;
}

/* ---------- 6. HERO ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; color: var(--cream); overflow: hidden; }
.hero__media {
  position: absolute; inset: 0;
  background: url("../img/hero/hero.jpg") center/cover no-repeat;
  transform: scale(1.05); animation: heroZoom 14s var(--ease) forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(105deg, rgba(12,8,6,.9) 0%, rgba(12,8,6,.62) 42%, rgba(12,8,6,.15) 72%, rgba(12,8,6,.4) 100%),
    linear-gradient(to top, rgba(12,8,6,.7), transparent 40%);
}
.hero__inner { position: relative; z-index: 2; padding-top: var(--header-h); }
.hero__content { max-width: 640px; }
.hero__title {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2.8rem, 1.6rem + 5.4vw, 5.6rem);
  line-height: 1.02; letter-spacing: .004em; margin: .3rem 0 1.6rem;
}
.hero__title em { font-style: italic; font-weight: 500; color: var(--cream); }
.hero__sub { max-width: 30rem; color: var(--on-dark); font-size: 1.08rem; margin-bottom: 2.2rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero__scroll {
  position: absolute; z-index: 2; left: 50%; bottom: 1.8rem; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  color: var(--on-dark-dim); font-size: .6rem; letter-spacing: .3em; text-transform: uppercase;
}
.hero__scroll-line { width: 1px; height: 46px; background: linear-gradient(var(--gold), transparent); }

/* ---------- 7. PILLARS ---------- */
.pillars { padding-block: clamp(3.2rem, 6vw, 5rem); }
.pillars__grid {
  display: grid; grid-template-columns: repeat(6, 1fr);
}
.pillar {
  text-align: center; padding: 1.2rem clamp(.6rem, 1.4vw, 1.4rem);
  border-right: 1px solid var(--line-light);
}
.pillar:last-child { border-right: none; }
.pillar__icon { color: var(--terracotta); display: inline-block; }
.pillar__icon svg { width: 34px; height: 34px; }
.pillar__title {
  font-family: var(--font-sans); font-weight: 500;
  font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  margin: 1rem 0 .6rem; color: var(--ink);
}
.pillar__text { font-size: .9rem; color: var(--ink-soft); line-height: 1.55; }

/* ---------- 8. STORY ---------- */
.story { padding-block: var(--section-y); }
.story__grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.story__text p { color: var(--on-dark); margin-bottom: 1.1rem; max-width: 34rem; }
.story__text .section-title { margin-bottom: 1.6rem; }
.story__promise { color: var(--cream) !important; font-size: 1.12rem; }
.story__promise em { font-family: var(--font-serif); font-style: italic; font-size: 1.35rem; line-height: 1.4; }
.story__text .btn { margin-top: 1rem; }

.story__gallery {
  display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 12px;
  grid-template-areas: "tall wide" "tall two" "three two";
}
.story__img { overflow: hidden; border-radius: 6px; }
.story__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.story__img:hover img { transform: scale(1.06); }
.story__img--tall { grid-area: tall; }
.story__img--wide { grid-area: three; }
.story__gallery figure:nth-child(2) { grid-area: wide; }
.story__gallery figure:nth-child(3) { grid-area: two; }

/* ---------- 9. COFFEE ---------- */
.coffee { padding-block: var(--section-y); }
.products { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.2rem, 2.5vw, 2rem); max-width: 900px; }
.product {
  background: var(--espresso); color: var(--cream); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 18px 40px -28px rgba(30,20,12,.5);
  transition: transform .4s var(--ease), box-shadow .4s;
}
.product:hover { transform: translateY(-6px); box-shadow: 0 30px 55px -30px rgba(30,20,12,.65); }
.product__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.product__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.product:hover .product__media img { transform: scale(1.07); }
.product__mark {
  position: absolute; top: 12px; left: 14px;
  font-family: var(--font-serif); font-size: 1rem; letter-spacing: .1em;
  color: var(--cream); opacity: .85;
  background: rgba(17,12,9,.45); border: 1px solid var(--line-dark);
  padding: .1rem .55rem; border-radius: 999px; backdrop-filter: blur(3px);
}
.product__body { padding: 1.6rem 1.6rem 1.8rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.product__name { font-family: var(--font-serif); font-weight: 600; font-size: 1.9rem; line-height: 1; }
.product__meta { color: var(--on-dark); font-size: .86rem; line-height: 1.5; }
.product__foot { margin-top: auto; padding-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line-dark); }
.product__price { font-family: var(--font-serif); font-size: 1.5rem; color: var(--gold); }
.product__price small { font-family: var(--font-sans); font-size: .72rem; color: var(--on-dark-dim); letter-spacing: .05em; }

/* ---------- 10. CAFÉ ---------- */
.cafe { position: relative; padding-block: clamp(5rem, 10vw, 9rem); overflow: hidden; }
.cafe__bg { position: absolute; inset: 0; background: url("../img/cafe/cafe.jpg") center/cover no-repeat; }
.cafe__scrim { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(14,10,7,.94) 0%, rgba(14,10,7,.8) 45%, rgba(14,10,7,.55) 100%); }
.cafe__inner { position: relative; z-index: 2; max-width: 620px; color: var(--cream); }
.cafe__lead { color: var(--on-dark); font-size: 1.1rem; margin: 1.4rem 0 2.2rem; max-width: 34rem; }
.cafe__features {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 2rem;
  margin-bottom: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--line-dark);
}
.cafe__features h3 { font-size: .92rem; font-weight: 500; letter-spacing: .04em; margin: .3rem 0 .2rem; color: var(--cream); }
.cafe__features p { font-size: .86rem; color: var(--on-dark); }
.feature__icon { color: var(--gold); display: inline-block; }
.feature__icon svg { width: 26px; height: 26px; }

/* ---------- 11. JOURNAL ---------- */
.journal { padding-block: var(--section-y); }
.journal__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.2rem, 2.5vw, 2rem); }
.jcard { display: flex; flex-direction: column; }
.jcard__media { display: block; overflow: hidden; border-radius: 8px; aspect-ratio: 16 / 11; }
.jcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.jcard:hover .jcard__media img { transform: scale(1.06); }
.jcard__body { padding: 1.2rem .2rem 0; }
.jcard__tag { font-size: .68rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--terracotta); margin-bottom: .5rem; }
.jcard__title { font-family: var(--font-serif); font-weight: 500; font-size: 1.4rem; line-height: 1.2; color: var(--ink); margin-bottom: .8rem; }

/* ---------- 12. FOOTER ---------- */
.footer { padding-block: clamp(3.5rem, 7vw, 6rem) 2rem; }
.footer__top {
  display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: clamp(2rem, 4vw, 4rem);
  padding-bottom: 3rem; border-bottom: 1px solid var(--line-dark);
}
.footer__head { font-family: var(--font-serif); font-weight: 500; font-size: 1.9rem; color: var(--cream); margin-bottom: .6rem; }
.footer__sub { color: var(--on-dark); font-size: .95rem; margin-bottom: 1.4rem; max-width: 26rem; }
.news-form { display: flex; flex-wrap: wrap; gap: .7rem; }
.news-form__input {
  flex: 1 1 200px; background: transparent; color: var(--cream);
  border: 1px solid var(--line-dark); border-radius: 2px; padding: .95rem 1.1rem;
  font-size: .92rem; transition: border-color .3s;
}
.news-form__input::placeholder { color: var(--on-dark-dim); }
.news-form__input:focus { outline: none; border-color: var(--terracotta); }
.news-form__note { flex-basis: 100%; font-size: .82rem; color: var(--gold); min-height: 1rem; margin-top: .2rem; }

.trust { display: flex; flex-direction: column; gap: 1.3rem; }
.trust li { display: flex; gap: 1rem; align-items: center; }
.trust__icon { color: var(--gold); flex-shrink: 0; }
.trust__icon svg { width: 30px; height: 30px; }
.trust h3 { font-size: .82rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--cream); }
.trust p { font-size: .85rem; color: var(--on-dark); }

.footer__logo { height: 58px; width: auto; margin-bottom: .3rem; }
.footer__born { font-size: .64rem; letter-spacing: .34em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.footer__desc { color: var(--on-dark); font-size: .92rem; margin-bottom: 1.4rem; }
.social { display: flex; gap: .8rem; }
.social a {
  width: 42px; height: 42px; border: 1px solid var(--line-dark); border-radius: 50%;
  display: grid; place-items: center; color: var(--cream); transition: background-color .3s, color .3s, border-color .3s, transform .3s;
}
.social a:hover { background: var(--terracotta); border-color: var(--terracotta); color: #fff; transform: translateY(-3px); }
.social svg { width: 18px; height: 18px; }

.footer__bottom { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; padding-top: 1.8rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; }
.footer__links a { font-size: .78rem; letter-spacing: .06em; color: var(--on-dark); transition: color .25s; }
.footer__links a:hover { color: var(--terracotta); }
.footer__copy { font-size: .78rem; color: var(--on-dark-dim); }

/* ---------- 13. MOTION ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__media { animation: none; transform: none; }
}

/* ---------- 14. RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .pillars__grid { grid-template-columns: repeat(3, 1fr); }
  .pillar:nth-child(3n) { border-right: none; }
  .pillar:nth-child(-n+3) { border-bottom: 1px solid var(--line-light); padding-bottom: 2rem; margin-bottom: 1.2rem; }
}
@media (max-width: 960px) {
  :root { --header-h: 76px; }
  .nav { display: none; }
  .shop-now { display: none; }
  .nav-toggle { display: block; }
  .header__actions { margin-left: auto; } /* push hamburger to the right */
  .story__grid { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .pillars__grid { grid-template-columns: repeat(2, 1fr); }
  .pillar { border-right: 1px solid var(--line-light); border-bottom: 1px solid var(--line-light); padding-block: 1.6rem; margin-bottom: 0; }
  .pillar:nth-child(2n) { border-right: none; }
  .pillar:nth-child(-n+3) { margin-bottom: 0; }
  .products { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .journal__grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .cafe__features { grid-template-columns: 1fr; gap: 1.3rem; }
  .footer__top { grid-template-columns: 1fr; }
  .footer__bottom { justify-content: flex-start; }
  .story__gallery { gap: 8px; }
}
@media (max-width: 420px) {
  .pillars__grid { grid-template-columns: 1fr; }
  .pillar, .pillar:nth-child(2n) { border-right: none; }
  .hero__cta .btn { flex: 1 1 auto; }
}
