/* =========================================================
   SEVERANCE BAKING CO.
   Brand palette: cream, warm taupe, soft brown, dusty mauve
   ========================================================= */

:root {
  --cream: #F4F1E8;
  --cream-deep: #EBE5D6;
  --taupe: #D2BAA2;
  --taupe-soft: #E5D5C3;
  --blush: #FFEEE9;
  --mauve: #B49486;
  --bark: #4B3F39;
  --bark-soft: #6B5B53;
  --ink: #2A2520;

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'Montserrat', system-ui, sans-serif;

  --container: min(1240px, 92vw);
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background: var(--cream);
  color: var(--bark);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ========== TYPOGRAPHY HELPERS ========== */

.section-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--mauve);
  margin-bottom: 1.5rem;
}

.section-label--light { color: var(--cream); opacity: 0.85; }

.section-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-header { margin-bottom: clamp(2.5rem, 5vw, 4rem); max-width: 640px; }
.section-header--center { text-align: center; margin-left: auto; margin-right: auto; }

/* ========== HERO ========== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6rem var(--gutter) 4rem;
}

.hero__image-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: brightness(0.78) saturate(1.05);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(42, 37, 32, 0.35) 0%, rgba(42, 37, 32, 0.55) 100%),
    radial-gradient(ellipse at center, rgba(42, 37, 32, 0.25) 30%, rgba(42, 37, 32, 0.55) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--cream);
  max-width: 720px;
  animation: heroFadeIn 1.2s var(--ease-out) both;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

.hero__est {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 2rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.hero__tagline {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  letter-spacing: 0.01em;
  max-width: 540px;
  margin: 0 auto 2.75rem;
  opacity: 0.95;
}

.hero__cta {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cream);
  padding: 1.1rem 2.5rem;
  border: 1px solid rgba(244, 241, 232, 0.6);
  transition: all 0.4s var(--ease-out);
  background: rgba(244, 241, 232, 0.05);
  backdrop-filter: blur(4px);
}

.hero__cta:hover {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--cream);
  transform: translateY(-2px);
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.7;
  z-index: 1;
}

.hero__scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 30px;
  background: currentColor;
  margin: 0.75rem auto 0;
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 0.7; }
  50%      { transform: scaleY(1.4); opacity: 1; }
}

/* ========== ABOUT ========== */

.about {
  padding: clamp(5rem, 10vw, 9rem) var(--gutter);
  background: var(--cream);
}

.about__grid {
  width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}

.about__image-col {
  position: relative;
}

.about__image-col::before {
  content: '';
  position: absolute;
  inset: -1.5rem -1.5rem 1.5rem 1.5rem;
  background: var(--taupe-soft);
  z-index: 0;
}

.about__image {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  z-index: 1;
}

.about__heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.8vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 1.75rem;
  max-width: 18ch;
}

.about__text-col p {
  font-size: 1.02rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
  color: var(--bark-soft);
  max-width: 52ch;
}

/* ========== FLAVORS ========== */

.flavors {
  padding: clamp(5rem, 10vw, 9rem) var(--gutter);
  background: var(--cream-deep);
}

.flavors > .section-header,
.flavors > .flavors__grid {
  width: var(--container);
  margin-left: auto;
  margin-right: auto;
}

.flavors__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.flavor {
  background: var(--cream);
  grid-column: span 2;
  transition: transform 0.5s var(--ease-out);
}

.flavor:hover { transform: translateY(-4px); }

.flavor--feature {
  grid-column: span 6;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: center;
  background: var(--bark);
  color: var(--cream);
}

.flavor--feature .flavor__image-wrap { aspect-ratio: 4 / 3; }
.flavor--feature .flavor__name { color: var(--cream); }
.flavor--feature .flavor__desc { color: rgba(244, 241, 232, 0.8); }

.flavor__image-wrap {
  aspect-ratio: 5 / 4;
  overflow: hidden;
}

.flavor__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}

.flavor:hover .flavor__image { transform: scale(1.04); }

.flavor__body {
  padding: clamp(1.5rem, 2.5vw, 2.5rem);
}

.flavor__badge {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--taupe);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(210, 186, 162, 0.4);
  margin-bottom: 1.25rem;
}

.flavor__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.1;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.flavor__desc {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--bark-soft);
  max-width: 44ch;
}

/* ========== WHERE ========== */

.where {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 80vh;
  background: var(--bark);
  color: var(--cream);
}

.where__image-wrap {
  position: relative;
  overflow: hidden;
}

.where__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
}

.where__content {
  padding: clamp(3rem, 7vw, 6rem) clamp(2rem, 6vw, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.where__heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--cream);
  margin-bottom: 1.5rem;
  max-width: 16ch;
}

.where__intro {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(244, 241, 232, 0.8);
  margin-bottom: 2.5rem;
  max-width: 42ch;
}

.where__list {
  border-top: 1px solid rgba(244, 241, 232, 0.15);
  margin-bottom: 2.5rem;
}

