:root {
  --page-bg: #f7f4ee;
  --surface: #ffffff;
  --surface-alt: rgba(237, 236, 229, 0.95);
  --text-base: #22222a;
  --text-muted: #565656;
  --accent: #a54938;
  --accent-soft: #f2dbd6;
  --radius: 1rem;
  --shadow: 0 18px 40px rgba(31, 31, 34, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

@font-face {
  font-family: 'Norse';
  src: url('./fonts/Norse.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at top, #fff9f1 0%, var(--page-bg) 55%);
  color: var(--text-base);
  min-height: 100vh;
  line-height: 1.7;
}

body,
button,
input,
textarea,
select {
  font-family: inherit;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(165, 73, 56, 0.45);
  outline-offset: 4px;
}

main {
  padding: 2rem 1rem 3rem;
}

header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.logo {
  width: 96px;
  height: 96px;
  display: block;
}

.title {
  font-family: 'Norse', Arial, sans-serif;
  font-size: clamp(2.75rem, 4vw, 4.5rem);
  line-height: 0.95;
  text-align: center;
  margin: 0 auto;
  max-width: 12ch;
  color: #1f1811;
}

.card-container,
.recipe-container {
  max-width: 1100px;
  margin: 0 auto;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
  padding: 0 1rem;
}

.card {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease;
}

.card:hover,
.card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(31, 31, 34, 0.14);
}

.card a {
  display: block;
  color: inherit;
}

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

.card h2 {
  font-size: 1.5rem;
  padding: 1.25rem 1.25rem 1.5rem;
}

.recipe-container {
  padding: 0 1rem;
}

.recipe-image img {
  margin: 0 auto;
  width: min(100%, 540px);
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.recipe-description {
  font-size: clamp(1rem, 1.2vw, 1.18rem);
  line-height: 1.8;
  margin: 2rem auto 0;
  max-width: 860px;
  text-align: center;
}

.ingredients {
  background-color: var(--surface-alt);
  padding: 2rem;
  border-radius: calc(var(--radius) - 0.15rem);
  margin: 2rem auto 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  display: grid;
  gap: 1.5rem;
}

.ingri-title {
  font-family: 'Norse', Arial, sans-serif;
  font-size: clamp(2rem, 2.6vw, 2.3rem);
  margin-bottom: 0.75rem;
  text-align: center;
}

.ingri-subtitle,
.ingredients h2,
.ingredients h3 {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.25rem 0 0.75rem;
  color: var(--text-base);
}

.ingredients ul,
.ingredients ol {
  list-style-position: inside;
  padding-left: 0;
  margin-left: 0;
  display: grid;
  gap: 0.58rem;
}

.ingredients li {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: 0.65rem;
  position: relative;
}

.ingredients ol li {
  counter-increment: step;
}

.ingredients ol {
  counter-reset: step;
}

.ingredients li {
  padding-left: 1.5rem;
}

.instructions {
  margin-top: 2rem;
}

.instructions p,
.recipe-description p {
  margin-bottom: 1rem;
}

@media (max-width: 720px) {
  .title {
    font-size: 2.9rem;
  }

  .card img {
    height: 210px;
  }

  .ingredients {
    padding: 1.5rem;
  }
}

@media (max-width: 520px) {
  main {
    padding: 1.5rem 0 2rem;
  }

  .recipe-description,
  .ingredients,
  .recipe-image img {
    width: 100%;
  }
}
