:root {
  color-scheme: dark;
  --bg: #08090a;
  --panel: #0f1011;
  --surface: rgba(255, 255, 255, .025);
  --surface-hover: rgba(255, 255, 255, .045);
  --border: rgba(255, 255, 255, .08);
  --border-soft: rgba(255, 255, 255, .05);
  --text: #f7f8f8;
  --text-2: #d0d6e0;
  --muted: #8a8f98;
  --subtle: #62666d;
  --accent: #7170ff;
  --accent-hover: #8d8cff;
  --physical: #ff6b8a;
  --emotional: #67d4ff;
  --intellectual: #a997ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv01", "ss03";
  line-height: 1.5;
  overflow-x: hidden;
}
button, input { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 14px;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  filter: blur(130px);
  opacity: .14;
  pointer-events: none;
}
.ambient-one { top: -330px; left: 15%; background: #5e6ad2; }
.ambient-two { right: -360px; top: 42%; background: #263b78; opacity: .1; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-weight: 590;
  letter-spacing: -.2px;
}
.brand-mark { display: flex; align-items: center; gap: 3px; height: 20px; }
.brand-mark i { display: block; width: 3px; border-radius: 2px; background: var(--text); transform: rotate(8deg); }
.brand-mark i:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark i:nth-child(2) { height: 19px; }
.brand-mark i:nth-child(3) { height: 13px; opacity: .75; }
.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font: 500 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.privacy-pill span { width: 6px; height: 6px; border-radius: 50%; background: #10b981; box-shadow: 0 0 8px #10b981; }

main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.hero { padding: 104px 0 72px; max-width: 850px; }
.eyebrow, .section-kicker {
  margin: 0 0 17px;
  color: var(--accent-hover);
  font: 500 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 510;
  line-height: .97;
  letter-spacing: -.065em;
}
h1 span { color: var(--muted); }
.hero-copy {
  max-width: 650px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, .62fr) minmax(0, 1.38fr);
  min-height: 650px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(15, 16, 17, .82);
  box-shadow: 0 32px 80px rgba(0, 0, 0, .35), inset 0 1px rgba(255, 255, 255, .025);
  backdrop-filter: blur(16px);
}
.control-panel {
  display: flex;
  flex-direction: column;
  padding: 38px 34px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, .018);
}
h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 510; letter-spacing: -.035em; }
.panel-copy { margin: 12px 0 34px; color: var(--muted); font-size: 14px; }
form { padding-bottom: 30px; border-bottom: 1px solid var(--border-soft); }
label { display: block; margin-bottom: 9px; color: var(--text-2); font-size: 13px; font-weight: 510; }
.input-row { display: grid; gap: 10px; }
input[type="date"] {
  width: 100%;
  height: 49px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: 0;
  background: rgba(255, 255, 255, .025);
  color: var(--text);
  color-scheme: dark;
}
input[type="date"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(113, 112, 255, .16); }
input[aria-invalid="true"] { border-color: var(--physical); }
button[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 49px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 7px;
  background: #5e6ad2;
  color: white;
  font-size: 14px;
  font-weight: 590;
  transition: background .2s, transform .2s;
}
button[type="submit"]:hover { background: var(--accent-hover); transform: translateY(-1px); }
button[type="submit"]:focus-visible { outline: 3px solid rgba(169, 151, 255, .45); outline-offset: 2px; }
.field-hint, .form-error { margin: 9px 0 0; font-size: 11px; color: var(--subtle); }
.form-error { color: #ff94aa; }
.cycle-guide { display: grid; gap: 18px; margin-top: auto; padding-top: 34px; }
.cycle-guide > div { display: grid; grid-template-columns: 9px 1fr; column-gap: 10px; align-items: center; }
.cycle-guide strong { font-size: 13px; font-weight: 510; color: var(--text-2); }
.cycle-guide small { grid-column: 2; color: var(--subtle); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.physical { background: var(--physical); box-shadow: 0 0 9px var(--physical); }
.dot.emotional { background: var(--emotional); box-shadow: 0 0 9px var(--emotional); }
.dot.intellectual { background: var(--intellectual); box-shadow: 0 0 9px var(--intellectual); }

.chart-panel { min-width: 0; padding: 38px 32px 30px; }
.chart-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.date-range { margin-top: 5px; color: var(--subtle); font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: right; }
.chart-shell { position: relative; width: 100%; margin-top: 16px; min-height: 340px; }
canvas { display: block; width: 100%; touch-action: pan-y; }
.empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state strong { color: var(--text-2); font-size: 14px; font-weight: 510; }
.empty-state span { font-size: 12px; color: var(--subtle); }
.empty-orbit { position: relative; width: 70px; height: 70px; margin-bottom: 13px; border: 1px solid var(--border); border-radius: 50%; }
.empty-orbit::before, .empty-orbit::after { content: ""; position: absolute; inset: 12px; border: 1px solid var(--border-soft); border-radius: 50%; }
.empty-orbit::after { inset: 26px; background: var(--accent); border: 0; box-shadow: 0 0 18px var(--accent); }
.empty-orbit i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.empty-orbit i:nth-child(1) { left: 2px; top: 30px; }
.empty-orbit i:nth-child(2) { right: 11px; top: 9px; }
.empty-orbit i:nth-child(3) { right: 13px; bottom: 7px; }
.chart-tooltip { position: absolute; z-index: 3; width: 190px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: rgba(25, 26, 27, .96); box-shadow: 0 10px 30px rgba(0, 0, 0, .38); pointer-events: none; }
.chart-tooltip b { display: block; margin-bottom: 8px; color: var(--text-2); font-size: 12px; font-weight: 590; }
.chart-tooltip span { display: grid; grid-template-columns: 7px 1fr auto; gap: 7px; align-items: center; margin-top: 5px; color: var(--muted); font-size: 11px; }
.chart-tooltip i { width: 6px; height: 6px; border-radius: 50%; background: var(--dot); }
.chart-tooltip strong { color: var(--text-2); font: 500 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.today-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.today-values[hidden] { display: none; }
.value-card { position: relative; overflow: hidden; padding: 13px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); }
.value-card::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px; opacity: .8; }
.physical-card::before { background: var(--physical); }
.emotional-card::before { background: var(--emotional); }
.intellectual-card::before { background: var(--intellectual); }
.value-card span, .value-card small { display: block; color: var(--subtle); font-size: 10px; }
.value-card strong { display: block; margin: 4px 0 1px; color: var(--text); font: 500 clamp(1.1rem, 2.5vw, 1.5rem) ui-monospace, SFMono-Regular, Consolas, monospace; }

.method { display: grid; grid-template-columns: 1fr 1.25fr; gap: 80px; padding: 110px 0 90px; border-bottom: 1px solid var(--border-soft); }
.method-copy { color: var(--muted); font-size: 15px; line-height: 1.75; }
.method-copy p { margin-top: 0; }
code { padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text-2); font-size: .88em; }
.disclaimer { margin-top: 24px !important; padding-left: 18px; border-left: 2px solid var(--accent); }
.disclaimer strong { color: var(--text-2); }

