/* 晨露小径
   改整体配色：动下面这些变量即可。
   像素块尽量保持直角，不要加圆角。 */

:root {
  --ink: #3a2a1c;
  --ink-soft: #5c4638;
  --cream: #fff6e4;
  --cream-2: #f3e4c8;
  --paper: #fffaf0;
  --wood: #6b3e22;
  --wood-deep: #3a2416;
  --wood-light: #e7c48a;
  --header: #6b3e22;
  --grass: #5f9a3c;
  --grass-deep: #4c842f;
  --focus: #143e86;
  --link: #143e86;
  --soil: #6b4423;
  --soil-light: #c6a36e;
  --line: rgba(58, 36, 22, 0.16);
  --shadow: #2a1a10;
  color-scheme: light;
}

html[data-theme="night"] {
  --grass: #243728;
  --grass-deep: #1a2b20;
  --header: #241910;
  --shadow: #070504;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 280px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei",
    "WenQuanYi Micro Hei", "文泉驿微米黑", "Source Han Sans SC", sans-serif;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--grass);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.16) 1px, transparent 1.3px),
    radial-gradient(circle at 9px 7px, rgba(0, 0, 0, 0.12) 1px, transparent 1.3px);
  background-size: 16px 16px;
}

:root:not([data-theme="night"]) .only-night {
  display: none;
}

html[data-theme="night"] .only-day {
  display: none;
}

img,
canvas,
svg {
  max-width: 100%;
}

canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--link);
}

a:hover {
  text-decoration-thickness: 2px;
}

p,
ul,
ol,
dl {
  margin: 0.55rem 0;
}

h1,
h2,
h3 {
  font-weight: 750;
  line-height: 1.25;
  margin: 0;
}

::selection {
  background: #f2c14e;
  color: #2a1a10;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--cream);
}

.skip {
  position: fixed;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 80;
  transform: translateY(-160%);
  background: var(--cream);
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  border: 3px solid var(--wood-deep);
  text-decoration: none;
}

.skip:focus {
  transform: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--header);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 46%, rgba(0, 0, 0, 0.2)),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0 2px, transparent 2px 18px);
  border-bottom: 4px solid var(--wood-deep);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
  color: var(--cream);
}

.bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 60px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.4rem 0.8rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--cream);
  text-decoration: none;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand svg {
  width: 32px;
  height: 32px;
  flex: none;
  background: #4c842f;
  border: 2px solid #2a1a10;
}

.nav-toggle,
.theme-toggle,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  border: 3px solid var(--wood-deep);
  background: var(--wood-light);
  color: var(--wood-deep);
  box-shadow: 3px 3px 0 var(--wood-deep);
  text-decoration: none;
}

.nav-toggle {
  margin-left: auto;
  background: transparent;
  color: var(--cream);
  border-color: var(--cream);
  box-shadow: none;
}

.theme-toggle {
  background: transparent;
  color: var(--cream);
  border-color: rgba(255, 246, 228, 0.7);
  box-shadow: none;
  white-space: nowrap;
}

.nav-toggle:hover,
.theme-toggle:hover,
.btn:hover {
  transform: translate(1px, 1px);
}

.btn:hover {
  box-shadow: 2px 2px 0 var(--wood-deep);
}

.btn:active,
.nav-toggle:active,
.theme-toggle:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.btn-primary {
  background: var(--wood);
  color: var(--cream);
}

.btn-primary:hover {
  background: #814c2c;
}

.bars {
  display: grid;
  gap: 4px;
}

.bars i {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.theme-toggle .icon {
  width: 18px;
  height: 18px;
  display: block;
}

.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.45rem;
  background: #542f18;
  border-bottom: 4px solid var(--wood-deep);
}

.site-nav.is-open {
  display: flex;
}

.site-nav a {
  color: var(--cream);
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="location"] {
  background: var(--cream);
  color: var(--wood-deep);
  border-color: var(--wood-deep);
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 0.9rem 2.5rem;
}

.block {
  margin: 1.4rem 0;
}

#top,
#about,
#projects,
#garden,
#contact {
  scroll-margin-top: 5rem;
}

.frame {
  background: #6b3e22;
  border: 4px solid #2a1a10;
  box-shadow: 0 8px 0 rgba(42, 26, 16, 0.28);
  padding: 10px 10px 0;
}

#scene {
  display: block;
  width: 100%;
  height: auto;
  background: #7ec8ea;
}

html[data-theme="night"] #scene {
  background: #10182e;
}

.plaque {
  margin: 10px -10px 0;
  padding: 0.95rem 1rem 1.05rem;
  text-align: center;
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 32%),
    #6b3e22;
}

