:root {
  --ink: #1a1e16;
  --muted: #4a5144;
  --paper: #f4efe4;
  --paper-2: #ebe3d2;
  --line: #ddd2bb;
  --ochre: #e2a23a;
  --ochre-deep: #8a5a12;
  --green: #2f6b45;
  --green-soft: #d7eadb;
  --site: #c45c32;
  --site-soft: #f6d7cb;
  --app-bg: #141910;
  --app-card: #222a1c;
  --app-line: #343d2c;
  --app-text: #f4efe4;
  --app-muted: #b7b3a4;
  --home: #8fce7a;
  --shadow: 0 18px 40px rgba(26, 30, 22, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}
img { max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible {
  outline: 3px solid var(--ochre-deep);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: 0.01em; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: transparent;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: var(--ochre); border-color: var(--ochre); }
.btn-primary:hover { background: #efb14d; }
.btn-ghost:hover { background: rgba(26, 30, 22, 0.05); }

.hero {
  display: grid;
  gap: 28px;
  padding: 12px 0 36px;
}
.kicker {
  margin: 0 0 8px;
  color: var(--ochre-deep);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, h3 { font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif; font-weight: 700; line-height: 1.08; }
h1 { margin: 0 0 14px; font-size: clamp(2.4rem, 7vw, 4.6rem); letter-spacing: -0.03em; }
.lead { margin: 0 0 22px; font-size: 1.12rem; max-width: 38rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fine { margin: 14px 0 0; color: var(--muted); font-size: 0.92rem; }

.phone {
  background: var(--app-bg);
  color: var(--app-text);
  border-radius: 28px;
  padding: 18px;
  box-shadow: var(--shadow);
  max-width: 360px;
}
.phone-bar, .row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.phone-kicker { margin: 18px 0 0; color: var(--home); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; }
.phone-count { margin: 6px 0; font-size: 1.35rem; }
.phone-count strong { font-family: Palatino, Georgia, serif; font-size: 3rem; display: block; line-height: 0.95; }
.phone-date { margin: 0; color: var(--app-muted); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 16px 0; }
.week i, .dot { display: block; height: 14px; border-radius: 999px; background: #3a3328; }
.week i.site, .dot.site { background: #e07a45; }
.week i.home, .dot.home { background: var(--home); }
.phone-note { margin: 0; padding: 12px; border-radius: 14px; background: var(--app-card); color: var(--app-muted); }

.band { padding: 10px 0 42px; }
.band h2 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.intro { margin: 0 0 18px; color: var(--muted); max-width: 40rem; }
.cards { display: grid; gap: 12px; }
.card {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 14px;
}
.card h3 { margin: 0 0 6px; font-size: 1.45rem; }
.card p { margin: 0; color: var(--muted); }
.card a { color: var(--green); font-weight: 700; }

.patterns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill {
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}
.pill span { display: block; font-weight: 500; color: var(--muted); font-size: 0.82rem; }

.privacy {
  background: var(--ink);
  color: var(--paper);
  border-radius: 22px;
  padding: 22px;
}
.privacy p { margin: 8px 0 0; color: #d9d3c4; }
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  padding: 8px 0 28px;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer nav { display: flex; gap: 14px; }

@media (min-width: 880px) {
  .hero { grid-template-columns: 1.2fr 0.8fr; align-items: center; padding-top: 28px; }
  .phone { justify-self: end; }
  .plan-lead { grid-template-columns: 1.05fr 0.95fr; }
  .plan-shot { justify-self: end; }
  .cards { grid-template-columns: 1fr 1fr; }
}

body.app, body.family { background: var(--app-bg); color: var(--app-text); color-scheme: dark; }
.app-frame, .family-frame {
  width: min(480px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px 16px calc(96px + env(safe-area-inset-bottom));
}
.setup { padding-top: 8px; }
.setup .brand img, .top .brand img { width: 42px; height: 42px; }
.setup h1 { font-size: 2.5rem; margin-top: 18px; }
.setup .lead, .help, .notice { color: var(--app-muted); }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.preset, .choice, .tab {
  border: 1px solid var(--app-line);
  background: var(--app-card);
  color: var(--app-text);
  border-radius: 16px;
  min-height: 44px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}
.preset small, .choice small { display: block; color: var(--app-muted); font-weight: 500; }
.preset.is-on, .choice.is-on, .tab[aria-selected="true"] {
  border-color: var(--ochre);
  box-shadow: inset 0 0 0 1px var(--ochre);
}
.preset strong, .choice strong { font-size: 1.15rem; }
.fields { display: grid; gap: 10px; }
label { display: grid; gap: 6px; font-weight: 700; font-size: 0.92rem; }
input[type="date"], input[type="number"], input[type="text"], textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--app-line);
  background: #12170f;
  color: var(--app-text);
  padding: 12px;
  min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; }
.stack { display: grid; gap: 10px; margin-top: 14px; }
.btn-block { width: 100%; }
.error { color: #ffb4a2; font-weight: 700; min-height: 1.2em; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.eyebrow { margin: 0; color: var(--ochre); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.75rem; }
.status-card, .panel {
  background: var(--app-card);
  border: 1px solid var(--app-line);
  border-radius: 20px;
  padding: 16px;
  margin-top: 14px;
}
.count { margin: 4px 0; font-family: Palatino, Georgia, serif; font-size: 4.4rem; line-height: 0.9; }
.bar { height: 10px; border-radius: 999px; background: #12170f; overflow: hidden; margin: 12px 0; }
.bar span { display: block; height: 100%; background: var(--home); }
.bar.site span { background: #e07a45; }
.muted { color: var(--app-muted); }
.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(20, 25, 16, 0.96);
  border-top: 1px solid var(--app-line);
}
.tab { text-align: center; border-radius: 12px; padding: 8px 4px; font-weight: 700; }

.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--app-line);
  background: #12170f;
  color: var(--app-text);
  cursor: pointer;
  font-size: 1.2rem;
}
.dow, .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow { margin-top: 8px; color: var(--app-muted); font-size: 0.75rem; text-align: center; }
.grid { margin-top: 4px; }
.cell {
  aspect-ratio: 1;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  background: transparent;
  position: relative;
}
.cell.site { background: #a24e2c; color: #fff8f2; }
.cell.home { background: #2f6b45; color: #f3fff4; }
.cell.today { outline: 2px solid var(--ochre); outline-offset: -2px; }
.cell.holiday::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ochre);
  position: absolute;
  bottom: 4px;
}
.legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--app-muted); font-size: 0.85rem; margin-top: 10px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.legend .site { background: #e07a45; }
.legend .home { background: var(--home); }
.golf-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--app-line); }
.golf-row p { margin: 4px 0 0; }
.tag { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.tag.good { color: var(--home); }
.tag.maybe { color: var(--ochre); }
.tag.leave { color: #e07a45; }
.list { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.list a { color: var(--ochre); font-weight: 700; white-space: nowrap; }
.plan-shot { width: min(390px, 100%); border-radius: 28px; display: block; box-shadow: var(--shadow); }
.plan-lead { display: grid; gap: 22px; align-items: center; }
.plan-points { margin: 0 0 16px; padding-left: 1.1rem; color: var(--muted); }
.plan-points li + li { margin-top: 6px; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--app-line); }

.checks { display: grid; gap: 8px; }
.check {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #12170f;
}
.energies { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.linkish { color: var(--ochre); font-weight: 700; }

.family-frame { padding-bottom: 28px; }
.answer { font-family: Palatino, Georgia, serif; font-size: clamp(2.6rem, 12vw, 4.2rem); line-height: 0.95; margin: 8px 0; }
.strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.strip span {
  flex: 0 0 auto;
  min-width: 46px;
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
  font-size: 0.75rem;
  background: var(--app-card);
}
.strip span.site { background: #a24e2c; }
.strip span.home { background: #2f6b45; }
.strip strong { display: block; font-size: 0.95rem; }
.family-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
body.family .btn, body.app .btn { color: var(--ink); }
body.family .btn-ghost, body.app .btn-ghost { color: var(--app-text); border-color: var(--app-line); }

@media (max-width: 720px) {
  .site-header { align-items: flex-start; }
  .nav { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
  .presets, .energies { grid-template-columns: 1fr 1fr; }
  .energies { grid-template-columns: repeat(5, 1fr); }
  h1 { font-size: 2.15rem; }
}
