/* BWP-Website — base styles */

:root {
  /* surfaces */
  --bg-0: oklch(0.13 0.018 235);
  --bg-1: oklch(0.17 0.020 232);
  --bg-2: oklch(0.21 0.022 230);
  --bg-3: oklch(0.26 0.025 228);

  /* borders */
  --line: oklch(0.28 0.022 228);
  --line-bright: oklch(0.38 0.028 225);

  /* text */
  --fg: oklch(0.96 0.008 215);
  --fg-2: oklch(0.82 0.012 220);
  --muted: oklch(0.62 0.015 222);
  --muted-2: oklch(0.48 0.018 224);

  /* accents */
  --green: oklch(0.80 0.16 155);
  --green-dim: oklch(0.58 0.14 155);
  --green-deep: oklch(0.38 0.10 155);
  --blue: oklch(0.74 0.15 235);
  --blue-dim: oklch(0.55 0.13 235);
  --blue-deep: oklch(0.35 0.11 235);
  --orange: oklch(0.80 0.15 50);
  --red: oklch(0.70 0.16 25);
  --purple: oklch(0.75 0.15 300);
  --turquoise: oklch(0.78 0.14 190);

  /* status */
  --warn: oklch(0.80 0.13 75);
  --bad: oklch(0.65 0.18 25);

  /* type */
  --sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  /* layout */
  --nav-h: 64px;
  --dock-h: 168px;
  --gutter: 28px;
}

* { box-sizing: border-box; }

html, body, #root {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 78% -10%, oklch(0.22 0.06 235 / 0.45), transparent 60%),
    radial-gradient(900px 500px at 6% 25%, oklch(0.22 0.07 155 / 0.30), transparent 65%),
    var(--bg-0);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

::selection {
  background: oklch(0.55 0.14 155 / 0.4);
  color: var(--fg);
}

/* === PAGE TRANSITIONS === */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: oklch(0.10 0.018 235);
  opacity: 0;
  pointer-events: none;
  transition: opacity 350ms ease;
}
.page-transition-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* === LAYOUT === */
.app {
  position: relative;
  min-height: 100vh;
  padding-bottom: var(--dock-h);
  overflow: hidden;
}

.bg-trees {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Document-flow SVG layer: scrolls with the page on the compositor.
   Width/height are JS-driven (track vw/docH from usePageSize). */
.bg-trees-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-trees-fg-celestial {
  position: absolute;
  inset: 0;
}

.bg-trees-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26vh;
  background: radial-gradient(80% 100% at 50% 100%,
    oklch(0.30 0.10 155 / 0.18), transparent 70%);
}

/* Mountains biome (Projects page) — same layering as the meadow, cool floor. */
.bg-mountains {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-mountains-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-mountains-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26vh;
  background: radial-gradient(80% 100% at 50% 100%,
    oklch(0.60 0.04 250 / 0.16), transparent 70%);
}

.app > main, .app > nav { position: relative; z-index: 2; }

.leaf-canvas {
  position: fixed;
  inset: 0;
  opacity: 0.70;
  pointer-events: none;
}

/* About: tab switcher */
.tabs {
  display: inline-flex;
  background: oklch(0.18 0.020 232);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  gap: 2px;
}
.tab {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 5px 12px;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  transition: 0.15s;
}
.tab:hover { color: var(--fg-2); }
.tab.active {
  background: oklch(0.24 0.04 155 / 0.4);
  color: var(--green);
}

