:root.stardew-theme {
  --sd-paper: #f5e8bf;
  --sd-paper-deep: #e9d7a4;
  --sd-paper-line: rgba(88, 58, 29, 0.10);
  --sd-wood-dark: #5c3415;
  --sd-wood-mid: #8a531f;
  --sd-wood-light: #b06e2e;
  --sd-gold: #f7c955;
  --sd-blue: #2f6eb4;
  --sd-green: #3f7d31;
  --sd-shadow: rgba(0, 0, 0, 0.24);
  --sd-text: #4d2d16;
}

html.stardew-theme {
  background: #7cc4f7;
  min-height: 100%;
}

html.stardew-theme body {
  background:
    linear-gradient(180deg, rgba(124,196,247,0.12), rgba(124,196,247,0.12)),
    url('assets/stardew/hero_farm_scene_notrees.png') center top / cover fixed no-repeat;
  color: var(--sd-text);
  min-height: 100vh;
  overflow-x: hidden;
}

.stardew-theme { image-rendering: pixelated; }
.stardew-theme .container { position: relative; z-index: 2; }

.stardew-theme .page-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: clip;
}

.stardew-theme .scene-bird {
  position: fixed;
  top: 14vh;
  left: calc(100vw + 24px);
  width: 78px;
  height: 54px;
  background: url('assets/stardew/bird.gif') no-repeat center/contain;
  animation: sdBirdFly 24s linear infinite;
  opacity: .82;
  will-change: transform;
}

@keyframes sdBirdFly {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-100vw - 180px)); }
}

.stardew-theme section {
  position: relative;
  margin-bottom: 34px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.03)),
    url('assets/stardew/helpwanted_wood_tile2.png') center/152px 172px repeat;
  border: 4px solid #5a310f;
  box-shadow: 10px 10px 0 var(--sd-shadow);
  overflow: hidden;
}

.stardew-theme section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 3px rgba(153, 94, 39, 0.95),
    inset 0 0 0 7px rgba(90, 49, 15, 0.98);
}

.stardew-theme section::after {
  content: none;
}

.stardew-theme .hero-card {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 22px 0 42px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.stardew-theme .hero-sign,
.stardew-theme .section-body {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, rgba(246,235,198,0.995), rgba(236,220,173,0.99));
  border: 3px solid #7a4b22;
  box-shadow:
    inset 0 0 0 2px #fff7db,
    4px 4px 0 rgba(90,49,15,.14);
}

.stardew-theme .hero-sign::before,
.stardew-theme .section-body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0 34px, var(--sd-paper-line) 34px 35px);
  opacity: .18;
}

.stardew-theme .hero-sign::after,
.stardew-theme .section-body::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(123, 75, 34, 0.18);
}

.stardew-theme .hero-sign > *,
.stardew-theme .section-body > * {
  position: relative;
  z-index: 1;
}

.stardew-theme .hero-sign {
  width: min(760px, 100%);
  max-width: 760px;
  min-height: 0;
  padding: 22px 28px 20px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(248,239,206,0.93), rgba(239,224,180,0.9));
  border: 2px solid rgba(122, 75, 34, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255,247,219,0.94),
    0 12px 28px rgba(0,0,0,.10);
  clip-path: none;
  text-align: center;
}

.stardew-theme .hero-sign::before {
  opacity: .10;
}

.stardew-theme .section-body {
  padding: 24px;
  margin-top: 6px;
}

