/* Attuned site styles v0.1
   Layout: one quiet column, left-aligned, generator first. The month strip is the one bold element.
   Brand per the Beehiiv spec: charcoal ink, warm paper, DM Serif Display + DM Sans, four phase colors. */

@font-face { font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/dm-serif-display-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/dm-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/dm-sans-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #FBF8F4;
  --surface: #FFFFFF;
  --ink: #2C2420;
  --muted: #7E6F68;
  --line: #E6DDD4;
  --soft: #F2ECE5;
  --accent: #B4523C; /* terracotta, darkened from the email's #C4614A so white button text passes WCAG AA (4.98:1) */
  --accent-ink: #FFFFFF;
  --focus: #2C2420;
  --menstrual: #C4758A;
  --follicular: #7BAE7F;
  --ovulatory: #E4A840;
  --luteal: #9B8DC0;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B1614; --surface: #241E1B; --ink: #F3ECE5; --muted: #B5A69D; --line: #3B312C; --soft: #2E2622;
    --accent: #D47A63; --accent-ink: #1B1614; --focus: #F3ECE5;
    --menstrual: #D48AA0; --follicular: #8FC094; --ovulatory: #ECB85C; --luteal: #AFA2D0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1B1614; --surface: #241E1B; --ink: #F3ECE5; --muted: #B5A69D; --line: #3B312C; --soft: #2E2622;
  --accent: #D47A63; --accent-ink: #1B1614; --focus: #F3ECE5;
  --menstrual: #D48AA0; --follicular: #8FC094; --ovulatory: #ECB85C; --luteal: #AFA2D0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 48px;
}
.wrap { max-width: 640px; margin: 0 auto; }
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; margin-top: 2.2rem; }
h3 { font-size: 1.2rem; margin-top: 1.4rem; }
p { margin: 0.7em 0; max-width: 62ch; }
small, .muted { color: var(--muted); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--soft); padding: 1px 5px; border-radius: 4px; }

/* header */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0 8px; }
.wordmark { font-family: var(--serif); font-size: 1.35rem; text-decoration: none; letter-spacing: 0.01em; white-space: nowrap; }
.wordmark .dot { display: inline-block; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--menstrual); margin-left: 0.15em; vertical-align: 0.05em; }
nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.95rem; }
nav a { text-decoration: none; color: var(--muted); padding: 4px 0; }
nav a[aria-current="page"], nav a:hover { color: var(--ink); }
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 18px; font-size: 0.92rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot a { color: var(--muted); }

/* intro */
.intro { padding: 28px 0 8px; }
.intro p { font-size: 1.08rem; }
.promise { display: inline-flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--muted); margin-top: 6px; }
.promise::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--follicular); flex: none; }

