/* ============ Design tokens ============ */
:root {
  --paper: #ECE4D0;
  --paper-deep: #E3DAC3;
  --rule-line: #B8C4D6;
  --margin-line: #C97B7B;
  --ink: #2B2A28;
  --ink-soft: #524F48;
  --moss: #5C7350;
  --moss-deep: #3F5236;
  --rose-dust: #B85C6B;
  --wood: #8B6A4F;
  --wood-dark: #6B4F3A;
  --wood-text: #F3EAD8;

  --font-hand: 'Caveat', cursive;
  --font-serif: 'Lora', serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
}

body {
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 27px,
      var(--rule-line) 28px
    );
  background-attachment: local;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 24px;
  width: 1px;
  height: 100%;
  background: var(--margin-line);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.hidden { display: none !important; }

/* ============ PIN gate ============ */
.pin-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  padding: 24px;
}

.pin-card {
  width: 100%;
  max-width: 320px;
  text-align: center;
  padding: 40px 28px;
  background: var(--paper-deep);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(43,42,40,0.06);
  border: 1px solid rgba(43,42,40,0.08);
}

.pin-sprig {
  font-size: 34px;
  margin-bottom: 4px;
}

.pin-title {
  font-family: var(--font-hand);
  font-size: 34px;
  font-weight: 700;
  color: var(--moss-deep);
  margin: 0 0 4px;
  line-height: 1.1;
}

.pin-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.pin-input-row { margin-bottom: 16px; }

.pin-input {
  width: 140px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 8px;
  padding: 10px 12px;
  border: none;
  border-bottom: 2px solid var(--rose-dust);
  background: transparent;
  color: var(--ink);
  outline: none;
}
.pin-input:focus { border-bottom-color: var(--moss-deep); }

.pin-submit {
  font-family: var(--font-hand);
  font-size: 20px;
  font-weight: 600;
  background: var(--moss);
  color: #FBF8F0;
  border: none;
  padding: 10px 26px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.pin-submit:hover { background: var(--moss-deep); transform: translateY(-1px); }
.pin-submit:active { transform: translateY(0); }

.pin-error {
  min-height: 18px;
  font-size: 13px;
  color: var(--rose-dust);
  margin-top: 14px;
}

/* ============ App shell ============ */
.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.header { text-align: center; margin-bottom: 30px; }

.header-eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 2px;
}

.header-title {
  font-family: var(--font-hand);
  font-size: 40px;
  font-weight: 700;
  color: var(--moss-deep);
  margin: 0;
  line-height: 1.05;
}

.header-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 8px 0 0;
}

/* ============ Pick zone ============ */
.pick-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0 44px;
}

.pick-button {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 2px dashed var(--rose-dust);
  background: rgba(184,92,107,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.pick-button:hover { transform: scale(1.05); background: rgba(184,92,107,0.11); }
.pick-button:active { transform: scale(0.97); }
.pick-button:disabled {
  cursor: default;
  opacity: 0.55;
  border-style: solid;
  border-color: var(--moss);
  background: rgba(92,115,80,0.08);
}
.pick-button:disabled:hover { transform: none; }

.bud { font-size: 44px; display: inline-block; }
.bud.bud-pulse { animation: budPulse 0.9s ease-in-out infinite; }

@keyframes budPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.pick-caption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 14px 0 0;
  text-align: center;
  max-width: 220px;
}

/* ============ Reveal overlay ============ */
.reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(43,42,40,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  animation: fadeIn 0.35s ease forwards;
}
@keyframes fadeIn { to { opacity: 1; } }

.reveal-card {
  width: 100%;
  max-width: 320px;
  background: var(--paper);
  border-radius: 8px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  transform: scale(0.85);
  opacity: 0;
  animation: revealPop 0.55s cubic-bezier(.2,.9,.25,1.1) 0.15s forwards;
}
@keyframes revealPop {
  to { transform: scale(1); opacity: 1; }
}

.reveal-image {
  width: 100%;
  max-width: 200px;
  height: auto;
  margin: 0 auto 14px;
  display: block;
}

.reveal-name {
  font-family: var(--font-hand);
  font-size: 30px;
  color: var(--moss-deep);
  margin: 0 0 8px;
}

.reveal-meaning {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 20px;
}

.reveal-close {
  font-family: var(--font-hand);
  font-size: 19px;
  font-weight: 600;
  background: var(--rose-dust);
  color: #FBF8F0;
  border: none;
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
}
.reveal-close:hover { background: #a24d5b; }

/* ============ Garden path ============ */
.garden-section { position: relative; }

.garden-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  margin: 0 0 8px;
}

.garden-container {
  position: relative;
  width: 100%;
}

.garden-path-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.garden-nodes {
  position: relative;
  width: 100%;
  z-index: 1;
}

.garden-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 130px;
  opacity: 0;
  transform: scale(0.7) translateY(14px);
  animation: nodeIn 0.6s cubic-bezier(.2,.85,.3,1.1) forwards;
}

@keyframes nodeIn {
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.garden-node img {
  width: 92px;
  height: auto;
  filter: drop-shadow(0 3px 6px rgba(43,42,40,0.18));
}

.wood-sign {
  margin-top: -6px;
  background: var(--wood);
  border: 2px solid var(--wood-dark);
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
  transform: rotate(var(--sign-tilt, -2deg));
  transition: transform 0.15s ease;
}
.wood-sign:hover { transform: rotate(var(--sign-tilt, -2deg)) scale(1.05); }

.wood-sign span {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 17px;
  color: var(--wood-text);
  white-space: nowrap;
}

.garden-end-note {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  opacity: 0.75;
  margin-top: 18px;
}

/* ============ Detail modal ============ */
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(43,42,40,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.detail-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: var(--paper);
  border-radius: 8px;
  padding: 30px 24px 26px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.detail-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(43,42,40,0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.detail-close:hover { background: rgba(43,42,40,0.15); }

.detail-image {
  width: 100%;
  max-width: 190px;
  height: auto;
  margin: 4px auto 14px;
  display: block;
}

.detail-name {
  font-family: var(--font-hand);
  font-size: 28px;
  color: var(--moss-deep);
  margin: 0 0 2px;
}

.detail-date {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-soft);
  opacity: 0.8;
  margin: 0 0 14px;
}

.detail-meaning {
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}

/* ============ Responsive ============ */
@media (max-width: 380px) {
  .header-title { font-size: 32px; }
  .garden-node { width: 108px; }
  .garden-node img { width: 78px; }
}
