:root {
  --sky-top: #a6dded;
  --sky-bottom: #eef9ff;
  --meadow: #edf3cc;
  --paper: rgba(255, 250, 240, 0.93);
  --paper-strong: #fffaf1;
  --ink: #30433b;
  --ink-soft: #5c6d63;
  --leaf: #6f9b71;
  --leaf-dark: #57795a;
  --gold: #f3c16f;
  --berry: #d77d67;
  --shadow: 0 18px 40px rgba(70, 86, 70, 0.14);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 30%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 38%, var(--meadow) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto auto 0 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 32rem;
  height: 18rem;
  background:
    radial-gradient(circle at 18% 80%, rgba(111, 155, 113, 0.22), transparent 30%),
    radial-gradient(circle at 48% 88%, rgba(111, 155, 113, 0.28), transparent 34%),
    radial-gradient(circle at 84% 92%, rgba(111, 155, 113, 0.2), transparent 28%);
}

body::after {
  right: 0;
  left: auto;
  width: 26rem;
  height: 14rem;
  background:
    radial-gradient(circle at 70% 85%, rgba(243, 193, 111, 0.23), transparent 24%),
    radial-gradient(circle at 36% 74%, rgba(215, 125, 103, 0.14), transparent 24%);
}

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

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin-top: 0;
}

ul,
ol {
  padding-left: 1.2rem;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.story-panel {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(125, 152, 113, 0.24);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.story-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 35%),
    radial-gradient(circle at bottom right, rgba(243, 193, 111, 0.14), transparent 25%);
}

.eyebrow {
  margin-bottom: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--leaf-dark);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 1.4rem;
  margin-bottom: 1.6rem;
}

.hero-copy,
.hero-art,
.shelf,
.recipe-detail {
  padding: 1.6rem;
}

.hero-copy h1,
.recipe-header h1 {
  margin-bottom: 0.8rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.05;
}

.hero-text,
.card-body p,
.empty-card,
.recipe-subtitle,
.note-card p {
  color: var(--ink-soft);
  line-height: 1.65;
}

.hero-text {
  max-width: 62ch;
  font-size: 1.05rem;
}

.hero-text.narrow {
  max-width: 48rem;
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.3rem;
}

.category-nav a,
.card-cta,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

.category-nav a {
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(111, 155, 113, 0.26);
  transition: transform 160ms ease, background 160ms ease;
}

.category-nav a:hover,
.category-nav a:focus-visible,
.card-link:hover .card-cta,
.card-link:focus-visible .card-cta,
.back-link:hover,
.back-link:focus-visible {
  transform: translateY(-2px);
}

.hero-art {
  min-height: 290px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06)),
    linear-gradient(180deg, rgba(120, 184, 203, 0.25), rgba(237, 243, 204, 0.3));
}

.hero-art-image {
  width: 100%;
  height: 100%;
  min-height: 290px;
  object-fit: cover;
  display: block;
}