/* Plain about card */
.about-plain {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  align-items: start;
}
.avatar {
  width: 92px; height: 92px;
  border-radius: 50%;
  background:
    radial-gradient(120% 120% at 30% 30%, oklch(0.42 0.13 155), oklch(0.20 0.06 155) 70%),
    var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 600;
  color: oklch(0.90 0.02 155);
  border: 1px solid oklch(0.40 0.10 155 / 0.5);
  box-shadow: 0 6px 24px oklch(0.30 0.10 155 / 0.35);
}
.avatar .ring {
  position: absolute;
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 1px dashed oklch(0.50 0.10 155 / 0.4);
}
.about-plain h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.about-plain .role {
  font-family: var(--mono);
  color: var(--green);
  font-size: 12px;
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}
.about-plain p {
  margin: 0 0 10px;
  color: var(--fg-2);
  font-size: 14.5px;
  line-height: 1.65;
}
.about-plain p strong { color: var(--fg); font-weight: 600; }
.chip-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 14px 0 16px;
}
.chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--fg-2);
  background: oklch(0.17 0.020 232 / 0.6);
}
.chip.green { color: var(--green); border-color: oklch(0.40 0.12 155 / 0.4); background: oklch(0.30 0.10 155 / 0.18); }
.chip.blue  { color: var(--blue);  border-color: oklch(0.40 0.12 230 / 0.4); background: oklch(0.30 0.10 230 / 0.18); }
.chip.orange { color: var(--orange); border-color: oklch(0.40 0.12 50 / 0.4); background: oklch(0.30 0.10 50 / 0.18); }
.chip.red { color: var(--red); border-color: oklch(0.40 0.12 25 / 0.4); background: oklch(0.30 0.10 25 / 0.18); }
.chip.purple { color: var(--purple); border-color: oklch(0.40 0.12 300 / 0.4); background: oklch(0.30 0.10 300 / 0.18); }
.chip.turquoise { color: var(--turquoise); border-color: oklch(0.40 0.12 190 / 0.4); background: oklch(0.30 0.10 190 / 0.18); }
.about-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* === NAV === */
nav.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 var(--gutter);
  background: oklch(0.13 0.018 235 / 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--green) 0%, var(--blue) 100%);
  position: relative;
  box-shadow: 0 0 0 1px var(--line-bright), 0 4px 14px oklch(0.45 0.18 200 / 0.35);
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 6px;
  border-radius: 4px;
  background: var(--bg-0);
}
.brand-mark::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 10px; height: 10px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: linear-gradient(135deg, var(--green), var(--blue));
  z-index: 1;
  border-radius: 2px;
}
.brand-name { color: var(--fg); }
.brand-sub { color: var(--muted); font-weight: 400; margin-left: 2px; }

.navlinks {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 18px;
}
.navlink {
  position: relative;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--fg-2);
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
}
.navlink:hover { color: var(--fg); background: oklch(0.95 0.01 215 / 0.04); }
.navlink.active {
  color: var(--fg);
  background: oklch(0.95 0.01 215 / 0.05);
}
.navlink.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 2px;
}

.nav-spacer { flex: 1; }

.lang {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-2);
}
.lang:hover { border-color: var(--line-bright); color: var(--fg); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--line);
  color: var(--fg);
  background: var(--bg-1);
  transition: 0.15s;
}
.btn:hover { border-color: var(--line-bright); background: var(--bg-2); }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--green-dim), var(--green-deep));
  color: oklch(0.13 0.018 235);
  font-weight: 600;
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.15) inset, 0 8px 22px oklch(0.55 0.14 155 / 0.25);
}
.btn.primary:hover {
  background: linear-gradient(180deg, var(--green), var(--green-dim));
}
.btn.ghost { background: transparent; }

/* === MAIN === */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
}

/* === HERO === */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
  margin-top: 12px;
}
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
}

.hero-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px 32px 28px;
  background:
    linear-gradient(180deg, oklch(0.18 0.025 232 / 0.85), oklch(0.15 0.020 232 / 0.7));
  overflow: hidden;
}
.hero-card::before {
  content: "";
  position: absolute; left: 0; top: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--green) 30%, var(--blue) 70%, transparent);
  opacity: 0.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--fg-2);
  background: oklch(0.20 0.022 230 / 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.tag.blue .dot { background: var(--blue); box-shadow: 0 0 8px var(--blue); }

.hero h1 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(38px, 5.6vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 6px 0 8px;
  color: var(--fg);
}
.hero h1 .accent-g { color: var(--green); }
.hero h1 .accent-b { color: var(--blue); }
.hero h1 .caret {
  display: inline-block;
  width: 0.55ch;
  height: 0.92em;
  background: var(--green);
  margin-left: 0.08em;
  vertical-align: -0.10em;
  animation: blink 1.05s steps(2) infinite;
  border-radius: 1px;
}
@keyframes blink { 50% { opacity: 0; } }

.tagline {
  font-size: 18px;
  color: var(--green-dim);
  margin: 6px 0 0;
  font-weight: 500;
  max-width: 56ch;
}
.version {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  letter-spacing: 0.04em;
}

.hero-cta {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 26px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.hero-meta > div {
  background: oklch(0.16 0.020 232 / 0.92);
  padding: 14px 16px;
}
.hero-meta dt {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-meta dd {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--fg);
  font-weight: 500;
}

/* === STATS PANEL === */
.stats-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: oklch(0.15 0.020 232 / 0.85);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.stats-head .traffic { display: flex; gap: 6px; }
.traffic span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg-3);
}
.traffic span:nth-child(1) { background: oklch(0.65 0.16 25); }
.traffic span:nth-child(2) { background: oklch(0.78 0.16 80); }
.traffic span:nth-child(3) { background: var(--green); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  flex: 1;
}
.stat {
  position: relative;
  background: oklch(0.16 0.020 232);
  padding: 16px 18px 14px;
}
.stat-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: -0.01em;
}
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--blue); }
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green-dim);
  margin-left: 8px;
}
.stat-trend.down { color: oklch(0.70 0.15 35); }
.spark {
  position: absolute;
  right: 12px; bottom: 10px;
  height: 28px; width: 80px;
  opacity: 0.85;
}

