/* Recipe Scout document pages */

@import url("https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap");

:root {
  --ink: #141414;
  --ink-soft: #4f4f4f;
  --ink-muted: #767676;
  --paper: #fffaf1;
  --surface: #ffffff;
  --surface-warm: #fff3da;
  --mint: #e7fff0;
  --sky: #effaff;
  --lavender: #f4f0ff;
  --lavender-strong: #a189da;
  --gold: #f0b94d;
  --red: #c84848;
  --border: rgba(0, 0, 0, 0.2);
  --soft-radius: 8px;
}

* {
  box-sizing: border-box;
  font-family: "Figtree", sans-serif;
  letter-spacing: 0;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--paper);
  animation: pageBackgroundShift 18s ease-in-out infinite;
}

@keyframes pageBackgroundShift {
  0%,
  100% {
    background-color: #fffaf1;
  }
  25% {
    background-color: #f1fff5;
  }
  50% {
    background-color: #f4f0ff;
  }
  75% {
    background-color: #effaff;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
}

img,
svg {
  display: block;
}

a {
  color: var(--ink);
  font-weight: 650;
  text-decoration-color: rgba(0, 0, 0, 0.28);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: #6f51b5;
  text-decoration-color: currentColor;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.header-content {
  width: min(100%, 1200px);
  margin-inline: auto;
  padding: 18px 30px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.logo:hover {
  color: var(--ink);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.logo-text .logo-name {
  margin: 0;
  color: #252525;
  font-size: 21px;
  line-height: 1;
  font-weight: 650;
}

.logo-text p:not(.logo-name) {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1;
  font-weight: 500;
}

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

nav a {
  min-height: 42px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

nav a:hover {
  color: var(--ink);
  text-decoration: none;
  transform: translateY(-1px);
  background: var(--surface-warm);
}

nav a.active {
  color: #ffffff;
  background: var(--ink);
}

main {
  width: min(100%, 900px);
  margin-inline: auto;
  padding: clamp(54px, 8vw, 92px) clamp(22px, 6vw, 64px) 54px;
  background: rgba(255, 255, 255, 0.7);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

main > h1 {
  max-width: 780px;
  margin: 0 0 24px;
  color: #000000;
  font-size: clamp(42px, 7vw, 68px);
  line-height: 1.04;
  font-weight: 620;
  text-wrap: balance;
}

h2 {
  margin: 0 0 20px;
  padding-top: 42px;
  color: #000000;
  font-size: clamp(29px, 4vw, 42px);
  line-height: 1.08;
  font-weight: 620;
  text-wrap: balance;
}

h3 {
  margin: 30px 0 10px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.22;
  font-weight: 650;
}

h4 {
  margin: 24px 0 8px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
}

p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.72;
  font-weight: 440;
}

strong {
  color: var(--ink);
  font-weight: 720;
}

em {
  color: #6f51b5;
}

section {
  margin-top: 8px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

ul,
ol {
  margin: 0 0 18px;
  padding-left: 26px;
  color: var(--ink-soft);
}

li {
  margin-bottom: 9px;
  padding-left: 4px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.62;
  font-weight: 440;
}

li::marker {
  color: var(--ink);
  font-weight: 720;
}

hr {
  height: 1px;
  margin: 42px 0 0;
  border: 0;
  background: var(--border);
}

.metadata {
  margin: 0 0 44px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.metadata-item {
  min-height: 86px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--soft-radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  background: var(--surface);
}

.metadata-label {
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  text-transform: uppercase;
}

.metadata-value {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 650;
}

.toc {
  margin: 0 calc(clamp(22px, 6vw, 64px) * -1) 36px;
  padding: 34px clamp(22px, 6vw, 64px);
  background: #222222;
  color: #ffffff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: var(--soft-radius);
}

.toc h2 {
  margin: 0 0 18px;
  padding: 0;
  color: #ffffff;
  font-size: 26px;
}

.toc ul {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  list-style: none;
}

.toc li {
  margin: 0;
  padding: 0;
}

.toc a {
  padding: 3px 0;
  display: flex;
  align-items: center;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 620;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.toc a:hover {
  color: #c8b8f2;
  transform: translateX(3px);
}

.callout,
.warning-box,
.info-box,
.contact-card {
  margin: 24px 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 8px solid var(--lavender-strong);
}

.callout p:last-child,
.warning-box p:last-child,
.info-box p:last-child,
.contact-card p:last-child,
.callout ul:last-child,
.warning-box ul:last-child,
.info-box ul:last-child,
.contact-card ul:last-child {
  margin-bottom: 0;
}

.callout.info,
.info-box,
.contact-card {
  background: var(--sky);
}

.callout.warning,
.warning-box {
  background: #fff7e8;
  border-left-color: var(--gold);
}

.callout.important {
  background: #fff1f1;
  border-left-color: var(--red);
}

.callout h3,
.warning-box h3,
.info-box h3,
.contact-card h3 {
  margin-top: 0;
}

.step-item {
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
}

.step-number {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: var(--ink);
  font-size: 18px;
  font-weight: 720;
}

.step-content h3 {
  margin-top: 0;
}

.step-content p {
  margin-bottom: 0;
}

.icon-path {
  padding: 3px 8px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  font-size: 0.88em;
  font-weight: 650;
}

footer {
  padding: 36px 0 0;
  text-align: left;
}

footer p {
  margin-bottom: 8px;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
}

.back-to-top {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 15;
  width: 52px;
  height: 52px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.back-to-top > svg {
  width: 22px;
  height: 22px;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  color: #ffffff;
  background: var(--ink);
  text-decoration: none;
  transform: translateY(-2px);
}

@media (max-width: 760px) {
  .header-content {
    padding: 16px 20px;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  nav a {
    min-height: 38px;
    padding-inline: 14px;
    font-size: 13px;
  }

  main {
    padding-top: 44px;
  }

  main > h1 {
    font-size: clamp(38px, 13vw, 52px);
  }

  p,
  li {
    font-size: 16px;
  }

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

  .metadata-item {
    min-height: 74px;
  }

  .toc ul {
    grid-template-columns: 1fr;
  }

  .step-item {
    grid-template-columns: 1fr;
  }

  .back-to-top {
    right: 18px;
    bottom: 18px;
    width: 48px;
    height: 48px;
  }
}

@media (min-width: 980px) {
  main {
    width: min(100%, 1100px);
    display: grid;
    grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
    column-gap: 56px;
    align-items: start;
  }

  main > h1,
  main > .metadata {
    grid-column: 1 / -1;
  }

  .toc {
    grid-column: 1;
    grid-row: 3 / span 999;
    position: sticky;
    top: 96px;
    margin: 0;
    padding: 22px;
    border: 1px solid var(--border);
  }

  .toc h2 {
    font-size: 21px;
  }

  .toc ul {
    grid-template-columns: 1fr;
  }

  main > section,
  main > hr,
  main > footer {
    grid-column: 2;
  }

  main > section:first-of-type h2 {
    padding-top: 0;
  }
}

@media print {
  body {
    background: #ffffff;
    animation: none;
  }

  header,
  .back-to-top {
    display: none;
  }

  main {
    width: auto;
    padding: 0;
    border: 0;
    background: #ffffff;
  }

  .toc,
  .callout,
  .warning-box,
  .info-box,
  .contact-card,
  .step-item,
  .metadata {
    break-inside: avoid;
  }
}