.sun-disc {
  position: absolute;
  top: 1.6rem;
  right: 1.7rem;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, #fff5b5 0%, #f3c16f 72%, rgba(243, 193, 111, 0.2) 100%);
  box-shadow: 0 0 0 14px rgba(255, 245, 181, 0.18);
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud-one {
  width: 88px;
  height: 28px;
  top: 2.4rem;
  left: 1.7rem;
}

.cloud-one::before {
  width: 38px;
  height: 38px;
  left: 14px;
  bottom: 8px;
}

.cloud-one::after {
  width: 44px;
  height: 44px;
  right: 12px;
  bottom: 4px;
}

.cloud-two {
  width: 94px;
  height: 26px;
  top: 4.7rem;
  left: 5.5rem;
  opacity: 0.85;
}

.cloud-two::before {
  width: 34px;
  height: 34px;
  left: 18px;
  bottom: 5px;
}

.cloud-two::after {
  width: 40px;
  height: 40px;
  right: 18px;
  bottom: 0;
}

.tiny-house {
  position: absolute;
  bottom: 2.7rem;
  left: 3rem;
  width: 6.2rem;
  height: 4.7rem;
  background: #f2d0a2;
  border-radius: 16px 16px 10px 10px;
  border: 2px solid rgba(80, 61, 45, 0.15);
}

.roof {
  position: absolute;
  width: 7.2rem;
  height: 2.6rem;
  left: -0.5rem;
  top: -1.45rem;
  background: #b86e5b;
  border-radius: 18px 18px 6px 6px;
  transform: skewX(-12deg);
}

.door {
  position: absolute;
  bottom: 0;
  left: 2.45rem;
  width: 1.1rem;
  height: 2.4rem;
  background: #7b5f45;
  border-radius: 14px 14px 0 0;
}

.window {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 1.4rem;
  height: 1.4rem;
  background: #fff1a5;
  border-radius: 10px;
  box-shadow: 2.3rem 0 0 #fff1a5;
}

.grass {
  position: absolute;
  bottom: 1.4rem;
  width: 9rem;
  height: 3.8rem;
  background:
    radial-gradient(circle at 10% 100%, transparent 32%, rgba(111, 155, 113, 0.86) 33%),
    radial-gradient(circle at 30% 100%, transparent 30%, rgba(111, 155, 113, 0.88) 31%),
    radial-gradient(circle at 50% 100%, transparent 29%, rgba(111, 155, 113, 0.8) 30%),
    radial-gradient(circle at 70% 100%, transparent 34%, rgba(111, 155, 113, 0.92) 35%),
    radial-gradient(circle at 90% 100%, transparent 31%, rgba(111, 155, 113, 0.84) 32%);
}

.grass-left {
  left: 1.1rem;
}

.grass-right {
  right: 1rem;
  transform: scale(1.1);
}

.shelf-grid {
  display: grid;
  gap: 1.2rem;
}

.shelf-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.shelf-header h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2vw, 2rem);
}

.shelf-note {
  color: var(--ink-soft);
  white-space: nowrap;
}

.recipe-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 320px));
  gap: 1rem;
}

.recipe-card {
  background: rgba(255, 255, 255, 0.74);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(111, 155, 113, 0.18);
  box-shadow: 0 10px 24px rgba(65, 85, 68, 0.08);
}

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

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

.card-body {
  padding: 1rem 1rem 1.15rem;
}

.card-tag {
  margin-bottom: 0.45rem;
  color: var(--berry);
  font-size: 0.88rem;
  font-weight: 700;
}

.card-body h3 {
  margin-bottom: 0.55rem;
  font-size: 1.25rem;
  font-family: Georgia, "Times New Roman", serif;
}

.card-cta {
  margin-top: 0.55rem;
  color: var(--leaf-dark);
}

.empty-card {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
  border: 1px dashed rgba(111, 155, 113, 0.38);
}

.back-link {
  margin-bottom: 1rem;
  padding: 0.2rem 0;
}

.recipe-detail {
  padding-bottom: 2rem;
}

.recipe-header {
  margin-bottom: 1.2rem;
}

.recipe-subtitle {
  margin-bottom: 0.45rem;
  font-size: 1.15rem;
  color: var(--berry);
  font-weight: 700;
}