.services {
  border-top: 1px solid var(--line);
  padding: 12px 18px 14px;
  background: oklch(0.14 0.018 232);
}
.services-title {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.svc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 5px 0;
  border-bottom: 1px dashed oklch(0.30 0.022 228 / 0.5);
}
.svc-row:last-child { border-bottom: 0; }
.svc-row .name { color: var(--fg-2); }
.svc-row .meta { color: var(--muted); }
.svc-row .pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  background: oklch(0.30 0.10 155 / 0.25);
  color: var(--green);
  border: 1px solid oklch(0.40 0.12 155 / 0.4);
}
.svc-row .pill.warn {
  background: oklch(0.30 0.10 75 / 0.25);
  color: var(--warn);
  border-color: oklch(0.40 0.12 75 / 0.4);
}
.svc-row .pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

/* === SECTION HEADER === */
.section {
  margin-top: 48px;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head .label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.section-head h2 {
  font-size: 30px;
  font-weight: 600;
  margin: 4px 0 0;
  letter-spacing: -0.02em;
}
.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 60ch;
}
.section-head .right {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

/* === ABOUT + TUTORIAL === */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 24px;
}
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: oklch(0.16 0.020 232 / 0.78);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.card-head .filename { color: var(--fg-2); }
.card-head .filename b { color: var(--green); font-weight: 500; }
.card-body { padding: 22px; }

.code-block {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg-2);
  white-space: pre-wrap;
}
.code-block .kw { color: var(--blue); }
.code-block .fn { color: var(--green); }
.code-block .str { color: oklch(0.84 0.10 90); }
.code-block .com { color: var(--muted-2); font-style: italic; }
.code-block .num { color: oklch(0.78 0.13 30); }
.code-block .pun { color: var(--muted); }

.linecols {
  display: grid;
  grid-template-columns: 36px 1fr;
}
.linecols .ln {
  font-family: var(--mono);
  color: var(--muted-2);
  font-size: 12px;
  text-align: right;
  padding-right: 14px;
  user-select: none;
  border-right: 1px solid var(--line);
}
.linecols .lc { padding-left: 16px; }

/* tutorial steps */
.steps { display: flex; flex-direction: column; gap: 10px; }
.step {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: oklch(0.17 0.020 232 / 0.5);
  transition: 0.15s;
  cursor: pointer;
}
.step:hover { border-color: var(--line-bright); background: oklch(0.20 0.022 232 / 0.6); }
.step.active { border-color: var(--green-dim); background: oklch(0.22 0.05 155 / 0.18); }
.step-num {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  background: oklch(0.22 0.05 155 / 0.20);
  border: 1px solid oklch(0.40 0.10 155 / 0.4);
  border-radius: var(--r-sm);
}
.step-title {
  font-weight: 500;
  font-size: 15px;
  color: var(--fg);
}
.step-desc {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 2px;
}
.step-key {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-1);
}

/* === FARMING DOCK === */
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  height: var(--dock-h);
  background: oklch(0.11 0.018 232 / 0.86);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-top: 1px solid var(--line-bright);
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 0;
  align-items: stretch;
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.dock.sliding-out {
  transform: translateY(100%);
}
.dock::before {
  content: "";
  position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--green) 25%, var(--blue) 75%, transparent);
  opacity: 0.7;
}