.where__item {
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(244, 241, 232, 0.15);
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1rem;
  align-items: baseline;
}

.where__item-label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--taupe);
}

.where__item-value {
  font-size: 0.98rem;
  color: rgba(244, 241, 232, 0.92);
}

.where__instagram {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--taupe);
  align-self: flex-start;
  transition: all 0.3s var(--ease-out);
}

.where__instagram:hover {
  color: var(--taupe);
  border-bottom-color: var(--cream);
}

/* ========== CONTACT ========== */

.contact {
  padding: clamp(5rem, 10vw, 9rem) var(--gutter);
  background: var(--blush);
}

.contact__inner {
  width: min(720px, 100%);
  margin: 0 auto;
}

.contact__intro {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--bark-soft);
  margin-top: 1.25rem;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form__field {
  display: flex;
  flex-direction: column;
}

.form__label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mauve);
  margin-bottom: 0.6rem;
}

.form__field input,
.form__field select,
.form__field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(75, 63, 57, 0.3);
  padding: 0.85rem 0;
  transition: border-color 0.3s var(--ease-out);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.form__field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%234B3F39' stroke-width='1.2' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.5rem;
  cursor: pointer;
}

.form__field textarea {
  resize: vertical;
  min-height: 100px;
  font-family: var(--font-body);
}

.form__field input:focus,
.form__field select:focus,
.form__field textarea:focus {
  outline: none;
  border-bottom-color: var(--bark);
}

.form__submit {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--bark);
  border: none;
  padding: 1.2rem 2.5rem;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  margin-top: 1rem;
  align-self: flex-start;
}

.form__submit:hover:not(:disabled) {
  background: var(--ink);
  transform: translateY(-2px);
}

.form__submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.form__status {
  font-size: 0.92rem;
  color: var(--bark-soft);
  min-height: 1.4rem;
}

.form__status.success { color: var(--bark); }
.form__status.error { color: #a04040; }

/* ========== CORNER MARK ========== */

.corner-mark {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  width: 56px;
  height: 56px;
  z-index: 100;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  pointer-events: none;
}

.corner-mark.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.corner-mark img {
  width: 100%;
  height: 100%;
  display: block;
  position: absolute;
  inset: 0;
  transition: opacity 0.4s var(--ease-out);
}

/* Default: show light version over hero (dark photo background) */
.corner-mark__light { opacity: 1; }
.corner-mark__dark  { opacity: 0; }

/* When scrolled into light sections, swap to dark mark */
.corner-mark.on-light .corner-mark__light { opacity: 0; }
.corner-mark.on-light .corner-mark__dark  { opacity: 1; }

@media (max-width: 480px) {
  .corner-mark { width: 44px; height: 44px; top: 1rem; left: 1rem; }
}

/* ========== FOOTER ========== */

.footer {
  background: var(--ink);
  color: var(--cream);
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter);
}

.footer__inner {
  width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem 3rem;
  align-items: center;
}

.footer__logo {
  width: auto;
  height: clamp(90px, 12vw, 130px);
  display: block;
}

.footer__links {
  display: flex;
  gap: 2rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.footer__links a {
  color: var(--cream);
  opacity: 0.85;
  transition: opacity 0.3s;
}

.footer__links a:hover { opacity: 1; }

.footer__copyright {
  grid-column: 1 / -1;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(244, 241, 232, 0.12);
  font-size: 0.78rem;
  color: rgba(244, 241, 232, 0.55);
  letter-spacing: 0.05em;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; gap: 3rem; }
  .about__image-col::before { inset: -1rem -1rem 1rem 1rem; }
  .about__image { aspect-ratio: 4 / 3; }

  .flavors__grid { grid-template-columns: 1fr; }
  .flavor { grid-column: span 1; }
  .flavor--feature { grid-template-columns: 1fr; }

  .where { grid-template-columns: 1fr; }
  .where__image-wrap { aspect-ratio: 4 / 3; }

  .form__row { grid-template-columns: 1fr; }

  .footer__inner { grid-template-columns: 1fr; text-align: left; }
  .footer__links { flex-wrap: wrap; gap: 1.25rem; }
}

@media (max-width: 480px) {
  .hero { padding: 5rem 1.25rem 3rem; }
  .hero__title { font-size: 3.2rem; }
  .where__item { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* Subtle reveal on scroll */
@media (prefers-reduced-motion: no-preference) {
  .about__grid > *,
  .flavors__grid > *,
  .where__content > *,
  .contact__inner > * {
    animation: reveal 0.9s var(--ease-out) both;
  }

  .flavor:nth-child(2) { animation-delay: 0.1s; }
  .flavor:nth-child(3) { animation-delay: 0.2s; }
  .flavor:nth-child(4) { animation-delay: 0.3s; }
  .flavor:nth-child(5) { animation-delay: 0.4s; }

  @keyframes reveal {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
