:root {
  --ink: #123c39;
  --muted: #587774;
  --paper: #f4fbfa;
  --tiffany: #81d8d0;
  --tiffany-soft: #dff6f3;
  --tiffany-pale: #edf9f8;
  --tiffany-deep: #087f77;
  --tiffany-dark: #075e58;
  --danger: #b5442f;
  --line: rgba(18, 60, 57, .14);
  --shadow: 0 24px 70px rgba(7, 94, 88, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "DM Sans", sans-serif; background-image: radial-gradient(circle at 15% 0, rgba(129,216,208,.18), transparent 25%), radial-gradient(circle at 90% 42%, rgba(129,216,208,.11), transparent 22%); }
a { color: inherit; }
button { color: inherit; font: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid rgba(7,143,133,.3); outline-offset: 3px; }
.site-header, main, footer { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.site-header { position: relative; z-index: 2; height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font: 500 20px "Newsreader", serif; text-decoration: none; }
.brand span { display: grid; place-items: center; width: 31px; height: 31px; background: var(--tiffany); border: 1px solid var(--tiffany-deep); border-radius: 50%; color: var(--tiffany-dark); font-style: italic; box-shadow: 0 0 0 5px rgba(129,216,208,.17); }
nav { display: flex; gap: 28px; }
nav a { color: var(--muted); font-size: 13px; text-decoration: none; transition: color .2s; }
nav a:hover { color: var(--tiffany-deep); }
.nav-write { padding: 6px 14px; background: var(--tiffany-dark); color: #fff !important; border-radius: 3px; font-weight: 500; transition: transform .2s, background .2s; }
.nav-write:hover { transform: translateY(-1px); background: var(--tiffany-deep); }
.write-button { display: inline-flex; align-items: center; gap: 34px; padding: 16px 20px; background: var(--tiffany-dark); color: #fff; border-radius: 3px; box-shadow: 0 10px 28px rgba(7,94,88,.18); font-size: 13px; text-decoration: none; transition: transform .2s, background .2s, box-shadow .2s; }
.write-button:hover { transform: translateY(-2px); background: var(--tiffany-deep); box-shadow: 0 14px 34px rgba(7,94,88,.24); }
.write-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.recipes-page { padding: 58px 7vw 130px; }
.section-kicker { margin: 0 0 12px; color: var(--tiffany-deep); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }

/* Section heading */
.section-heading { display: flex; align-items: end; justify-content: space-between; padding-bottom: 24px; border-bottom: 1px solid var(--ink); }
.section-heading h2 { margin: 0; scroll-margin-top: 24px; font: 400 46px "Newsreader", serif; }
.section-heading > span { color: var(--muted); font-size: 12px; }

/* Recipe grid */
.recipes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; padding-top: 36px; }
.recipe-card { position: relative; min-width: 0; overflow: hidden; padding: 30px 34px 34px; background: rgba(255,255,255,.64); border: 1px solid rgba(7,143,133,.16); border-radius: 4px 28px 4px 4px; box-shadow: 0 13px 35px rgba(7,94,88,.05); backdrop-filter: blur(6px); transition: transform .2s, border-color .2s, background .2s, box-shadow .2s; }
.recipe-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.86); border-color: rgba(7,143,133,.32); box-shadow: var(--shadow); }
.recipe-card-top { display: flex; justify-content: flex-end; gap: 12px; }
.edit-link { color: var(--muted); font-size: 11px; text-underline-offset: 3px; }
.delete-link { color: var(--muted); font-size: 11px; text-underline-offset: 3px; transition: color .2s; }
.delete-link:hover { color: var(--danger); }
.recipe-card-title { margin: 18px 0 0; font: 500 24px/1.3 "Newsreader", serif; letter-spacing: -.01em; }
.recipe-card-title a { text-decoration: none; transition: color .2s; }
.recipe-card-title a:hover { color: var(--tiffany-deep); }
.recipe-card-excerpt { margin-top: 14px; max-height: 6.6em; overflow: hidden; color: var(--ink); font: 400 17px/1.65 "Newsreader", serif; }
.recipe-card-excerpt p { display: -webkit-box; overflow: hidden; margin: 0; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.recipe-card-thumbnail { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; margin-top: 18px; background: linear-gradient(145deg, var(--tiffany-pale), rgba(255,255,255,.9)); border: 1px solid rgba(7,143,133,.18); border-radius: 12px; text-decoration: none; transition: transform .2s, border-color .2s, box-shadow .2s; }
.recipe-card-thumbnail:hover { border-color: rgba(7,143,133,.42); box-shadow: 0 12px 24px rgba(7,94,88,.12); transform: translateY(-2px); }
.recipe-card-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .25s; }
.recipe-card-thumbnail:hover img { transform: scale(1.035); }
.read-link { display: inline-block; margin-top: 20px; color: var(--tiffany-dark); font-size: 12px; font-weight: 600; text-decoration: none; }
.read-link span { margin-left: 8px; }

/* Recipe detail page */
.recipe { max-width: 780px; margin: 0 auto; padding: 72px 0 120px; }
.back-link { color: var(--muted); font-size: 12px; text-decoration: none; }
.back-link:hover { color: var(--tiffany-deep); }
.recipe > header { position: relative; overflow: hidden; margin-top: 55px; padding: 58px 64px 52px; background: linear-gradient(135deg, rgba(223,246,243,.82), rgba(255,255,255,.62)); border: 1px solid rgba(7,143,133,.16); border-radius: 4px 46px 4px 4px; box-shadow: var(--shadow); }
.recipe > header::after { content: ""; position: absolute; top: -60px; right: -55px; width: 190px; height: 190px; border: 1px solid rgba(7,143,133,.13); border-radius: 50%; box-shadow: 0 0 0 38px rgba(129,216,208,.06); }
.recipe-title-block { position: relative; z-index: 1; }
.recipe-title-block h1 { margin: 0; font: 400 clamp(36px, 5vw, 52px)/1.15 "Newsreader", serif; letter-spacing: -.03em; }
.recipe-content { padding: 56px 36px 48px; font: 400 20px/1.5 "Newsreader", serif; }
.recipe-content p { margin: 0 0 .85em; }
.recipe-content a { overflow-wrap: anywhere; }
.recipe-content img { display: block; width: auto; max-width: 100%; height: auto; margin: 1em auto; }
.recipe-content h2 { margin-top: 1.1em; font-weight: 500; }
.recipe-content ul, .recipe-content ol { padding-left: 1.4em; }
.recipe-content li { margin-bottom: .3em; }
.recipe-content blockquote { margin: 1.2em 0; padding-left: 24px; color: var(--tiffany-dark); border-left: 2px solid var(--tiffany); font-style: italic; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 20px 36px 0; }
.delete-button { display: inline-flex; align-items: center; padding: 16px 20px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; font-size: 13px; text-decoration: none; transition: color .2s, border-color .2s, background .2s; }
.delete-button:hover { color: var(--danger); border-color: rgba(181, 68, 47, .4); background: rgba(181, 68, 47, .05); }

/* Footer */
footer { display: flex; justify-content: space-between; padding: 32px 0; color: var(--muted); border-top: 1px solid var(--line); font: 400 12px "Newsreader", serif; }

.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 650px) {
  .site-header, main, footer { width: min(100% - 28px, 1120px); }
  .site-header { height: 72px; }
  nav { gap: 18px; }
  .recipes-page { padding: 48px 12px 90px; }
  .section-heading { align-items: stretch; flex-direction: column; gap: 16px; }
  .section-heading h2 { font-size: 36px; }
  .recipes-grid { grid-template-columns: 1fr; gap: 20px; padding-top: 28px; }
  .recipe-card { padding: 22px 20px 24px; }
  .recipe-card-title { font-size: 21px; }
  .recipe-card-excerpt { font-size: 16px; }
  .recipe { padding: 48px 8px 90px; }
  .recipe > header { margin-top: 40px; padding: 42px 26px 38px; border-radius: 4px 32px 4px 4px; }
  .recipe-title-block h1 { font-size: 32px; }
  .recipe-content { padding: 48px 10px 38px; }
  .recipe-actions { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