.dock-section {
  padding: 14px 18px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.dock-section:last-child { border-right: 0; }

.dock-title {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.10em;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.farm-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.farm-stat .k {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.farm-stat .v {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.farm-stat .v.green { color: var(--green); }
.farm-stat .v.blue { color: var(--blue); }

.plot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  overflow-x: auto;
}
.tile {
  position: relative;
  flex: 0 0 86px;
  height: 96px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    radial-gradient(60% 80% at 50% 100%, oklch(0.20 0.05 155 / 0.55), transparent 70%),
    oklch(0.13 0.020 232);
  display: flex;
  align-items: end;
  justify-content: center;
  padding-bottom: 8px;
  cursor: pointer;
  transition: 0.18s;
  overflow: hidden;
}
.tile:hover { border-color: var(--green-dim); transform: translateY(-2px); }
.tile.empty {
  background:
    repeating-linear-gradient(45deg, transparent 0 7px, oklch(0.20 0.04 230 / 0.35) 7px 8px),
    oklch(0.13 0.020 232);
  color: var(--muted);
}
.tile .stage-svg { width: 56px; height: 64px; }
.tile .label {
  position: absolute;
  top: 6px; left: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.tile .timer {
  position: absolute;
  bottom: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--green);
}
.tile.ready {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green) inset, 0 0 28px oklch(0.55 0.14 155 / 0.30);
  animation: ready-pulse 2.4s ease-in-out infinite;
}
@keyframes ready-pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--green) inset, 0 0 18px oklch(0.55 0.14 155 / 0.30); }
  50% { box-shadow: 0 0 0 1px var(--green) inset, 0 0 32px oklch(0.55 0.14 155 / 0.50); }
}
.tile.ready .timer { color: var(--green); }

.progress {
  position: absolute;
  left: 6px; right: 6px; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: oklch(0.25 0.02 230);
  overflow: hidden;
}
.progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  transition: width 0.3s linear;
}

.farm-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.farm-controls .row { display: flex; gap: 8px; }
.farm-help {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* === Tweaks panel adjustments === */
.tweaks-trigger { display: none; } /* host owns toggle */

/* === Desktop mode toggle button === */
.desktop-toggle {
  position: fixed;
  top: 74px;
  left: 14px;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  gap: 6px;
  background: oklch(0.12 0.04 235 / 0.72);
  border: 1px solid oklch(0.35 0.10 235 / 0.45);
  color: oklch(0.65 0.10 235);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 11px;
  font-family: var(--mono);
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  -webkit-user-select: none;
  user-select: none;
}
.desktop-toggle:hover {
  background: oklch(0.18 0.06 235 / 0.88);
  color: oklch(0.82 0.14 235);
  border-color: oklch(0.45 0.12 235 / 0.65);
}
.desktop-toggle.active {
  background: oklch(0.16 0.05 235 / 0.90);
  color: oklch(0.80 0.15 235);
  border-color: oklch(0.50 0.14 235 / 0.70);
}

/* === scrollbar === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: oklch(0.45 0.03 225); }

/* footer-ish meta */
.footer-meta {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  padding: 16px 0 8px;
}

/* === Dock: helper classes for inline-style migration === */
.dock-live        { color: var(--green); }
.dock-plot-wrap   { position: relative; overflow: hidden; border-right: 1px solid var(--line); }
.dock-title-pad   { padding: 12px 18px 0; }
.dock-seed-hint   { color: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.tile-plus        { font-family: var(--mono); font-size: 22px; color: var(--muted-2); }
.farm-stat-full   { grid-column: 1 / -1; }
.xp-bar           { height: 6px; background: oklch(0.25 0.02 230); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.xp-fill          { height: 100%; background: linear-gradient(90deg, var(--green-dim), var(--blue)); transition: width 0.4s; }

/* === Dock: tabs ===================================================== */
.dock-tabs {
  display: flex;
  gap: 4px;
}
.dock-tab {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.15s;
}
.dock-tab:hover    { color: var(--fg-2); border-color: var(--line-bright); }
.dock-tab.active   { background: oklch(0.22 0.05 155 / 0.30); color: var(--green); border-color: var(--green-dim); }

/* === Dock: seed grid (inventory + shop) ============================= */
.seed-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
  max-height: 110px;
  overflow-y: auto;
}
.seed-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: oklch(0.16 0.020 232);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-2);
  cursor: pointer;
  transition: 0.15s;
  text-align: left;
}
.seed-btn:hover:not(:disabled)  { border-color: var(--green-dim); color: var(--fg); }
.seed-btn.selected               { border-color: var(--green-dim); background: oklch(0.22 0.05 155 / 0.25); color: var(--fg); }
.seed-btn.empty                  { opacity: 0.38; cursor: not-allowed; }
.seed-name  { flex: 1; }
.seed-qty   { font-size: 10px; }

