/* Organic — design-system tokens and component classes. This file is the source of truth for the system's look; retune it here and see readme.md. */
@import url('https://fonts.googleapis.com/css2?family=Caprasimo:wght@400&family=Figtree:wght@400;600;700&display=swap');

:root {
  --color-bg: #f5ead8;
  --color-surface: #ebddc5;
  --color-text: #201e1d;
  --color-accent: #7a8a5e;   /* sage — the primary voice: free time, yes, actions */
  --color-accent-2: #c67139; /* terracotta — the second voice: conflicts, no, warnings */
  --color-divider: color-mix(in srgb, #201e1d 16%, transparent);

  /* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f9f4ed;
  --color-neutral-200: #eee7db;
  --color-neutral-300: #dcd3c4;
  --color-neutral-400: #c0b6a5;
  --color-neutral-500: #a19786;
  --color-neutral-600: #82796a;
  --color-neutral-700: #645c50;
  --color-neutral-800: #474238;
  --color-neutral-900: #2e2b25;

  --color-accent-100: #f0fae1;
  --color-accent-200: #e1eecc;
  --color-accent-300: #ccdbb2;
  --color-accent-400: #aebf92;
  --color-accent-500: #8fa073;
  --color-accent-600: #728157;
  --color-accent-700: #56633f;
  --color-accent-800: #3d472b;
  --color-accent-900: #272e1b;

  --color-accent-2-100: #fff2eb;
  --color-accent-2-200: #ffe1d0;
  --color-accent-2-300: #ffc6a5;
  --color-accent-2-400: #f6a06b;
  --color-accent-2-500: #d67f48;
  --color-accent-2-600: #b2622d;
  --color-accent-2-700: #8c491a;
  --color-accent-2-800: #643312;
  --color-accent-2-900: #402310;

  /* Brand palette — the five marks of the logo ring. Two of them are the
     system accents (sage, terracotta); the three cool hues are the circle
     colors: they identify people, never states. Each has a light tint for
     fills and a deep step for text on that tint. */
  --brand-terracotta: #c67139;
  --brand-terracotta-tint: #ffe1d0;
  --brand-terracotta-deep: #8c491a;
  --brand-sage: #7a8a5e;
  --brand-sage-tint: #e1eecc;
  --brand-sage-deep: #56633f;
  --brand-violet: #a246f1;
  --brand-violet-tint: #eddefc;
  --brand-violet-deep: #5b2091;
  --brand-indigo: #615ae9;
  --brand-indigo-tint: #e0defb;
  --brand-indigo-deep: #302a8f;
  --brand-ochre: #c2932f;
  --brand-ochre-tint: #f4e8c6;
  --brand-ochre-deep: #7a5c14;

  /* Answer status — three distinct hues on one perceptual step: sage yes,
     ochre maybe, terracotta no. Tints are for chips and pie backgrounds. */
  --color-yes: #728157;
  --color-yes-tint: #e1eecc;
  --color-maybe: #c2932f;
  --color-maybe-tint: #f4e8c6;
  --color-no: #b2622d;
  --color-no-tint: #ffe1d0;

  --font-heading: "Caprasimo", system-ui, sans-serif;
  --font-heading-weight: 400;
  --font-body: "Figtree", system-ui, sans-serif;

  --space-1: 4.4px;
  --space-2: 8.8px;
  --space-3: 13.2px;
  --space-4: 17.6px;
  --space-6: 26.4px;
  --space-8: 35.2px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;

  /* Elevation — derived from the ground: soft ink-tinted shadows on a
     light theme, a hairline edge + ambient darkness on a dark one. */
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2e2b25 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2e2b25 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2e2b25 22%, transparent);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

.washed{filter:saturate(0.6) contrast(0.85) brightness(1.1) opacity(0.94)}

/* ══════════════════════════════════════════════════════════════════════════
   Components — built with the tokens above. Plain CSS
   on plain HTML: no JavaScript, no build step. Each class is documented in
   readme.md and demonstrated in foundations/ and components/.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; }
h6 { letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px; margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — rules — */
.hr {
  height: 1px; border: 0; margin: var(--space-4) 0;
  background: var(--color-divider);
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text); /* matches the .input's 14px —
     the pair sits side by side in sign-up rows */
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* the primary fill takes the deep sage step: at 14px the label is body-size
   text, and accent-700 on cream clears 7:1 where the base accent measures 3.0:1 */
.btn-primary { background: var(--color-accent-700); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-800); }
.btn-primary:active { background: var(--color-accent-900); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* — forms — */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: none;
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
.nav a:not(.btn) { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:not(.btn):hover, .nav a:not(.btn)[aria-current='page'] { color: var(--color-accent-700); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 1px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body { font-size: 14px; opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* ══════════════════════════════════════════════════════════════════════════
   Scheduling layer — the calendar-specific pieces. Sage is the primary voice —
   free time, yes, the sealed round and every action; terracotta is the second
   voice — conflicts and no. Ochre sits between them as maybe. Nothing here shows one named person's calendar:
   other people's free time is only ever anonymous weight.
   ══════════════════════════════════════════════════════════════════════ */

/* — availability: anonymous density, drawn as dots. Each night sets its own
     --r (dot radius in px, ~3–26) and --w (0–1 share of the group free). — */
.density { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-3); align-items: end; }
.density.density-wrap { grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); }
.night { display: grid; justify-items: center; gap: var(--space-2); }
.night .bloom {
  display: block; width: calc(var(--r, 8px) * 2); height: calc(var(--r, 8px) * 2);
  border-radius: 50%; background: var(--color-yes);
  opacity: calc(0.18 + var(--w, 0.4) * 0.72);
}
.night .label { font-size: 10px; letter-spacing: 0.04em; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.night-pick .bloom { background: var(--color-accent); opacity: 1; }
.night-pick .label { color: var(--color-accent-700); }
.night .counts {
  font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}

/* — pie: one night, every answer, same size whatever the group. Set --n
     (group size), --y (yes) and --m (maybe); the rest reads as no. — */
.pie {
  --a1: calc(var(--y, 0) / var(--n, 1) * 360deg);
  --a2: calc((var(--y, 0) + var(--m, 0)) / var(--n, 1) * 360deg);
  display: block; width: var(--size, 46px); height: var(--size, 46px); border-radius: 50%;
  background: conic-gradient(var(--color-yes) 0 var(--a1), var(--color-maybe) var(--a1) var(--a2), var(--color-no) var(--a2) 360deg);
}
.pie-hole { position: relative; }
.pie-hole::after {
  content: ''; position: absolute; inset: 30%; border-radius: 50%; background: var(--color-surface);
}
.night-pick .pie { box-shadow: 0 0 0 3px var(--color-bg), 0 0 0 5px var(--color-yes); }
.pie-pending { background: var(--color-neutral-200); }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: 11.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; color: color-mix(in srgb, var(--color-text) 62%, transparent); }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.legend .k-yes { background: var(--color-yes); }
.legend .k-maybe { background: var(--color-maybe); }
.legend .k-no { background: var(--color-no); }

/* — answered count: always say it out of how many — */
.answered { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; }
.answered b {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; font-variant-numeric: tabular-nums;
}
.night-none .bloom { background: var(--color-neutral-300); opacity: 1; }

/* — slot: one proposed moment — */
.slot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 11px 18px; border-radius: 999px; background: var(--color-bg);
  border: 1px solid var(--color-divider);
}
.slot-when { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 15px; }
.slot-who { font-size: 12px; color: color-mix(in srgb, var(--color-text) 58%, transparent); }
.slot-pick { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-bg); }
.slot-pick .slot-who { color: color-mix(in srgb, var(--color-bg) 82%, transparent); }
.slot-list { display: grid; gap: var(--space-2); }
button.slot, a.slot { width: 100%; cursor: pointer; font: inherit; text-align: left; text-decoration: none; color: inherit; }
button.slot:hover, a.slot:hover { border-color: var(--color-accent); }
.slot-pick:hover { background: var(--color-accent-600); }