.data-panel { margin: 48px 0 90px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.data-panel[hidden] { display: none; }
.data-panel summary { padding: 17px 20px; color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 510; }
.table-scroll { overflow-x: auto; border-top: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 620px; font-size: 12px; }
caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
th, td { padding: 11px 18px; border-bottom: 1px solid var(--border-soft); text-align: right; }
th:first-child { text-align: left; }
thead { color: var(--subtle); font: 500 10px ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
tbody th { color: var(--muted); font-weight: 400; }
tbody td { color: var(--text-2); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.today-row { background: rgba(113, 112, 255, .08); }
.today-row th { color: var(--accent-hover); }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px 0 36px; color: var(--subtle); font-size: 11px; }
footer span:first-child { color: var(--muted); font-weight: 590; }

@media (max-width: 850px) {
  .hero { padding-top: 78px; }
  .workspace { grid-template-columns: 1fr; }
  .control-panel { border-right: 0; border-bottom: 1px solid var(--border); }
  .cycle-guide { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
  .method { gap: 40px; }
}
@media (max-width: 600px) {
  .site-header, main, footer { width: min(100% - 28px, 1180px); }
  .site-header { height: 62px; }
  .privacy-pill { font-size: 10px; }
  .hero { padding: 64px 0 48px; }
  h1 { font-size: clamp(2.9rem, 15vw, 4.4rem); }
  .workspace { border-radius: 12px; }
  .control-panel, .chart-panel { padding: 28px 18px; }
  .cycle-guide { grid-template-columns: 1fr; gap: 11px; }
  .chart-header { display: block; }
  .date-range { margin-top: 8px; text-align: left; }
  .today-values { grid-template-columns: 1fr; }
  .method { grid-template-columns: 1fr; padding: 74px 0 60px; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