/* === Dock: shop rows ================================================ */
.shop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: oklch(0.16 0.020 232);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-2);
}
.shop-row.locked { opacity: 0.38; }
.shop-lock {
  font-size: 9px;
  color: var(--muted-2);
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.shop-buy {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid var(--green-dim);
  background: oklch(0.20 0.05 155 / 0.20);
  color: var(--green);
  border-radius: 4px;
  cursor: pointer;
  transition: 0.15s;
}
.shop-buy:hover:not(:disabled) { background: oklch(0.26 0.07 155 / 0.35); }
.shop-buy:disabled              { opacity: 0.35; cursor: not-allowed; }

/* === Projects section =============================================== */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.proj-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: oklch(0.13 0.020 232);
  text-decoration: none;
  color: inherit;
  transition: 0.18s;
}
.proj-card:hover { border-color: var(--green-dim); background: oklch(0.15 0.025 232); transform: translateY(-2px); }
.proj-card-head  { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proj-name       { font-family: var(--mono); font-size: 13px; color: var(--green); font-weight: 600; }
.proj-stars      { display: flex; align-items: center; gap: 3px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.proj-desc       { font-size: 13px; color: var(--fg-2); line-height: 1.5; margin: 0; flex: 1; }
.proj-foot       { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proj-lang       { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11px; color: var(--fg-2); }

.proj-no-desc  { color: var(--muted-2); }
.proj-lang-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.chip-sm       { font-size: 10px !important; padding: 2px 7px !important; }
.proj-updated  { margin-left: auto; color: var(--muted-2); font-size: 11px; font-family: var(--mono); }

/* Contributed (non-owned) repos — blue "mountain" accent vs. the green of my own */
.proj-card--contrib {
  border-color: var(--blue-deep);
  background: oklch(0.13 0.022 245);
}
.proj-card--contrib:hover { border-color: var(--blue-dim); background: oklch(0.15 0.028 245); }
.proj-card--contrib .proj-name { color: var(--blue); }
.proj-owner    { color: var(--muted); font-weight: 400; }
.chip-contrib  { color: var(--blue); border-color: oklch(0.40 0.12 235 / 0.4); background: oklch(0.30 0.10 235 / 0.18); }

/* My annotation note from the projects table */
.proj-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--fg-2);
  border-left: 2px solid var(--green-deep);
  padding-left: 9px;
}
.proj-card--contrib .proj-note { border-left-color: var(--blue-deep); }
.link-green    { color: var(--green); }
.link-green:hover { text-decoration: underline; }

/* Skeleton */
.proj-card-skeleton { pointer-events: none; animation: skel-pulse 1.6s ease-in-out infinite; }
@keyframes skel-pulse { 0%,100% { opacity: 0.7; } 50% { opacity: 0.35; } }
.skel-line { background: oklch(0.22 0.02 232); border-radius: 4px; }
.skel-s    { width: 55%; height: 14px; margin-bottom: 10px; }
.skel-l    { width: 90%; height: 11px; margin-bottom: 6px; }
.skel-m    { width: 70%; height: 11px; }

/* Crop colour classes (replaces inline style on seed labels) */
.cc-green     { color: var(--green); }
.cc-green-dim { color: var(--green-dim); }
.cc-blue-dim  { color: var(--blue-dim); }
.cc-warn      { color: var(--warn); }
.cc-blue      { color: var(--blue); }

/* Ground plant sway is driven by JavaScript RAF in bg-trees.jsx (OakSVG)
   using SVG rotate(angle,0,0) on inner <g> elements — no CSS needed. */

/* === Drag and Drop UI === */
body.farm-dragging main,
body.farm-dragging nav.topbar {
  opacity: 0;
  pointer-events: none;
}

body main, body nav.topbar {
  transition: opacity 0.3s ease;
}

/* === VOLUMETRIC LIGHT (god rays — both biomes) === */
/* WebGL volumetric light pass — screen blend means black is a no-op, so the
   shader only ever brightens what is behind it (the SVG scene). */
.god-rays-canvas,
.forest-rays-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Falling leaves, interactive piles and dust motes */
.forest-leaf-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Subtle corner darkening for depth — sits above the rays, below content */
.forest-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 95% at 50% 42%,
    transparent 55%, oklch(0.04 0.02 250 / 0.45) 100%);
}

/* === WEATHER OVERLAY (all pages) === */
.weather-dim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: oklch(0.08 0.02 245);
  opacity: 0;
  transition: opacity 2s ease;
}

.weather-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* === CONSENT BANNER (location/weather sync) === */
.consent-banner {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h, 0px) + 18px);
  transform: translateX(-50%);
  z-index: 220;
  width: min(440px, calc(100vw - 32px));
  padding: 16px 18px;
  background: oklch(0.16 0.02 235 / 0.96);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  animation: consent-in 420ms ease;
}
@keyframes consent-in {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.consent-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}
.consent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.consent-body {
  font-size: 12px;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0 0 6px;
}
.consent-body b { color: var(--green); }
.consent-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 12px;
}
.consent-actions {
  display: flex;
  gap: 10px;
}

