/* Footpath Folio — "Topographic Trail-Register Fold"
   Pine #2f5d50 · Clay #c97b4a · Brass #f2c14e */

:root {
  --pine: #2f5d50;
  --pine-deep: #234539;
  --clay: #c97b4a;
  --brass: #f2c14e;
  --granite: #5b6770;
  --creek: #3d7ea6;
  --paper: #f4efe3;
  --paper-deep: #e9e1cf;
  --ink: #2b2a24;
  --ink-soft: #6b675a;
  --card: #fdfbf4;
  --line: rgba(47, 93, 80, 0.22);
  --radius: 14px;
  --tab-h: 68px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 85% 4%, rgba(242, 193, 78, 0.14) 0 60px, transparent 61px),
    radial-gradient(circle at 0% 40%, transparent 0 40px, rgba(47, 93, 80, 0.05) 40px 41px, transparent 41px),
    var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px calc(var(--tab-h) + 26px + env(safe-area-inset-bottom, 0px));
}

.view { padding-top: calc(14px + env(safe-area-inset-top, 0px)); animation: unfold 0.25s ease-out; }

@keyframes unfold {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- headers ---------- */

.view-head { margin-bottom: 16px; }

.wordmark {
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  color: var(--pine-deep);
  border-bottom: 3px double var(--brass);
  display: inline-block;
  padding-bottom: 2px;
}

.view-title { font-size: 1.35rem; color: var(--pine-deep); }

.view-sub { font-size: 0.82rem; color: var(--ink-soft); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- trailhead ---------- */

.trailhead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
}

.grommet {
  width: 74px; height: 74px; border-radius: 50%;
  background:
    radial-gradient(circle at 38% 34%, #ffe9a8 0 6%, var(--brass) 30%, #b98a2c 62%, #8a651d 100%);
  box-shadow: 0 2px 5px rgba(35, 69, 57, 0.35), inset 0 0 0 3px rgba(255, 255, 255, 0.25);
  position: relative;
}
.grommet::after {
  content: ""; position: absolute; inset: 42%;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

.total-disc {
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--pine);
  color: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(242, 193, 78, 0.55), 0 2px 5px rgba(35, 69, 57, 0.35);
}
.total-num { font-size: 1.5rem; font-weight: 700; line-height: 1; color: var(--brass); }
.total-word { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 3px; }

.focus-card {
  position: relative;
  background:
    radial-gradient(circle at 12% 88%, transparent 0 34px, rgba(61, 126, 166, 0.14) 34px 35px, transparent 35px),
    radial-gradient(circle at 12% 88%, transparent 0 54px, rgba(61, 126, 166, 0.12) 54px 55px, transparent 55px),
    radial-gradient(circle at 12% 88%, transparent 0 74px, rgba(61, 126, 166, 0.1) 74px 75px, transparent 75px),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px 16px;
  box-shadow: 0 6px 14px rgba(35, 69, 57, 0.14);
  overflow: hidden;
}

.focus-fold {
  position: absolute; top: 0; right: 0;
  width: 0; height: 0;
  border-top: 30px solid var(--paper-deep);
  border-left: 30px solid transparent;
}
.focus-card::before {
  content: ""; position: absolute; top: 0; right: 0;
  width: 0; height: 0;
  border-top: 30px solid rgba(35, 69, 57, 0.18);
  border-left: 30px solid transparent;
  transform: translateX(1px);
}

.focus-kicker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--clay); font-weight: 700; }
.focus-name { font-size: 1.4rem; color: var(--pine-deep); margin: 6px 0 4px; line-height: 1.2; }
.focus-date { font-size: 0.9rem; color: var(--ink-soft); }
.dist-chip {
  display: inline-block; margin-top: 10px;
  font-size: 0.75rem; font-weight: 700; color: var(--paper);
  padding: 4px 12px; border-radius: 999px;
}
.tab-pine { background: var(--pine); }
.tab-granite { background: var(--granite); }
.tab-sunset { background: var(--clay); }
.tab-creek { background: var(--creek); }

.focus-note {
  margin-top: 12px; font-size: 0.92rem; line-height: 1.45;
  color: var(--ink);
  border-left: 3px solid var(--brass);
  padding-left: 10px;
}
.focus-note--none { color: var(--ink-soft); font-style: italic; }

.focus-edit {
  margin-top: 14px;
  background: none; border: none;
  color: var(--pine); font-weight: 700; font-size: 0.9rem;
  text-decoration: underline; text-underline-offset: 3px;
  padding: 10px 0; min-height: 44px;
  cursor: pointer;
}

.focus-empty { padding: 18px 4px; text-align: center; }
.focus-empty-title { font-weight: 700; color: var(--pine-deep); }
.focus-empty-copy { margin-top: 6px; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.45; }

.add-strip {
  width: 100%; margin-top: 16px;
  background: var(--clay); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 14px 18px; min-height: 62px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  box-shadow: 0 4px 10px rgba(201, 123, 74, 0.35);
  cursor: pointer;
}
.add-strip:active { transform: translateY(1px); }
.add-strip-label { font-size: 1.05rem; font-weight: 800; letter-spacing: 0.02em; }
.add-strip-sub { font-size: 0.75rem; opacity: 0.85; }