.plaque-kicker,
.kicker {
  display: inline-block;
  margin: 0;
  padding: 0.08rem 0.4rem;
  background: var(--wood-deep);
  color: var(--cream);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.plaque h1 {
  margin: 0.35rem 0 0.2rem;
  font-size: clamp(2rem, 8vw, 3.1rem);
  letter-spacing: 0.01em;
}

.role-chip {
  display: inline-block;
  margin: 0.15rem 0;
  padding: 0.12rem 0.55rem;
  background: var(--wood-light);
  color: var(--wood-deep);
  font-weight: 750;
}

.tagline {
  margin: 0.45rem auto 0;
  max-width: 28rem;
  font-size: 1.05rem;
}

.plaque-note,
.weather,
.plaque-links {
  margin: 0.35rem auto 0;
  max-width: 36rem;
  color: #fff1d4;
  font-size: 0.92rem;
}

.plaque a {
  color: #fff6e4;
  font-weight: 750;
}

.plaque-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.section-head {
  margin: 0 0 0.75rem;
}

.section-head h2 {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.35rem 0.75rem;
  background: var(--wood);
  color: var(--cream);
  border: 3px solid var(--wood-deep);
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.panel {
  position: relative;
  background-color: var(--cream);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 30%),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(90, 60, 30, 0.035) 3px, rgba(90, 60, 30, 0.035) 4px);
  color: var(--ink);
  border: 4px solid var(--wood-deep);
  box-shadow:
    0 0 0 4px var(--wood-light),
    8px 8px 0 rgba(42, 26, 16, 0.28);
  padding: 1rem 1rem 1.15rem;
  color-scheme: light;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid var(--line);
  pointer-events: none;
}

.panel > * {
  position: relative;
}

.lede {
  font-size: 1.05rem;
}

.about-grid,
.cards,
.soil-bed,
.contact-grid {
  min-width: 0;
}

.portrait-wrap {
  width: fit-content;
  margin: 0.3rem auto 0.6rem;
  padding: 8px;
  background: var(--wood);
  border: 4px solid var(--wood-deep);
  box-shadow: 4px 4px 0 var(--shadow);
}

#portrait {
  display: block;
  width: 168px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.portrait-caption {
  margin: 0.35rem auto 0;
  max-width: 16rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.sample {
  margin-top: 0.8rem;
  padding-top: 0.2rem;
}

.plain-list {
  padding-left: 1.15rem;
}

.plain-list li + li {
  margin-top: 0.28rem;
}

.timeline {
  list-style: none;
  padding: 0;
}

.timeline li {
  padding: 0.35rem 0 0.35rem 0.8rem;
  border-left: 4px solid var(--wood-light);
}

.jump-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.cards {
  display: grid;
  gap: 0.9rem;
}

.project-card h3 {
  margin: 0.45rem 0 0.2rem;
  font-size: 1.28rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin: 0.55rem 0 0.8rem;
}

.meta dt {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.meta dd {
  margin: 0;
  font-weight: 750;
}

.project-card .btn {
  width: 100%;
}

.seed-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.7rem 0;
}

.seed {
  flex: 1 1 5.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-height: 44px;
  padding: 0.3rem 0.35rem 0.4rem;
  border: 3px solid var(--wood-deep);
  background: var(--wood-light);
  color: var(--wood-deep);
  box-shadow: 3px 3px 0 var(--wood-deep);
}

.seed canvas {
  width: 40px;
  height: 44px;
}

.seed[aria-checked="true"] {
  background: var(--paper);
  box-shadow: inset 0 0 0 3px #f2c14e, 3px 3px 0 var(--wood-deep);
}

.soil-bed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.4rem 0 0.9rem;
  padding: 0.7rem;
  background-color: #6b4423;
  background-image:
    radial-gradient(#8d5a32 1.2px, transparent 1.5px),
    radial-gradient(#4a2c18 1.2px, transparent 1.5px);
  background-size: 11px 11px, 17px 17px;
  background-position: 0 0, 5px 7px;
  border: 6px solid #4a2c18;
}

.plot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.1rem;
  min-height: 132px;
  padding: 0.3rem 0.2rem 0.4rem;
  border: 3px solid #3a2416;
  background: #c6a36e;
  color: var(--ink);
  box-shadow: inset 0 -6px 0 #a88450;
}

.plot canvas {
  width: 80px;
  height: 88px;
}

.plot-name {
  background: var(--cream);
  padding: 0.02rem 0.35rem;
  font-weight: 750;
  font-size: 0.86rem;
}

.plot-stage {
  font-size: 0.75rem;
  color: var(--wood-deep);
}

.plot[data-ripe="true"] {
  animation: ripe 1.4s steps(2, end) infinite;
}

.drops {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}

.drops i {
  width: 4px;
  height: 6px;
  background: #3a86b0;
  opacity: 0;
}

.plot.is-wet .drops i {
  animation: drip 0.5s steps(3, end);
}

.plot.is-wet .drops i:nth-child(2) {
  animation-delay: 0.08s;
}

.plot.is-wet .drops i:nth-child(3) {
  animation-delay: 0.16s;
}

.plot.is-acting {
  transform: translateY(2px);
}

.status {
  min-height: 1.6em;
  margin: 0.2rem 0 0.6rem;
  font-weight: 650;
}

.basket {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.basket-empty {
  margin: 0;
  color: var(--ink-soft);
}

.basket-title {
  font-weight: 750;
}

.basket-chip {
  background: var(--paper);
  border: 2px solid var(--wood-deep);
  padding: 0.12rem 0.45rem;
}

.keyhint {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.contact-grid label {
  display: block;
  font-weight: 750;
  margin-top: 0.7rem;
}

input,
textarea {
  display: block;
  width: 100%;
  margin-top: 0.28rem;
  padding: 0.55rem 0.6rem;
  border: 3px solid var(--wood-deep);
  background: #fff;
  color: var(--ink);
  color-scheme: light;
}

textarea {
  resize: vertical;
  min-height: 7rem;
}

::placeholder {
  color: #5c4638;
  opacity: 1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.8rem;
}

#draft-output {
  margin-top: 0.8rem;
}

.contact-lines:empty {
  display: none;
}

.contact-lines {
  padding-left: 1.15rem;
}

.fence {
  height: 36px;
  margin: 0.35rem 0 0.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='32' shape-rendering='crispEdges'%3E%3Crect x='0' y='10' width='28' height='3' fill='%23e6c69a'/%3E%3Crect x='0' y='18' width='28' height='3' fill='%238d5a32'/%3E%3Crect x='4' y='4' width='5' height='24' fill='%236b3e22'/%3E%3Crect x='4' y='4' width='2' height='24' fill='%23f0d7b0'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  background-size: 28px 32px;
}

.site-footer {
  background: #3a2416;
  color: #fff6e4;
  padding: 1.15rem 0.9rem 1.5rem;
}

.site-footer .wrap {
  max-width: 1080px;
  margin: 0 auto;
}

.site-footer p {
  margin: 0.35rem 0;
  max-width: 46rem;
}

.site-footer a {
  color: #fff6e4;
}

dialog {
  padding: 0;
  border: 4px solid var(--wood-deep);
  background: var(--cream);
  color: var(--ink);
  width: min(40rem, calc(100vw - 1.25rem));
  max-height: min(86vh, 44rem);
  overflow: auto;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.45);
  color-scheme: light;
}

dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog::backdrop {
  background: rgba(18, 22, 14, 0.68);
}

.dialog-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: var(--wood);
  color: var(--cream);
}

