@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,600&display=swap");

:root {
  --cream: #f8f3e9;
  --cream-deep: #f1e7d8;
  --paper: #fffdf8;
  --beige: #ead9c5;
  --terracotta: #b65f43;
  --terracotta-dark: #94452f;
  --terracotta-soft: #f2ddd3;
  --brown: #38251e;
  --brown-muted: #725f56;
  --line: #dfd0c0;
  --danger: #a33e32;
  --shadow: 0 18px 50px rgb(74 44 31 / 8%);
  --shadow-hover: 0 24px 55px rgb(74 44 31 / 14%);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 30px;
  font-family: "DM Sans", sans-serif;
  color: var(--brown);
  background: var(--cream);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 6%, rgb(182 95 67 / 8%), transparent 24rem),
    var(--cream);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgb(182 95 67 / 35%);
  outline-offset: 3px;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  z-index: 30;
  top: -100px;
  left: 16px;
  padding: 12px 18px;
  color: var(--paper);
  background: var(--brown);
}

.skip-link:focus { top: 12px; }

.app {
  min-height: 100vh;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgb(114 95 86 / 12%);
  background: rgb(248 243 233 / 88%);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 48% 52%;
  color: var(--paper);
  background: var(--terracotta);
  transform: rotate(-3deg);
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand strong {
  font-family: "Fraunces", serif;
  font-size: 19px;
  font-weight: 600;
}

.brand small {
  margin-top: 4px;
  color: var(--brown-muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.instagram-link,
.instagram-placeholder {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.instagram-link {
  text-decoration: none;
}

.instagram-placeholder {
  color: var(--brown-muted);
  opacity: 0.75;
}

.hero {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
  padding-block: 64px 56px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--terracotta-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero h1,
.detail-heading h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.03;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(45px, 6.2vw, 76px);
}

.hero h1 em {
  color: var(--terracotta);
  font-style: italic;
}

.hero-description {
  max-width: 540px;
  margin: 24px 0 0;
  color: var(--brown-muted);
  font-size: 18px;
  line-height: 1.65;
}

.hero-flourish {
  position: relative;
  width: 178px;
  height: 178px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--terracotta);
  background: rgb(255 253 248 / 56%);
}

.hero-flourish::before,
.hero-flourish::after {
  content: "";
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.hero-flourish::before {
  inset: 18px;
}

.hero-flourish::after {
  inset: 37px;
  border-style: dashed;
}

.hero-flourish span {
  position: absolute;
  z-index: 1;
  font-family: "Fraunces", serif;
  font-size: 25px;
}

.hero-flourish span:nth-child(1) {
  top: 32px;
  left: 43px;
}

.hero-flourish span:nth-child(2) {
  font-size: 19px;
}

.hero-flourish span:nth-child(3) {
  right: 47px;
  bottom: 31px;
}

.catalog-section {
  padding-bottom: 100px;
}

.catalog-heading {
  margin-bottom: 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.catalog-heading h2,
.section-heading-row h2,
.notes-card h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 34px;
  font-weight: 600;
}

.search-field {
  width: min(100%, 390px);
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding-inline: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--brown-muted);
  background: var(--paper);
  box-shadow: 0 8px 30px rgb(74 44 31 / 5%);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.search-field:focus-within {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 4px rgb(182 95 67 / 10%);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--brown);
  background: transparent;
  font-size: 15px;
}

.search-field input::placeholder {
  color: #927e73;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.recipe-card {
  overflow: hidden;
  border: 1px solid rgb(223 208 192 / 85%);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.catalog-grid:has(.recipe-card:only-child) .recipe-card {
  max-width: 500px;
}

.card-image-link {
  display: block;
  text-decoration: none;
}

.card-image-link img {
  width: 100%;
  height: 245px;
  object-fit: cover;
}

.image-placeholder {
  position: relative;
  min-height: 370px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border-radius: var(--radius-lg);
  color: var(--brown-muted);
  background:
    linear-gradient(145deg, rgb(242 221 211 / 80%), rgb(234 217 197 / 55%)),
    var(--cream-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.image-placeholder.compact {
  min-height: 245px;
  border-radius: 0;
}

.placeholder-icon {
  position: relative;
  z-index: 2;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(148 69 47 / 20%);
  border-radius: 50%;
  color: var(--terracotta);
  background: rgb(255 253 248 / 72%);
}

.compact .placeholder-icon {
  width: 66px;
  height: 66px;
}

.placeholder-orbit {
  position: absolute;
  border: 1px solid rgb(148 69 47 / 14%);
  border-radius: 50%;
}

.orbit-one {
  width: 280px;
  height: 280px;
  top: -105px;
  right: -85px;
}

.orbit-two {
  width: 220px;
  height: 220px;
  bottom: -105px;
  left: -35px;
}

.card-body {
  padding: 25px 26px 27px;
}

.card-body h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 29px;
  font-weight: 600;
}

.yield {
  margin: 11px 0 24px;
  color: var(--brown-muted);
  font-size: 14px;
}

.yield strong {
  color: var(--brown);
}

.text-link,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--terracotta-dark);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.text-link .icon {
  transition: transform 180ms ease;
}

.text-link:hover .icon {
  transform: translateX(4px);
}

.state-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  background: rgb(255 253 248 / 60%);
}

.state-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 50%;
  color: var(--terracotta);
  background: var(--terracotta-soft);
}

.state-card h1,
.state-card h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 29px;
}

.state-card p {
  max-width: 460px;
  margin: 11px 0 22px;
  color: var(--brown-muted);
  line-height: 1.6;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--terracotta);
  color: var(--paper);
  background: var(--terracotta);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--brown);
  background: var(--paper);
}