.trailhead-foot { margin-top: 16px; font-size: 0.78rem; color: var(--ink-soft); text-align: center; }

/* ---------- outings / find lists ---------- */

.outings-stack { display: flex; flex-direction: column; gap: 18px; }

.group-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--pine-deep); margin-bottom: 8px;
}
.group-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.group-count {
  background: var(--paper-deep); color: var(--ink-soft);
  font-size: 0.7rem; padding: 1px 8px; border-radius: 999px;
}

.group-rows { display: flex; flex-direction: column; gap: 8px; }

.outing-row {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background:
    radial-gradient(circle at 96% 10%, transparent 0 46px, rgba(47, 93, 80, 0.07) 46px 47px, transparent 47px),
    radial-gradient(circle at 96% 10%, transparent 0 66px, rgba(47, 93, 80, 0.06) 66px 67px, transparent 67px),
    var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 12px 12px 20px;
  min-height: 64px;
  cursor: pointer;
  overflow: hidden;
  font: inherit; color: inherit;
}
.outing-row:active { background-color: var(--paper-deep); }

.row-tab { position: absolute; left: 0; top: 0; bottom: 0; width: 7px; }
.tab-pine .row-tab, .row-tab { background: var(--pine); }
.outing-row.tab-granite .row-tab { background: var(--granite); }
.outing-row.tab-sunset .row-tab { background: var(--clay); }
.outing-row.tab-creek .row-tab { background: var(--creek); }
.outing-row.tab-pine .row-tab { background: var(--pine); }

.row-marker {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem;
  color: var(--paper); background: var(--pine-deep);
  box-shadow: inset 0 0 0 2px rgba(242, 193, 78, 0.6);
}

.row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-name { font-weight: 700; font-size: 0.98rem; color: var(--pine-deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-date { font-size: 0.8rem; color: var(--ink-soft); }

.row-dist {
  margin-left: auto; flex-shrink: 0;
  font-size: 0.72rem; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 9px;
}

.find-count { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 8px; }

.empty-state {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 26px 18px; text-align: left;
}
.empty-title { font-weight: 700; color: var(--pine-deep); }
.empty-copy { margin-top: 6px; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.5; }

/* ---------- log form ---------- */

.log-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: 0 4px 12px rgba(35, 69, 57, 0.1);
}

.field { margin-bottom: 14px; }

.field-label {
  display: block;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--pine-deep); margin-bottom: 6px;
}
.req { color: var(--clay); }
.opt { color: var(--ink-soft); font-weight: 400; text-transform: none; letter-spacing: 0; }

.field-input {
  width: 100%;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 13px 12px;
  min-height: 48px;
  -webkit-appearance: none; appearance: none;
}
.field-input:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(47, 93, 80, 0.15);
}
.field-input[aria-invalid="true"] { border-color: var(--clay); box-shadow: 0 0 0 3px rgba(201, 123, 74, 0.18); }

select.field-input {
  background-image: linear-gradient(45deg, transparent 50%, var(--pine) 50%),
                    linear-gradient(135deg, var(--pine) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.field-textarea { resize: vertical; min-height: 96px; }

.field-err { margin-top: 5px; font-size: 0.8rem; font-weight: 600; color: #a3431f; }

.search-field { background: none; border: none; padding: 0; }

.form-actions {
  display: flex; gap: 8px; margin-top: 18px;
}

.btn {
  flex: 1;
  min-height: 52px;
  border: none; border-radius: 10px;
  font: inherit; font-size: 0.95rem; font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--pine); color: var(--paper); box-shadow: 0 3px 8px rgba(35, 69, 57, 0.3); }
.btn-ghost { background: var(--paper-deep); color: var(--pine-deep); }
.btn-danger { background: #a3431f; color: #fff; flex: 1.2; }

.form-status { margin-top: 12px; font-size: 0.85rem; color: var(--pine); min-height: 1.2em; }

/* ---------- find / about ---------- */

.about-panel {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brass);
  border-radius: var(--radius);
  padding: 16px 15px;
}
.about-title { font-size: 1rem; color: var(--pine-deep); margin-bottom: 8px; }
.about-copy { font-size: 0.88rem; line-height: 1.55; color: var(--ink); margin-bottom: 8px; }
.about-fine { color: var(--ink-soft); font-size: 0.75rem; margin-bottom: 0; }

/* ---------- bottom tab bar (hiking boots) ---------- */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 480px; margin: 0 auto;
  display: flex;
  background: var(--pine-deep);
  border-top: 3px solid var(--brass);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
}

.tab {
  flex: 1;
  background: none; border: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px;
  min-height: 56px;
  cursor: pointer;
  color: rgba(244, 239, 227, 0.62);
}

.boot { width: 30px; height: 30px; transition: transform 0.18s ease; }
.boot-body { fill: currentColor; }
.boot-ring { fill: none; stroke: currentColor; stroke-width: 1.8; }

.tab-label {
  font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.tab.is-active { color: var(--brass); }
.tab.is-active .boot {
  transform: rotate(-9deg) translateY(-3px);
  filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, 0.45));
}

@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  .boot { transition: none; }
  .tab.is-active .boot { transform: rotate(-9deg); filter: none; }
}