.dialog-bar h2 {
  font-size: 1.25rem;
  padding-top: 0.35rem;
}

.dialog-body {
  padding: 0.9rem 1rem 1.2rem;
}

.dialog-body .detail > :first-child {
  margin-top: 0;
}

.noscript {
  max-width: 1080px;
  margin: 0.8rem auto;
  padding: 0 0.9rem;
}

@keyframes ripe {
  50% {
    box-shadow: inset 0 0 0 3px #f2c14e, inset 0 -6px 0 #a88450;
  }
}

@keyframes drip {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(18px);
  }
}

@media (min-width: 720px) {
  html {
    font-size: 17px;
  }

  main {
    padding-inline: 1.25rem;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    margin-left: auto;
    padding: 0;
    background: transparent;
    border: 0;
    width: auto;
  }

  .about-grid {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 1.1rem;
    align-items: start;
  }

  .portrait-wrap,
  .portrait-caption {
    margin-left: 0;
    margin-right: 0;
    text-align: left;
  }

  .soil-bed {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (min-width: 980px) {
  html {
    font-size: 18px;
  }

  .cards,
  .soil-bed {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .soil-bed {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 1.2rem;
    align-items: start;
  }
}

@media (max-width: 380px) {
  .brand-name {
    font-size: 0.95rem;
  }

  .theme-toggle .toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .theme-toggle {
    min-width: 44px;
    padding-inline: 0.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .btn:hover,
  .nav-toggle:hover,
  .theme-toggle:hover,
  .plot.is-acting {
    transform: none;
  }

  .plot[data-ripe="true"] {
    box-shadow: inset 0 0 0 3px #f2c14e, inset 0 -6px 0 #a88450;
  }
}

@media (forced-colors: active) {
  .btn,
  .panel,
  .plot,
  .seed,
  .site-nav a,
  .frame,
  dialog {
    border: 2px solid ButtonText;
  }
}

@media print {
  .site-header {
    position: static;
  }

  .nav-toggle,
  .theme-toggle,
  .skip {
    display: none;
  }

  body {
    background: #fff;
  }

  .panel,
  .frame {
    box-shadow: none;
  }
}
