/* Skyview Mountain — shared stylesheet
   Used by: index.html, mushroom/, flower/, bird/
*/

:root {
  /* Core palette — naturalist's notebook */
  --bg: #f5f1e8;
  --bg-deep: #ebe4d2;
  --panel: #ffffff;
  --panel-soft: #faf6ec;
  --ink: #2a261f;
  --ink-soft: #4a4439;
  --muted: #7a7368;
  --rule: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(60, 50, 30, 0.05);
  --shadow: 0 6px 24px rgba(60, 50, 30, 0.08);
  --shadow-lg: 0 14px 40px rgba(60, 50, 30, 0.12);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  /* Theme accents — overridden per page */
  --accent: #4a6b3a;          /* default forest green */
  --accent-deep: #36502a;
  --accent-soft: #d4dec5;
  --accent-tint: #eef3e6;

  /* Status colors */
  --warn-bg: #fdf3df;
  --warn-border: #c08a1f;
  --danger: #9b1c1c;
  --good: #1f6d3a;
}

/* Per-page accent themes */
.theme-mushroom {
  --accent: #6b4f2a;
  --accent-deep: #4d3819;
  --accent-soft: #ddc9a8;
  --accent-tint: #f6efe2;
}
.theme-flower {
  --accent: #8a3f7a;
  --accent-deep: #6f3162;
  --accent-soft: #e6d2e2;
  --accent-tint: #faf3f7;
}
.theme-bird {
  --accent: #2c5d7a;
  --accent-deep: #224a62;
  --accent-soft: #c9dde8;
  --accent-tint: #f4f9fc;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); }
a:hover { color: var(--accent-deep); }

/* ------ Layout containers ------ */

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.wrap-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ------ Hero (landing page) ------ */

.hero {
  background:
    radial-gradient(ellipse at top, rgba(255,255,255,0.6), transparent 60%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 100%);
  padding: 80px 20px 50px;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}
.hero .mountains {
  font-size: 38px;
  letter-spacing: 8px;
  margin-bottom: 12px;
  opacity: 0.55;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 46px);
  letter-spacing: -0.02em;
  font-weight: 600;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
}
.hero .lede {
  margin: 0 auto;
  max-width: 580px;
  color: var(--muted);
  font-size: 17px;
}

/* ------ Page header (sub-pages) ------ */

.crumbs {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
  margin-right: 4px;
}
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: 0.4; margin: 0 6px; }

.page-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.page-title .icon { margin-right: 8px; }
.page-tag {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
}

/* ------ Cards ------ */

.card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 20px;
  border: 1px solid var(--rule);
}

/* ------ Landing page grid of apps ------ */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.app-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: block;
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.app-card .icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 14px;
  display: block;
}
.app-card h2 {
  margin: 0 0 8px;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 600;
}
.app-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}
.app-card .go {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-deep);
}
.app-card.mushroom { --accent: #6b4f2a; --accent-deep: #4d3819; }
.app-card.flower   { --accent: #8a3f7a; --accent-deep: #6f3162; }
.app-card.bird     { --accent: #2c5d7a; --accent-deep: #224a62; }
.app-card .icon { color: var(--accent); }

.about {
  margin-top: 50px;
  padding: 28px;
  background: var(--panel-soft);
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}
.about h3 {
  margin: 0 0 10px;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 600;
}
.about p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 14.5px;
}
.about p:last-child { margin-bottom: 0; }

/* ------ Warning / advisory boxes ------ */

.advisory {
  background: var(--warn-bg);
  border-left: 4px solid var(--warn-border);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.advisory strong { color: var(--danger); }
.advisory.info {
  background: var(--accent-tint);
  border-left-color: var(--accent);
}

/* ------ Token banner (prominent at top of each app) ------ */

.token-banner {
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 13.5px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.token-banner label { flex-shrink: 0; }
.token-banner input {
  flex: 1;
  min-width: 200px;
  padding: 7px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 13px;
  font-family: ui-monospace, Menlo, Monaco, monospace;
  background: #fff;
}
.token-banner a { color: var(--accent-deep); }
.token-banner .saved {
  color: var(--good);
  font-size: 12px;
  font-weight: 500;
}

/* ------ Drop zone ------ */

.drop {
  border: 2px dashed var(--accent-soft);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  background: var(--panel);
}
.drop:hover, .drop.drag {
  background: var(--accent-tint);
  border-color: var(--accent);
}
.drop input { display: none; }
.drop p { margin: 6px 0; color: var(--muted); }
.drop .big { font-size: 17px; color: var(--ink); font-weight: 500; }

/* ------ Preview & results ------ */

.preview-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 20px;
}
.preview-img {
  width: 280px;
  height: 280px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.preview-meta {
  flex: 1;
  min-width: 220px;
}
.preview-meta .filename { font-weight: 500; }
.preview-meta .filesize {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.row-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ------ Buttons ------ */

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.btn:hover { background: var(--accent-deep); }
.btn:disabled {
  background: #b6ada0;
  cursor: not-allowed;
}
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
}
.btn.ghost:hover {
  background: var(--accent-tint);
  color: var(--accent-deep);
}

/* ------ Status line ------ */

.status {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  min-height: 20px;
}
.status.err { color: var(--danger); }
.status.ok { color: var(--good); }
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #ddd;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------ Results list ------ */

.results { margin-top: 20px; }
.results h3 {
  margin: 14px 0 10px;
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 600;
}
.results .meta-line {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.results code {
  background: var(--panel-soft);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  margin-bottom: 8px;
  border: 1px solid var(--rule);
}
.result-item .name {
  font-weight: 500;
  text-transform: capitalize;
  flex-shrink: 0;
}
.result-item .ext-link {
  color: var(--accent-deep);
  text-decoration: none;
  font-size: 12.5px;
  margin-left: 8px;
  font-weight: normal;
}
.result-item .ext-link:hover { text-decoration: underline; }
.result-item .conf {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 13.5px;
  margin-left: 12px;
  flex-shrink: 0;
}
.result-item .bar {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 0 14px;
  max-width: 200px;
  min-width: 60px;
}
.result-item .bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* ------ Reference / tips card ------ */

.reference h3 {
  margin: 4px 0 12px;
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 600;
}
.reference ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 14.5px;
}
.reference li { margin-bottom: 7px; }
.reference li b { color: var(--ink); font-weight: 600; }

/* ------ Footer ------ */

footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 30px 20px 40px;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ------ Small screens ------ */

@media (max-width: 600px) {
  .wrap, .wrap-narrow { padding: 24px 14px 60px; }
  .hero { padding: 50px 18px 32px; }
  .hero h1 { font-size: 30px; }
  .preview-img { width: 100%; height: auto; max-height: 320px; }
  .result-item .bar { display: none; }
}
