/* ==========================================================================
   CL Bakehouse
   ========================================================================== */

:root {
  --cream: #F6F0E7;
  --paper: #FBF8F3;
  --oat: #EDE3D5;
  --ink: #2B221D;
  --ink-soft: #5E5149;
  --muted: #8A7B70;
  --caramel: #A6744B;
  --caramel-deep: #8A5D39;
  --line: rgba(43, 34, 29, 0.14);

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Jost", "Avenir Next", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --max: 1320px;
  --section-y: clamp(6rem, 14vw, 11rem);

  --ease: cubic-bezier(0.22, 0.61, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 0, 0.15, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
p { margin: 0; }

a { color: inherit; }

::selection { background: var(--oat); color: var(--ink); }

:focus-visible {
  outline: 1.5px solid var(--caramel);
  outline-offset: 4px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Shared bits
   -------------------------------------------------------------------------- */

.section {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: var(--section-y) var(--gutter);
  scroll-margin-top: 2rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--caramel-deep);
}

.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.section-title {
  margin: 1.25rem 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

/* Buttons & links — soft color shifts, no jumps */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.9rem 1.75rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    background-color 0.6s var(--ease),
    border-color 0.6s var(--ease),
    color 0.6s var(--ease);
}

.button:hover {
  background: var(--caramel-deep);
  border-color: var(--caramel-deep);
}

.button--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button--ghost:hover {
  background: transparent;
  color: var(--caramel-deep);
  border-color: var(--caramel);
}

/* Underline that draws in from the left */
.inline-link,
.site-nav a {
  position: relative;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 100% 100%;
  background-size: 0% 1px;
  transition:
    background-size 0.7s var(--ease),
    color 0.6s var(--ease);
}

.inline-link:hover,
.site-nav a:hover {
  background-position: 0% 100%;
  background-size: 100% 1px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 0.9rem) var(--gutter) 0.9rem;
  transition:
    background-color 0.8s var(--ease),
    box-shadow 0.8s var(--ease),
    padding 0.8s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(246, 240, 231, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 1px 0 var(--line);
}

.site-header__mark {
  display: block;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.site-header.is-scrolled .site-header__mark {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.site-header__mark img { width: 34px; height: 34px; }

.site-nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.site-nav a {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.35rem 0;
}

.site-nav a:hover { color: var(--ink); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  gap: 2.75rem;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 5.5rem) var(--gutter) 4.5rem;
}

.hero__logo {
  margin: 0;
  width: min(100%, 22rem);
}

.hero__logo img { width: 100%; }

.hero__tagline {
  margin-top: 2rem;
  max-width: 17ch;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.15rem, 8.4vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
  margin-top: 2.5rem;
}

.hero__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px 4px 4px;
  background: var(--oat);
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 45% 60%;
}

@media (max-width: 899px) {
  .hero {
    gap: 3rem;
    padding-top: calc(env(safe-area-inset-top) + 5.25rem);
    padding-bottom: 1rem;
  }
  .hero__logo { width: min(80%, 19rem); }
  .hero__tagline { margin-top: 1.5rem; max-width: none; }
  .hero__actions { margin-top: 2rem; }
  .hero .button { flex: 1 1 100%; }
  .hero__media {
    border-radius: 50vw 50vw 4px 4px;
    max-height: 80svh;
  }
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: clamp(3rem, 7vw, 7rem);
    min-height: 100svh;
    padding-top: 7rem;
    padding-bottom: 6rem;
  }

  .hero__media {
    max-height: calc(100svh - 11rem);
    justify-self: end;
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   About + Gallery
   -------------------------------------------------------------------------- */

.about {
  display: grid;
  gap: 4rem;
}

.about__lead {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.16;
  letter-spacing: -0.008em;
  text-wrap: pretty;
}

.about__body {
  margin-top: 1.75rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  line-height: 1.4;
  color: var(--ink-soft);
  text-wrap: balance;
}

/* Desktop: fixed two-line break after "cakes," */
.break-lg { display: none; }

@media (min-width: 1000px) {
  .break-lg { display: inline; }
  .about__body { font-size: clamp(1.2rem, 1.85vw, 1.65rem); }
}

.offerings {
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.offerings li {
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.offerings li:nth-child(odd) { padding-right: 1rem; }

@media (max-width: 519px) {
  .offerings { grid-template-columns: 1fr; }
}

/* Gallery: one wide photo over two squares */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem clamp(0.85rem, 2.5vw, 1.75rem);
  scroll-margin-top: 5rem;
}

.gallery__item--wide { grid-column: 1 / -1; }

.gallery__frame {
  overflow: hidden;
  border-radius: 4px;
  background: var(--oat);
  aspect-ratio: 1 / 1;
}

.gallery__item--wide .gallery__frame { aspect-ratio: 5 / 4; }

.gallery__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.8s var(--ease-soft);
}

.gallery__item--wide .gallery__frame img { object-position: 60% 70%; }

@media (hover: hover) {
  .gallery__item:hover .gallery__frame img { transform: scale(1.035); }
}

.gallery__item figcaption {
  margin-top: 0.85rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  color: var(--ink-soft);
}

@media (min-width: 900px) {
  .about {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(3rem, 6vw, 6.5rem);
    align-items: start;
  }

  /* text stays beside the photos as they scroll past */
  .about__text {
    position: sticky;
    top: clamp(6rem, 12vh, 9rem);
  }

}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

/* Contact + footer share one screen */
.closing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--paper);
}

.contact {
  flex: 1;
  max-width: none;
  padding: 5.5rem var(--gutter) 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.contact__mark {
  width: 56px;
  height: 56px;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.contact .eyebrow::after {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.contact__copy {
  margin-top: 1.75rem;
  width: 100%;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 5.2vw, 3.4rem);
  line-height: 1.2;
}

.inline-link {
  color: var(--caramel-deep);
  background-size: 100% 1px;
  background-image: linear-gradient(rgba(138, 93, 57, 0.35), rgba(138, 93, 57, 0.35));
  white-space: nowrap;
}

.inline-link:hover {
  color: var(--ink);
  background-image: linear-gradient(var(--ink), var(--ink));
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 2.25rem;
}

@media (max-width: 599px) {
  .contact__copy { font-size: max(1.2rem, 6.3vw); }
  .contact__actions { width: 100%; flex-direction: column; }
  .contact__actions .button { width: 100%; }
}

@media (max-height: 640px) {
  .contact { padding-top: 4.5rem; padding-bottom: 1.5rem; }
  .contact__mark { width: 44px; height: 44px; margin-bottom: 1rem; }
  .contact__copy { margin-top: 1.25rem; }
  .contact__actions { margin-top: 1.5rem; gap: 0.6rem; }
  .contact__actions .button { min-height: 2.85rem; padding-block: 0.7rem; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding: 1.5rem var(--gutter) calc(env(safe-area-inset-bottom) + 1.5rem);
  text-align: center;
  border-top: 1px solid var(--line);
}

.site-footer__note {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-footer__meta {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.8;
}

/* ==========================================================================
   Motion — everything slow, soft, and optional
   (Only applies when JS is on and the visitor hasn't asked for reduced motion)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {

  /* Hero, on load */
  .js .load-in {
    opacity: 0;
    transform: translateY(22px);
    animation: rise 1.6s var(--ease) var(--d, 0s) forwards;
  }

  .js .load-in--media {
    transform: none;
    animation-name: fade;
    animation-duration: 2s;
  }

  .js .load-in--media img {
    transform: scale(1.08);
    animation: settle 3.2s var(--ease-soft) var(--d, 0s) forwards;
  }

  @keyframes rise { to { opacity: 1; transform: none; } }
  @keyframes fade { to { opacity: 1; } }
  @keyframes settle { to { transform: scale(1); } }

  /* Simple fade-up on scroll */
  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 1.3s var(--ease),
      transform 1.3s var(--ease);
    transition-delay: var(--d, 0s);
  }

  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  /* Word-by-word text reveal */
  .js [data-split] .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.45em);
    filter: blur(3px);
    transition:
      opacity 1.1s var(--ease),
      transform 1.1s var(--ease),
      filter 1.1s var(--ease);
    transition-delay: calc(var(--i, 0) * 45ms + 120ms);
  }

  .js [data-split].is-visible .word {
    opacity: 1;
    transform: none;
    filter: none;
  }

  /* Images: fade in and settle from a slight scale */
  .js .reveal-media {
    opacity: 0;
    transform: translateY(28px);
    transition:
      opacity 1.6s var(--ease),
      transform 1.6s var(--ease);
    transition-delay: var(--d, 0s);
  }

  .js .reveal-media img {
    transform: scale(1.1);
    transition: transform 2.8s var(--ease-soft);
  }

  .js .reveal-media.is-visible {
    opacity: 1;
    transform: none;
  }

  .js .reveal-media.is-visible img { transform: scale(1); }

  /* keep the gallery hover zoom working once revealed */
  @media (hover: hover) {
    .js .gallery__item.is-visible:hover .gallery__frame img {
      transform: scale(1.035);
      transition-duration: 1.8s;
    }
  }
}