.recipe-time-estimate {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.photo-collage {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.8fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.photo-collage.single-photo {
  grid-template-columns: minmax(0, 840px);
  justify-content: start;
}

.photo-frame {
  padding: 0.7rem;
  background: var(--paper-strong);
  border-radius: 26px;
  border: 1px solid rgba(111, 155, 113, 0.22);
  box-shadow: 0 14px 28px rgba(68, 85, 72, 0.12);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.large-frame {
  min-height: 360px;
}

.small-frame {
  min-height: 360px;
}

.recipe-section {
  margin-top: 1.6rem;
}

.recipe-section h2 {
  margin-bottom: 0.9rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
}

.ingredient-block + .ingredient-block {
  margin-top: 1rem;
}

.ingredient-block h3 {
  margin-bottom: 0.5rem;
  color: var(--leaf-dark);
  font-size: 1.05rem;
}

.ingredient-block li,
.instruction-list li {
  margin-bottom: 0.65rem;
  line-height: 1.6;
}

.instruction-list {
  padding-left: 1.25rem;
}

.note-card {
  margin-top: 1.8rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(111, 155, 113, 0.2);
}

@media (max-width: 860px) {
  .hero,
  .photo-collage {
    grid-template-columns: 1fr;
  }

  .hero-art {
    min-height: 240px;
  }

  .shelf-header {
    flex-direction: column;
    align-items: start;
  }

  .shelf-note {
    white-space: normal;
  }

  .large-frame,
  .small-frame {
    min-height: 280px;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 1rem, 1120px);
    padding-top: 1rem;
  }

  .hero-copy,
  .hero-art,
  .shelf,
  .recipe-detail {
    padding: 1.15rem;
  }

  .hero-copy h1,
  .recipe-header h1 {
    font-size: 2.2rem;
  }

  .recipe-card img {
    height: 220px;
  }
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.portal-card {
  padding: 1.5rem;
}

.portal-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 20px;
  margin-bottom: 1rem;
  border: 1px solid rgba(111, 155, 113, 0.18);
  box-shadow: 0 10px 24px rgba(65, 85, 68, 0.08);
}

.portal-card h2,
.emulator-sidebar h2 {
  margin-bottom: 0.55rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
}

.portal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.3rem;
  height: 3.3rem;
  margin-bottom: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  font-size: 1.6rem;
  box-shadow: inset 0 0 0 1px rgba(111, 155, 113, 0.18);
}

.portal-link {
  display: inline-flex;
  margin-top: 0.9rem;
  color: var(--leaf-dark);
  font-weight: 800;
  text-decoration: none;
}

.portal-link:hover,
.portal-link:focus-visible {
  transform: translateY(-2px);
}

.emulator-header,
.emulator-panel,
.emulator-sidebar {
  padding: 1.35rem;
}

.emulator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.emulator-frame {
  padding: 1rem;
  border-radius: 28px;
  background: linear-gradient(180deg, #c8ccbe, #9ea495);
  box-shadow: inset 0 0 0 2px rgba(72, 79, 68, 0.16);
}

.dmg-header {
  background:
    radial-gradient(circle at top right, rgba(255, 250, 220, 0.55), transparent 26%),
    linear-gradient(180deg, rgba(232, 240, 200, 0.95), rgba(205, 217, 176, 0.92));
}

.dmg-badge {
  display: inline-flex;
  margin: 0 0 0.8rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(46, 63, 44, 0.08);
  color: #41533f;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.dmg-shell {
  position: relative;
  background:
    linear-gradient(180deg, #c9cfba 0%, #a7ae96 100%);
}

.dmg-shell::before {
  content: "GAME BOY";
  display: block;
  margin-bottom: 0.8rem;
  color: rgba(37, 52, 35, 0.75);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.gameboy-embed {
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #14231c;
}

.gameboy-iframe {
  display: block;
  width: 100%;
  height: 740px;
  border: 0;
  background: #14231c;
}

.emulator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.detail-list {
  padding-left: 1.15rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.emulator-note {
  margin-top: 1rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.emulator-sidebar {
  background:
    linear-gradient(180deg, rgba(241, 246, 221, 0.92), rgba(230, 237, 205, 0.92));
}

code {
  padding: 0.12rem 0.4rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.source-section {
  margin-top: 1.2rem;
  padding: 1.35rem;
}

.source-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.source-header h2 {
  margin-bottom: 0.55rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.source-stack {
  display: grid;
  gap: 1rem;
}

.source-file h3 {
  margin: 0 0 0.55rem;
  font-family: Georgia, "Times New Roman", serif;
}

.source-frame {
  margin: 0;
  padding: 1rem;
  overflow: auto;
  border-radius: 24px;
  background: rgba(42, 48, 43, 0.92);
  color: #eef5ea;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.source-frame code {
  display: block;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 0.94rem;
  line-height: 1.55;
  white-space: pre;
}

@media (max-width: 860px) {
  .emulator-layout {
    grid-template-columns: 1fr;
  }

  .gameboy-iframe {
    height: 700px;
  }

  .source-header {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .gameboy-iframe {
    height: 78vh;
    min-height: 620px;
    max-height: 760px;
  }
}

.emulator-page .ejs_virtualGamepad_open {
  display: none !important;
}