/* === SETTINGS MENU (top bar gear) === */
.settings-wrap { position: relative; }
.settings-btn { padding: 8px 10px; }
.settings-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 150;
  width: 272px;
  padding: 12px 14px 14px;
  background: oklch(0.16 0.02 235 / 0.97);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  animation: settings-in 180ms ease;
}
@keyframes settings-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.s-head {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.s-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid oklch(1 0 0 / 0.05);
}
.s-row.s-col { flex-direction: column; align-items: stretch; }
.s-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--fg);
}
.s-hint {
  font-size: 10px;
  color: var(--muted);
}
.s-toggle {
  flex: 0 0 auto;
  width: 34px;
  height: 19px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: oklch(0.22 0.02 235);
  position: relative;
  cursor: pointer;
  transition: background 150ms ease;
}
.s-toggle .s-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
  transition: left 150ms ease, background 150ms ease;
}
.s-toggle.on { background: oklch(0.32 0.09 155); }
.s-toggle.on .s-knob { left: 17px; background: var(--green); }
.s-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.s-chip {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-2);
  background: oklch(0.20 0.02 235);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 8px;
  cursor: pointer;
}
.s-chip:hover { color: var(--fg); border-color: oklch(0.45 0.05 200 / 0.6); }
.s-chip.active {
  color: var(--green);
  border-color: oklch(0.50 0.12 155 / 0.7);
  background: oklch(0.22 0.05 155 / 0.5);
}

/* === GARDEN GAME: shovel + plant tags === */
.dock-title-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.shovel-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-2);
  background: oklch(0.20 0.02 235);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 8px;
  cursor: pointer;
}
.shovel-btn:hover { color: var(--fg); }
.shovel-btn.active {
  color: oklch(0.85 0.15 85);
  border-color: oklch(0.70 0.13 85 / 0.7);
  background: oklch(0.30 0.08 85 / 0.4);
}
body.farm-shovel-mode { cursor: crosshair; }
.seed-tag {
  margin-left: 5px;
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 3px;
  vertical-align: 1px;
}
.farm-stat .v.warn { color: oklch(0.80 0.14 60); }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE / MOBILE
   Desktop keeps the original three-column layouts; small screens get a
   hamburger nav, a collapsible bottom-sheet garden dock and single-tree
   backgrounds. New nav/dock controls below are hidden until the breakpoint.
   ═══════════════════════════════════════════════════════════════════════ */

html { overflow-x: hidden; }