.stardew-theme .intro {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.stardew-theme .resume-item,
.stardew-theme .project-card,
.stardew-theme .meta-card,
.stardew-theme .quest-note {
  position: relative;
  background: rgba(255, 250, 236, 0.42);
  border: 1px solid rgba(92,52,21,.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.24);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.stardew-theme .project-card,
.stardew-theme .meta-card { margin-bottom: 0; }

.stardew-theme .save-file {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 12px;
  color: #fff;
  background: linear-gradient(180deg, var(--sd-blue) 0%, #245489 100%);
  border: 3px solid var(--sd-wood-dark);
  box-shadow: inset 0 0 0 2px #78abe4, 3px 3px 0 var(--sd-shadow);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}

.stardew-theme header h1 {
  color: #653714;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  margin-bottom: 12px;
  text-shadow: 3px 3px 0 var(--sd-gold), 6px 6px 0 rgba(0,0,0,.12);
  letter-spacing: 2px;
}

.stardew-theme .tagline,
.stardew-theme .hero-copy,
.stardew-theme .resume-desc,
.stardew-theme .project-desc,
.stardew-theme .award-list,
.stardew-theme .quest-note,
.stardew-theme .intro p {
  color: var(--sd-text);
}

.stardew-theme .tagline { font-size: 13px; font-weight: 700; margin: 0 auto 10px; }
.stardew-theme .hero-copy { max-width: 660px; margin: 0 auto; font-size: 15px; line-height: 1.6; }

.stardew-theme .hero-card h1,
.stardew-theme .hero-card .tagline,
.stardew-theme .hero-card .hero-copy {
  text-shadow: none;
}

.stardew-theme .hero-card h1 {
  font-size: clamp(30px, 4.6vw, 48px);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.stardew-theme .hero-card .tagline,
.stardew-theme .hero-card .hero-copy {
  color: rgba(77,45,22,.92);
}

.stardew-theme h2,
.stardew-theme h3 {
  font-weight: 800;
  letter-spacing: 1.5px;
}

.stardew-theme h2 {
  position: relative;
  z-index: 2;
  display: inline-block;
  min-height: 52px;
  padding: 12px 22px 10px 58px;
  margin: 0 0 18px;
  color: var(--sd-text);
  background:
    url('assets/stardew/inventory_tab.png') 8px center / 40px 42px no-repeat,
    linear-gradient(180deg, #f8ecc3 0%, #e8cf8e 100%);
  border: 3px solid var(--sd-wood-dark);
  box-shadow: inset 0 0 0 2px #fff6da, 3px 3px 0 var(--sd-shadow);
  font-size: 17px;
  line-height: 1.2;
}

.stardew-theme h3 {
  color: var(--sd-text);
  margin-bottom: 12px;
  font-size: 16px;
}

.stardew-theme .resume-period {
  color: #42702d;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: .5px;
}

.stardew-theme .resume-title,
.stardew-theme .project-name {
  color: #5c3415;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
}

.stardew-theme .project-grid,
.stardew-theme .meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.stardew-theme .project-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--sd-blue);
  text-decoration: none;
  font-weight: 800;
  border-bottom: 3px solid var(--sd-blue);
}
.stardew-theme .project-link:hover { color: #2d8b4d; border-bottom-color: #2d8b4d; }

.stardew-theme .links { display: flex; flex-wrap: wrap; gap: 10px; }
.stardew-theme .link-btn {
  display: inline-block;
  padding: 14px 24px;
  background: linear-gradient(180deg, #6cab53 0%, var(--sd-green) 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  border: 4px solid var(--sd-wood-dark);
  box-shadow: inset 0 0 0 2px #96d277, 4px 4px 0 var(--sd-shadow);
}
.stardew-theme .link-btn:hover { transform: translate(-2px, -2px); box-shadow: inset 0 0 0 2px #96d277, 6px 6px 0 var(--sd-shadow); }

.stardew-theme .tags { display: flex; flex-wrap: wrap; gap: 10px; }
.stardew-theme .tag {
  display: inline-block;
  padding: 8px 12px;
  background: linear-gradient(180deg, #c5844a 0%, #9d6132 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border: 3px solid var(--sd-wood-dark);
  box-shadow: inset 0 0 0 2px #cc955f, 3px 3px 0 var(--sd-shadow);
}
.stardew-theme .award-list div + div { margin-top: 8px; }

.stardew-theme .theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  background: linear-gradient(180deg, #f9d06b 0%, #f19f34 100%);
  border: 4px solid var(--sd-wood-dark);
  color: #603411;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px #ffe193, 5px 5px 0 var(--sd-shadow);
}
.stardew-theme .theme-toggle:hover { transform: translate(-2px, -2px); box-shadow: inset 0 0 0 2px #ffe193, 7px 7px 0 var(--sd-shadow); }

.stardew-theme footer {
  text-align: center;
  color: rgb(245, 233, 201);
  padding-top: 8px;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 760px) {
  html.stardew-theme body { background-position: center top; }
  .stardew-theme .hero-card,
  .stardew-theme section { padding: 16px; }
  .stardew-theme .hero-sign,
  .stardew-theme .section-body { padding: 16px; }
  .stardew-theme .hero-sign { width: min(680px, 100%); max-width: 680px; }
  .stardew-theme h2 { padding-left: 50px; background-size: 34px 36px, auto; }
  .stardew-theme .theme-toggle { top: 12px; right: 12px; padding: 10px 14px; font-size: 12px; }
}

@media (max-width: 600px) {
  html.stardew-theme body { background-position: center top; background-size: auto 100vh; }
  .stardew-theme .project-grid,
  .stardew-theme .meta-grid { grid-template-columns: 1fr; }
  .stardew-theme header h1 { letter-spacing: 1px; }
  .stardew-theme .scene-bird { top: 11vh; width: 56px; height: 40px; }
  .stardew-theme .hero-sign { width: 100%; max-width: 100%; margin: 0 auto; padding: 14px 16px; }
  .stardew-theme h2 { min-height: 46px; padding: 10px 16px 8px 46px; }
}