/* — avatars: the circle, never named calendars — */
.avatars { display: inline-flex; align-items: center; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  background: var(--color-accent-300); color: var(--color-accent-900);
  box-shadow: 0 0 0 2px var(--color-bg);
}
.avatars .avatar + .avatar { margin-left: -8px; }
.avatar-more { background: var(--color-neutral-200); color: var(--color-neutral-800); }
.avatar-1 { background: var(--brand-terracotta-tint); color: var(--brand-terracotta-deep); }
.avatar-2 { background: var(--brand-ochre-tint); color: var(--brand-ochre-deep); }
.avatar-3 { background: var(--brand-sage-tint); color: var(--brand-sage-deep); }
.avatar-4 { background: var(--brand-indigo-tint); color: var(--brand-indigo-deep); }
.avatar-5 { background: var(--brand-violet-tint); color: var(--brand-violet-deep); }

/* — sealed round: face-down until everybody has answered — */
.seal { perspective: 700px; }
.seal-inner {
  position: relative; height: 100%; min-height: 108px;
  transition: transform 620ms cubic-bezier(.2,.75,.25,1); transform-style: preserve-3d;
}
.seal-open .seal-inner { transform: rotateY(180deg); }
.seal-face, .seal-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: calc(var(--radius-lg) * 1.15); padding: var(--space-3);
  display: flex; flex-direction: column; justify-content: space-between;
}
.seal-face { background: var(--color-accent-600); color: var(--color-accent-100); }
.seal-back { background: var(--color-surface); transform: rotateY(180deg); box-shadow: var(--shadow-sm); }
.seal-mark { width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--color-accent-100) 32%, transparent); }
.seal-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; }
@media (prefers-reduced-motion: reduce) { .seal-inner { transition-duration: 1ms; } }