/* Inline nav action group (lang/login/register) — visible on desktop only */
.nav-actions-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hamburger button — hidden on desktop, shown at the mobile breakpoint */
.nav-burger {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-1);
  padding: 0;
}
.nav-burger span {
  position: absolute;
  left: 9px; right: 9px;
  height: 2px;
  border-radius: 2px;
  background: var(--fg-2);
  transition: transform 0.22s ease, opacity 0.18s ease, top 0.22s ease;
}
.nav-burger span:nth-child(1) { top: 13px; }
.nav-burger span:nth-child(2) { top: 19px; }
.nav-burger span:nth-child(3) { top: 25px; }
.nav-burger.open span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* Mobile nav drawer (rendered only when the hamburger is open) */
.nav-drawer-backdrop {
  position: fixed;
  left: 0; right: 0;
  top: var(--nav-h);
  bottom: 0;
  z-index: 48;
  background: oklch(0.08 0.02 245 / 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: drawer-fade 180ms ease;
}
.nav-drawer {
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 49;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: oklch(0.13 0.018 235 / 0.97);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 40px oklch(0.04 0.02 245 / 0.5);
  animation: drawer-slide 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes drawer-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawer-slide {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-drawer-links { display: flex; flex-direction: column; gap: 2px; }
.nav-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px;
  font-size: 16px;
  color: var(--fg-2);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
}
.nav-drawer-link .nav-drawer-arrow { color: var(--muted-2); opacity: 0; transition: 0.15s; }
.nav-drawer-link:hover { background: oklch(0.95 0.01 215 / 0.05); color: var(--fg); }
.nav-drawer-link.active {
  color: var(--fg);
  border-color: var(--green-dim);
  background: oklch(0.22 0.05 155 / 0.18);
}
.nav-drawer-link.active .nav-drawer-arrow { color: var(--green); opacity: 1; }
.nav-drawer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.nav-drawer-actions .btn { flex: 1 1 auto; justify-content: center; }
.nav-drawer-actions .lang { flex: 0 0 auto; }

/* Garden-dock bottom-sheet handle — hidden on desktop */
.dock-handle { display: none; }

/* While the mobile nav drawer or the expanded garden sheet is open, hide
   always-on-top overlays they would otherwise poke through (the desktop-mode
   toggle floats at max z-index). */
body.nav-open .desktop-toggle,
body.dock-expanded .desktop-toggle { opacity: 0; pointer-events: none; }

/* ── Nav → hamburger. JS sets html[data-nav="compact"] at ≤900px (or when a
      view is forced). 900 is higher than the layout breakpoint so the full
      nav never overflows on landscape phones (~844px wide). ── */
html[data-nav="compact"] { --nav-h: 56px; }
html[data-nav="compact"] nav.topbar { gap: 10px; padding: 0 14px; }
html[data-nav="compact"] .navlinks,
html[data-nav="compact"] .nav-actions-inline { display: none; }
html[data-nav="compact"] .nav-burger { display: inline-block; }
html[data-nav="compact"] .brand-sub { display: none; }
/* Keep the desktop-mode toggle clear of the nav drawer (bottom-left, above
   whatever dock height is in effect) */
html[data-nav="compact"] .desktop-toggle {
  top: auto;
  bottom: calc(var(--dock-h) + 12px);
  left: 12px;
}

/* ── Tablet / phone layout. JS sets html[data-layout="mobile"] at ≤820px (or
      when forced): sheet dock, tighter spacing. ── */
html[data-layout="mobile"] { --gutter: 16px; --dock-h: 58px; }

/* MAIN spacing */
html[data-layout="mobile"] main { padding: 18px var(--gutter) 32px; }
html[data-layout="mobile"] .section { margin-top: 30px; }
html[data-layout="mobile"] .section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
html[data-layout="mobile"] .section-head h2 { font-size: 23px; }
html[data-layout="mobile"] .section-head .right { display: none; }
html[data-layout="mobile"] .footer-meta { flex-direction: column; gap: 6px; text-align: left; }

/* Force single-column even on wide screens when mobile layout is forced
   (the auto collapse lives in the 980px media query below). */
html[data-layout="mobile"] .hero { grid-template-columns: 1fr; }
html[data-layout="mobile"] .split { grid-template-columns: 1fr; }

/* HERO */
html[data-layout="mobile"] .hero { gap: 16px; margin-top: 4px; }
html[data-layout="mobile"] .hero-card { padding: 22px 18px 20px; }
html[data-layout="mobile"] .hero h1 { font-size: clamp(34px, 13vw, 56px); }
html[data-layout="mobile"] .tagline { font-size: 15px; }
html[data-layout="mobile"] .hero-cta { gap: 8px; }
html[data-layout="mobile"] .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
html[data-layout="mobile"] .hero-meta > div { padding: 11px 12px; }
html[data-layout="mobile"] .hero-meta dd { font-size: 14px; }
html[data-layout="mobile"] .stat-value { font-size: 22px; }
html[data-layout="mobile"] .stat .spark { width: 56px; height: 22px; opacity: 0.65; }

/* PROJECTS — single column */
html[data-layout="mobile"] .proj-grid { grid-template-columns: 1fr; }

/* ABOUT / TUTORIAL */
html[data-layout="mobile"] .card-body { padding: 16px; }
html[data-layout="mobile"] .about-plain { grid-template-columns: 64px 1fr; gap: 14px; }
html[data-layout="mobile"] .about-plain > div:first-child { width: 64px !important; height: 64px !important; }
html[data-layout="mobile"] .avatar { width: 64px; height: 64px; font-size: 24px; }
html[data-layout="mobile"] .linecols { grid-template-columns: 26px 1fr; }
html[data-layout="mobile"] .linecols .ln { padding-right: 8px; }
html[data-layout="mobile"] .linecols .lc { padding-left: 10px; }
html[data-layout="mobile"] .code-block { font-size: 11px; line-height: 1.6; }
html[data-layout="mobile"] .step { grid-template-columns: 30px 1fr auto; gap: 10px; padding: 12px; }

/* Hide the floating dev Tweaks panel on phones (settings gear covers users) */
html[data-layout="mobile"] .twk-panel { display: none !important; }

/* ── GARDEN DOCK → collapsible bottom sheet ───────────────────────── */
html[data-layout="mobile"] .dock {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  height: auto;
  max-height: 82vh;
}
html[data-layout="mobile"] .dock.collapsed { max-height: none; }
html[data-layout="mobile"] .dock:not(.collapsed) {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom);
}

html[data-layout="mobile"] .dock-handle {
  position: relative;
  order: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px 10px;
  border: 0;
  background: transparent;
  font-family: var(--mono);
  color: var(--fg-2);
}
html[data-layout="mobile"] .dock-handle::before {
  content: "";
  position: absolute;
  top: 5px; left: 50%;
  transform: translateX(-50%);
  width: 42px; height: 4px;
  border-radius: 2px;
  background: var(--line-bright);
}
html[data-layout="mobile"] .dock-handle-info { display: flex; align-items: center; gap: 14px; font-size: 12.5px; }
html[data-layout="mobile"] .dock-handle-info .dh-biome { color: var(--green); text-transform: capitalize; }
html[data-layout="mobile"] .dock-handle-info .dh-coins { color: var(--green); font-weight: 600; }
html[data-layout="mobile"] .dock-handle-info .dh-garden { color: var(--fg-2); }
html[data-layout="mobile"] .dock-handle-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Hide the full sections while collapsed — only the handle shows */
html[data-layout="mobile"] .dock.collapsed .dock-section,
html[data-layout="mobile"] .dock.collapsed .dock-plot-wrap { display: none; }

/* Reflow the three blocks: plot first, then shop, then full stats */
html[data-layout="mobile"] .dock-section,
html[data-layout="mobile"] .dock-plot-wrap {
  border-right: 0 !important;
  border-top: 1px solid var(--line);
  padding: 14px 16px;
}
html[data-layout="mobile"] .dock-plot-wrap { order: 1; overflow: visible; }
html[data-layout="mobile"] .dock-section:last-of-type { order: 2; }   /* inventory / shop */
html[data-layout="mobile"] .dock-section:first-of-type { order: 3; }  /* full stats + XP */

html[data-layout="mobile"] .dock-title { font-size: 11px; flex-wrap: wrap; gap: 6px; }
html[data-layout="mobile"] .dock-title-pad { padding: 0 0 4px; }

/* Touch-sized plot tiles, scrolling horizontally */
html[data-layout="mobile"] .plot { gap: 12px; padding: 8px 0 12px; }
html[data-layout="mobile"] .plot::-webkit-scrollbar { height: 0; }
html[data-layout="mobile"] .tile { flex-basis: 82px; height: 92px; }
html[data-layout="mobile"] .tile .stage-svg { width: 52px; height: 60px; }

/* Inventory / shop as a two-column tap grid */
html[data-layout="mobile"] .seed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 40vh;
}
html[data-layout="mobile"] .seed-btn,
html[data-layout="mobile"] .shop-row { padding: 9px 10px; font-size: 12.5px; }
html[data-layout="mobile"] .dock-tabs { gap: 6px; }
html[data-layout="mobile"] .dock-tab { padding: 6px 12px; font-size: 11.5px; }
html[data-layout="mobile"] .shovel-btn { padding: 6px 10px; font-size: 11.5px; }
html[data-layout="mobile"] .shop-buy { padding: 5px 10px; font-size: 11px; }
html[data-layout="mobile"] .farm-help { font-size: 11px; }
html[data-layout="mobile"] .farm-stats { grid-template-columns: 1fr 1fr; gap: 10px 16px; }