.skeleton-card:hover {
  transform: none;
}

.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--cream-deep), var(--paper), var(--cream-deep));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-image {
  height: 245px;
  border-radius: 0;
}

.skeleton-line {
  height: 18px;
  margin-block: 14px;
}

.skeleton-line.short {
  width: 35%;
  height: 10px;
}

.skeleton-line.tiny {
  width: 55%;
  height: 12px;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.detail-main {
  padding: 34px 0 100px;
}

.back-link {
  min-height: 44px;
  margin-bottom: 30px;
}

.detail-heading {
  margin-bottom: 34px;
}

.detail-heading h1 {
  font-size: clamp(44px, 5vw, 65px);
}

.detail-heading > p:last-child {
  margin: 14px 0 0;
  color: var(--brown-muted);
}

.detail-heading strong {
  color: var(--brown);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  align-items: start;
  gap: 30px;
}

.detail-aside,
.detail-content {
  display: grid;
  gap: 22px;
}

.detail-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.calculator-card,
.ingredients-card,
.notes-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.calculator-card {
  padding: 29px;
  border-color: rgb(182 95 67 / 42%);
  background:
    radial-gradient(circle at 95% 0%, rgb(182 95 67 / 13%), transparent 14rem),
    var(--paper);
}

.calculator-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.calculator-heading h2 {
  max-width: 370px;
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 31px;
  line-height: 1.15;
}

.original-badge {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 99px;
  color: var(--terracotta-dark);
  background: var(--terracotta-soft);
  font-size: 12px;
  font-weight: 700;
}

.stepper {
  margin-top: 29px;
  display: grid;
  grid-template-columns: 58px minmax(100px, 1fr) 58px;
  align-items: stretch;
  gap: 10px;
}

.stepper > button {
  min-height: 66px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--terracotta-dark);
  background: var(--cream);
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.stepper > button:hover:not(:disabled) {
  background: var(--terracotta-soft);
}

.stepper > button:active:not(:disabled) {
  transform: scale(0.96);
}

.stepper > button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.portion-input {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--terracotta);
  border-radius: 18px;
  background: var(--paper);
}