/* — sealed answers: present but unreadable until the round closes. Blur, not
     absence, so the shape of what's coming is visible and the reveal is one
     transition rather than a reflow. — */
.answers { filter: blur(6px); transition: filter 500ms ease; user-select: none; }
.answers-open { filter: none; }
@media (prefers-reduced-motion: reduce) { .answers { transition-duration: 1ms; } }

/* — vote: how one person answers, privately — */
.vote { display: inline-flex; gap: var(--space-2); }
.vote-opt {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 14px; font-size: 13px; border-radius: 999px;
  border: 1px solid var(--color-divider); background: transparent;
}
.vote-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.vote-opt:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.vote-yes:has(input:checked) { background: var(--color-yes); border-color: var(--color-yes); color: var(--color-neutral-100); }
.vote-maybe:has(input:checked) { background: var(--color-maybe); border-color: var(--color-maybe); color: var(--color-neutral-100); }
.vote-no:has(input:checked) { background: var(--color-no); border-color: var(--color-no); color: var(--color-neutral-100); }
.vote-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* — connection badge: a calendar this person has linked — */
.conn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px;
  border-radius: 999px; background: var(--color-surface); font-size: 13px;
  border: 1px solid var(--color-divider);
}
.conn .conn-mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--color-bg); }
.conn-on { border-color: color-mix(in srgb, var(--color-accent) 55%, transparent); }
.conn-on .conn-mark { background: var(--color-accent-600); color: var(--color-accent-100); }

/* — meter: how much of the round is in, or how long is left — */
.meter { display: grid; gap: 6px; }
.meter-track { height: 8px; border-radius: 999px; background: var(--color-neutral-200); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--color-accent-600); width: var(--p, 50%); }
.meter-lock .meter-fill { background: var(--color-accent); }
.meter-label { display: flex; justify-content: space-between; font-size: 11.5px; color: color-mix(in srgb, var(--color-text) 58%, transparent); }

/* — logo: a ring of five, drawn in CSS. --logo-size scales the whole mark. — */
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.logo-mark {
  --logo-size: 44px;
  display: block; flex: none; width: var(--logo-size); height: var(--logo-size);
  /* the mark itself is assets/logo.svg — five dots with solid arcs between
     them, gapped so the ring never touches a dot. Point src at the copy that
     travels with the page (templates vendor their own). */
}
.logo-word {
  font-family: var(--font-body); font-weight: 700;
  font-size: calc(var(--logo-size, 44px) * 0.5); letter-spacing: -0.03em; line-height: 1;
  text-transform: lowercase;
}

/* — rounded frame: everything softens, small controls go pill — */
.card, .dialog { border-radius: calc(var(--radius-lg) * 1.15); }
.btn, .tag, .seg, .input { border-radius: 999px; }
.input { padding-inline: 14px; }