/* While dragging a plant to the scene, fade the sheet so the garden shows */
html[data-layout="mobile"] body.farm-dragging .dock { opacity: 0.16; pointer-events: none; }

/* ── Very small phones: JS sets html[data-small="1"] at ≤420px ── */
html[data-small="1"] .stats-grid { grid-template-columns: 1fr; }
html[data-small="1"] .stat .spark { display: none; }
html[data-small="1"] .hero-meta { grid-template-columns: 1fr; }
html[data-small="1"] .seed-grid { grid-template-columns: 1fr; }
html[data-small="1"] .dock-handle-info { gap: 10px; font-size: 12px; }

/* ── Short landscape (phones turned sideways) with the full desktop dock:
      shrink it so the scene stays visible above it ── */
@media (orientation: landscape) and (max-height: 460px) {
  html[data-layout="desktop"] { --dock-h: 132px; }
  html[data-layout="desktop"] .dock { height: var(--dock-h); }
  html[data-layout="desktop"] .tile { height: 76px; }
  html[data-layout="desktop"] .tile .stage-svg { width: 46px; height: 52px; }
  html[data-layout="desktop"] .seed-grid { max-height: 80px; }
}

/* Short landscape: tighten the nav drawer so all items fit / scroll */
@media (orientation: landscape) and (max-height: 500px) {
  html[data-nav="compact"] .nav-drawer { gap: 8px; }
  html[data-nav="compact"] .nav-drawer-link { padding: 9px 12px; font-size: 15px; }
  html[data-nav="compact"] .nav-drawer-actions { padding-top: 8px; }
}

/* Coarse-pointer (touch) niceties everywhere */
@media (pointer: coarse) {
  .tile:hover { transform: none; }   /* no sticky hover-lift on touch */
}