/* form */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; margin-top: 18px; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
legend { font-weight: 500; padding: 0; margin-bottom: 8px; font-size: 1rem; }
.hint { font-size: 0.9rem; color: var(--muted); margin: 6px 0 0; }
.row { display: flex; flex-wrap: wrap; gap: 14px; }
.row > * { min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 140px; }
.field label { font-size: 0.95rem; }
select, input[type="date"], input[type="number"], input[type="text"], input[type="url"] {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; min-height: 44px;
}
input[type="number"] { font-variant-numeric: tabular-nums; }
select { -webkit-appearance: none; appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237E6F68' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field.wide { flex-basis: 100%; }
.field > .seg { margin-top: 0; }

.seg { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; text-align: center; padding: 10px 8px; cursor: pointer; font-weight: 500; min-height: 44px; }
.seg input:checked + span { background: var(--ink); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -3px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cards label { position: relative; display: block; }
.cards input { position: absolute; opacity: 0; inset: 0; }
.cards .card { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; height: 100%; background: var(--bg); }
.cards .card b { display: block; font-weight: 500; }
.cards .card small { display: block; line-height: 1.35; margin-top: 2px; }
.cards input:checked + .card { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cards input:focus-visible + .card { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 520px) { .cards { grid-template-columns: 1fr; } }

.checks { display: flex; flex-direction: column; gap: 10px; }
.checks label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checks input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.checks small { display: block; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.btn { font: inherit; font-weight: 500; border-radius: 8px; padding: 12px 20px; min-height: 46px; cursor: pointer; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { padding: 8px 14px; min-height: 38px; font-size: 0.95rem; font-weight: 500; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.errors { color: #9B2D2D; margin: 8px 0 0; font-size: 0.95rem; }
:root[data-theme="dark"] .errors { color: #F0A5A5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .errors { color: #F0A5A5; } }
.status { font-size: 0.95rem; margin: 10px 0 0; }

/* month strip */
.strip-wrap { margin-top: 10px; }
.strip { width: 100%; height: 22px; display: block; border-radius: 6px; overflow: hidden; }
.strip-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.88rem; color: var(--muted); margin-top: 8px; }
.strip-key span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

/* event list */
.events { list-style: none; padding: 0; margin: 14px 0 0; border-top: 1px solid var(--line); }
.events li { border-bottom: 1px solid var(--line); }
.events summary { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: baseline; padding: 12px 4px; cursor: pointer; list-style: none; }
.events summary::-webkit-details-marker { display: none; }
.events .d { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.92rem; white-space: nowrap; }
.events .t { font-weight: 500; }
.events .ph { font-size: 0.8rem; color: var(--muted); white-space: nowrap; border-left: 3px solid var(--c, var(--line)); padding-left: 8px; }
.events pre { white-space: pre-wrap; word-wrap: break-word; font: inherit; font-size: 0.95rem; margin: 0 4px 16px 108px; color: var(--ink); max-width: 60ch; }
@media (max-width: 520px) { .events summary { grid-template-columns: 88px 1fr; } .events .ph { grid-column: 2; border-left: 0; padding-left: 0; } .events pre { margin-left: 4px; } }

/* share box */
.share { margin-top: 18px; }
.share .linkrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.share input { flex: 1 1 240px; font-size: 0.9rem; }

/* content pages */
.prose h2:first-child { margin-top: 0.5rem; }
.prose ul, .prose ol { padding-left: 1.2em; max-width: 62ch; }
.prose li { margin: 0.35em 0; }
.steps { counter-reset: s; list-style: none; padding: 0; max-width: 62ch; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 12px; margin: 14px 0; }
.steps li::before { content: counter(s); font-family: var(--serif); font-size: 1.4rem; line-height: 1; color: var(--muted); }
.phases { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin: 16px 0; }
.phases div { border-left: 4px solid var(--c); padding: 2px 0 2px 12px; }
.phases b { display: block; }
.phases small { display: block; color: var(--muted); }
@media (max-width: 520px) { .phases { grid-template-columns: 1fr; } }
details.faq { border-top: 1px solid var(--line); padding: 10px 0; max-width: 62ch; }
details.faq:last-of-type { border-bottom: 1px solid var(--line); }
details.faq summary { cursor: pointer; font-weight: 500; }
.notice { background: var(--soft); border-radius: 8px; padding: 12px 14px; font-size: 0.95rem; margin: 14px 0 0; }
.ring { float: right; width: 112px; height: 112px; margin: 0 0 8px 16px; }
@media (max-width: 520px) { .ring { float: none; margin: 8px 0; } }

@media (prefers-reduced-motion: no-preference) {
  .cards .card, .seg span, .btn { transition: background-color 120ms, border-color 120ms, box-shadow 120ms; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 520px) { .site-head { flex-direction: column; align-items: flex-start; gap: 6px; } }

/* inline calendar */
.cal { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 8px; max-width: 360px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cal-title { font-weight: 500; }
.cal-nav { font: inherit; font-size: 1.4rem; line-height: 1; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.cal-nav[disabled] { opacity: 0.3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: 0.75rem; color: var(--muted); padding: 4px 0; }
.cal-pad { min-height: 1px; }
.cal-day { font: inherit; font-variant-numeric: tabular-nums; min-height: 42px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer; padding: 0; }
.cal-day:hover:not([disabled]) { background: var(--soft); }
.cal-day[disabled] { color: var(--muted); opacity: 0.4; cursor: default; }
.cal-day.is-today { border-color: var(--line); }
.cal-day.is-selected, .cal-day.is-selected:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 500; }

/* ---- v0.2 additions ---- */
.field-label { font-size: 0.95rem; }
.lengths { margin-top: 16px; align-items: flex-end; }
.stepper { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); overflow: hidden; }
.stepper .step { font: inherit; font-size: 1.3rem; line-height: 1; width: 46px; min-height: 46px; border: 0; background: var(--surface); color: var(--ink); cursor: pointer; flex: none; }
.stepper .step:active { background: var(--soft); }
.stepper input[type="number"] { border: 0; border-radius: 0; text-align: center; padding: 10px 4px; flex: 1 1 auto; width: 3em; min-width: 2.5em; background: transparent; font-weight: 500; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .unit { align-self: center; padding: 0 8px 0 2px; color: var(--muted); font-size: 0.95rem; flex: 1 1 auto; min-width: 0; }
.stepper:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.daystatus { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-size: 0.98rem; }
.daystatus .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.daystatus.is-warn { color: var(--ink); background: var(--soft); border-radius: 8px; padding: 10px 12px; display: block; }
.strip-wrap { position: relative; margin-top: 12px; }
.strip-labels { position: relative; height: 18px; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.strip-labels span { position: absolute; top: 0; white-space: nowrap; }
.strip-labels .l-mid { transform: translateX(-50%); }
.strip-dots { position: relative; height: 14px; }
.strip-dot { position: absolute; top: 5px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--ink); }
.strip-key .key-dot::before { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); vertical-align: 1px; }
.howto { margin: 8px 0 10px; padding-left: 1.1em; }
.howto li { margin: 4px 0; }

@media (max-width: 520px) {
  h1 { font-size: 1.75rem; }
  .intro { padding: 16px 0 4px; }
  .intro p { font-size: 1rem; margin: 0.5em 0; }
  .panel { padding: 18px 16px; margin-top: 12px; }
  nav { font-size: 0.9rem; gap: 2px 12px; }
}

.panel > .notice { margin: 0 0 20px; }

/* started / ended choice above the date picker */
.anchor-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 10px; font-size: 0.95rem; }
.seg-sm { display: inline-flex; }
.seg-sm span { min-height: 36px; padding: 7px 16px; font-size: 0.95rem; }
.daystatus.has-derived { display: block; }
.daystatus .derived { display: block; color: var(--muted); font-size: 0.92rem; margin-bottom: 4px; }
.daystatus .today { display: flex; align-items: center; gap: 10px; }

.howto-more summary { cursor: pointer; font-size: 0.95rem; }
#platformTip { margin-top: 12px; }
