@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Manrope:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink: #0B0908;
  --panel: #17130F;
  --panel-raised: #1E1911;
  --line: #2C2519;
  --ivory: #EFE6D8;
  --ivory-dim: #B8AD9B;
  --taupe: #8C8171;

  --gold: #C7A253;
  --gold-dim: #8A7038;
  --bronze: #A8703F;
  --bronze-dim: #6F4B2A;

  --radius: 3px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Manrope', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0 0 0.4em; letter-spacing: 0.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; }

p { line-height: 1.55; color: var(--ivory-dim); margin: 0 0 1em; }

.mono { font-family: var(--mono); letter-spacing: 0.02em; }

/* ---------- layout shell ---------- */

.shell {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px 96px;
  flex: 1;
}

header.topbar {
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.brand {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.brand span { color: var(--gold); }

.streak-pill {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ivory-dim);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 12px;
}
.streak-pill strong { color: var(--gold); }

nav.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 10;
}
nav.tabbar a {
  flex: 1;
  text-align: center;
  padding: 12px 4px 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--taupe);
  border-top: 2px solid transparent;
}
nav.tabbar a.active {
  color: var(--ivory);
  border-top-color: var(--gold);
}

.flash {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--bronze);
  padding: 10px 14px;
  margin: 16px 0;
  font-size: 0.85rem;
  border-radius: var(--radius);
  color: var(--ivory-dim);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
}
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-bronze { background: var(--bronze); color: var(--ink); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ivory); }
.btn-block { display: block; width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* ---------- cards / panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.module-panel { border-left: 3px solid var(--line); }
.module-panel.length { border-left-color: var(--gold-dim); }
.module-panel.thinning { border-left-color: var(--bronze-dim); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--taupe);
  margin-bottom: 6px;
  display: block;
}
.eyebrow.length { color: var(--gold); }
.eyebrow.thinning { color: var(--bronze); }

.stat-row { display: flex; gap: 14px; }
.stat {
  flex: 1;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.stat .num { font-family: var(--serif); font-size: 1.6rem; color: var(--ivory); }
.stat .lbl { font-family: var(--mono); font-size: 0.65rem; color: var(--taupe); text-transform: uppercase; }

/* ---------- growth thread signature ---------- */

.thread-wrap { margin: 18px 0 26px; }
.thread-wrap svg { width: 100%; height: auto; display: block; }
.thread-caption {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--taupe);
  text-align: center;
  margin-top: 6px;
}

/* ---------- forms ---------- */

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--taupe);
  margin-bottom: 6px;
}
.field input[type="text"],
.field textarea,
.field select {
  width: 100%;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--ivory);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 0.9rem;
}
.field textarea { min-height: 80px; resize: vertical; }

.file-drop {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--taupe);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.file-drop input { margin-top: 10px; width: 100%; color: var(--taupe); }

.rating-choices { display: flex; gap: 8px; }
.rating-choices label {
  flex: 1;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  cursor: pointer;
}
.rating-choices input { display: none; }
.rating-choices input:checked + span { color: var(--gold); }

.module-toggle { display: flex; gap: 10px; margin-bottom: 18px; }
.module-toggle a {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--taupe);
}
.module-toggle a.active.length { border-color: var(--gold); color: var(--gold); }
.module-toggle a.active.thinning { border-color: var(--bronze); color: var(--bronze); }

/* ---------- gallery / grid ---------- */

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.entry-grid .thumb {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  position: relative;
}
.entry-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.entry-grid .thumb .date-tag {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  font-family: var(--mono);
  font-size: 0.6rem;
  padding: 12px 6px 4px;
  text-align: center;
}

.entry-photo {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
  margin-bottom: 16px;
}

/* ---------- landing ---------- */

.landing-hero {
  padding: 64px 0 24px;
  text-align: center;
}
.landing-hero .kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  display: block;
}
.landing-hero h1 { font-size: 2.3rem; margin-bottom: 14px; }

.focus-options { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.focus-card {
  display: block;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
}
.focus-card:hover { border-color: var(--gold-dim); }
.focus-card .fc-title { font-family: var(--serif); font-size: 1.1rem; margin-bottom: 4px; }
.focus-card .fc-desc { font-size: 0.85rem; color: var(--taupe); margin: 0; }

/* ---------- premium ---------- */

.premium-panel {
  background: linear-gradient(160deg, var(--panel-raised), var(--panel));
  border: 1px solid var(--gold-dim);
}
.premium-panel .eyebrow { color: var(--gold); }

.pathway-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  margin-bottom: 10px;
}

.disclaimer {
  font-size: 0.72rem;
  color: var(--taupe);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 8px;
}

/* ---------- routine week strip ---------- */

.week-strip { display: flex; gap: 6px; }
.week-day {
  flex: 1;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--taupe);
}
.week-day.done { background: var(--gold); color: var(--ink); border-color: var(--gold); font-weight: 600; }
.week-day.today { border-color: var(--gold); }

/* ---------- comparison slider ---------- */

.compare {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.compare img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.compare .after-wrap {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  clip-path: inset(0 50% 0 0);
}
.compare .after-wrap img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .divider {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--gold);
  pointer-events: none;
}
.compare input[type="range"] {
  position: absolute;
  bottom: 10px; left: 10px; right: 10px;
  width: calc(100% - 20px);
}
.compare-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.68rem; color: var(--taupe); margin-bottom: 18px; }

/* ---------- empty state ---------- */

.empty-state { text-align: center; padding: 40px 10px; color: var(--taupe); }
.empty-state h3 { color: var(--ivory-dim); }

@media (min-width: 600px) {
  .shell { padding-left: 32px; padding-right: 32px; }
}