.portion-input label {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  color: var(--brown-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.portion-input input {
  width: 100%;
  height: 100%;
  padding: 21px 12px 2px;
  border: 0;
  outline: 0;
  color: var(--brown);
  background: transparent;
  font-size: 27px;
  font-weight: 700;
  text-align: center;
}

.portion-input:has(input[aria-invalid="true"]) {
  border-color: var(--danger);
}

.portion-input:focus-within {
  box-shadow: 0 0 0 4px rgb(182 95 67 / 16%);
}

.input-message {
  min-height: 22px;
  margin: 14px 2px 0;
  color: var(--brown-muted);
  font-size: 12px;
  line-height: 1.5;
}

.input-message.error {
  color: var(--danger);
  font-weight: 700;
}

.ingredients-card {
  padding: 30px;
}

.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
}

.section-heading-row > span {
  color: var(--terracotta-dark);
  font-size: 13px;
  font-weight: 700;
}

.ingredients-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ingredients-list li {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
}

.ingredients-list li > span {
  min-width: 0;
  line-height: 1.35;
}

.ingredients-list strong {
  color: var(--terracotta-dark);
  font-size: 18px;
  text-align: right;
  white-space: nowrap;
}

.ingredients-list small {
  font-size: 12px;
  font-weight: 600;
}

.ingredients-note {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  color: var(--brown-muted);
  background: var(--cream);
  font-size: 12px;
  line-height: 1.55;
}

.instagram-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.instagram-card > a {
  display: block;
  text-decoration: none;
}

.reel-placeholder {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--brown-muted);
  background:
    linear-gradient(120deg, rgb(182 95 67 / 12%), transparent),
    var(--cream-deep);
  font-size: 11px;
  font-weight: 600;
}

.reel-preview {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: var(--cream-deep);
}

.reel-preview .reel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-preview .play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.play-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--terracotta);
}

.instagram-copy {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 19px;
}

.instagram-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--terracotta);
  background: var(--terracotta-soft);
}

.instagram-copy .eyebrow {
  margin-bottom: 4px;
  font-size: 9px;
}

.instagram-copy h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 20px;
}

.instagram-copy p:last-child {
  margin: 3px 0 0;
  color: var(--brown-muted);
  font-size: 12px;
}

.notes-card {
  padding: 28px;
}

.notes-card ul {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--brown-muted);
  line-height: 1.6;
}

.notes-card li + li { margin-top: 10px; }

.loading-shell { min-height: 65vh; padding-block: 70px; }

.not-found {
  min-height: 67vh;
  padding-block: 60px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--cream-deep);
}

.site-footer .shell {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--brown-muted);
  font-size: 13px;
}

.brand-footer {
  color: var(--brown);
  font-family: "Fraunces", serif;
  font-size: 17px;
  font-weight: 600;
}

.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;
}

@media (max-width: 900px) {
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-flourish {
    width: 145px;
    height: 145px;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 22px;
  }

  .calculator-heading {
    display: block;
  }

  .original-badge {
    display: inline-block;
    margin-top: 14px;
  }
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 32px, 560px);
  }

  .header-inner {
    min-height: 70px;
  }

  .instagram-placeholder span:last-child,
  .instagram-link span {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-block: 46px 42px;
  }

  .hero h1 {
    font-size: clamp(41px, 12vw, 58px);
  }

  .hero-description {
    margin-top: 18px;
    font-size: 16px;
  }

  .hero-flourish {
    display: none;
  }

  .catalog-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
  }

  .search-field {
    width: 100%;
  }

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

  .catalog-section {
    padding-bottom: 72px;
  }

  .detail-main {
    padding-top: 22px;
  }

  .back-link {
    margin-bottom: 20px;
  }

  .detail-heading {
    margin-bottom: 24px;
  }

  .detail-heading h1 {
    font-size: 43px;
  }

  .detail-layout {
    display: flex;
    flex-direction: column;
  }

  .detail-aside,
  .detail-content {
    display: contents;
  }

  .detail-aside > .image-placeholder,
  .detail-aside > .detail-image {
    order: 1;
    width: 100%;
  }

  .calculator-card {
    order: 2;
  }

  .ingredients-card {
    order: 3;
  }

  .instagram-card {
    order: 4;
  }

  .notes-card {
    order: 5;
  }

  .image-placeholder {
    min-height: 245px;
  }

  .calculator-card,
  .ingredients-card {
    padding: 24px 20px;
  }

  .calculator-heading h2 {
    font-size: 28px;
  }

  .stepper {
    grid-template-columns: 56px minmax(0, 1fr) 56px;
  }

  .ingredients-list li {
    gap: 12px;
  }

  .ingredients-list strong {
    font-size: 17px;
  }
}

@media (max-width: 380px) {
  .shell {
    width: calc(100% - 24px);
  }

  .brand strong {
    font-size: 17px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
  }

  .stepper {
    grid-template-columns: 50px minmax(0, 1fr) 50px;
    gap: 7px;
  }

  .section-heading-row {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
