/* MindPeel - Isabel Simon Counseling brand tokens.
   Text colors are contrast-checked: every text token passes WCAG AA (4.5:1) on --paper. */
:root {
  --ink: #2D3A2E;          /* forest: headings, primary buttons (10.5:1 on paper) */
  --ink-soft: #3d4e3f;
  --text: #3a3a36;         /* body (10.1:1) */
  --muted: #62625a;        /* secondary text (5.4:1) */
  --sage-ink: #566948;     /* sage as text or links (5.3:1) */
  --clay: #9a5540;         /* accent text, the root of the rings (4.9:1) */
  --paper: #F5F0E8;        /* page */
  --surface: #FDFCFA;      /* fields and panels */
  --line: #e2dbcf;
  --ring-1: #e6ebe1;       /* rings: decorative only, never text */
  --ring-2: #d3dccb;
  --ring-3: #b9c7ae;
  --ring-4: #9bae8c;
  --ring-5: #7a8f6b;
  --ring-root: #b86b52;

  /* Icon tints: a soft circle and its icon color. Icon on circle is 4.3:1 or better,
     well above the 3:1 that graphics need; the text beside each icon carries the meaning. */
  --sage-bg: #dfe8da;  --sage-fg: #4a6644;
  --moss-bg: #e7e8cf;  --moss-fg: #5b6330;
  --teal-bg: #d8e5e2;  --teal-fg: #3b675f;
  --clay-bg: #f3dfd4;  --clay-fg: #9a5540;
  --ochre-bg: #f1e4c9; --ochre-fg: #7d5a1f;
  --rose-bg: #f1dddb;  --rose-fg: #8a4a4f;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --measure: 40rem;
  --gutter: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: var(--sage-ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
/* Icons: Lucide at its defaults, sized to the text around it */
.icon { display: inline-block; width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.disk {
  display: inline-grid; place-items: center; flex: none; position: relative;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--tint-bg); color: var(--tint-fg);
}
.disk .icon { width: 24px; height: 24px; }
.disk.sm { width: 34px; height: 34px; }
.disk.sm .icon { width: 18px; height: 18px; }
.disk.lg { width: 56px; height: 56px; }
.disk.lg .icon { width: 28px; height: 28px; }
.disk.xl { width: 88px; height: 88px; }
.disk.xl .icon { width: 42px; height: 42px; }
.t-sage { --tint-bg: var(--sage-bg); --tint-fg: var(--sage-fg); }
.t-moss { --tint-bg: var(--moss-bg); --tint-fg: var(--moss-fg); }
.t-teal { --tint-bg: var(--teal-bg); --tint-fg: var(--teal-fg); }
.t-clay { --tint-bg: var(--clay-bg); --tint-fg: var(--clay-fg); }
.t-ochre { --tint-bg: var(--ochre-bg); --tint-fg: var(--ochre-fg); }
.t-rose { --tint-bg: var(--rose-bg); --tint-fg: var(--rose-fg); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Crisis line: on every page, quiet but always there */
.crisis {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
  text-align: center;
  padding: 8px var(--gutter);
  display: flex; justify-content: center; align-items: center; gap: 8px;
}
.crisis .icon { width: 16px; height: 16px; }
.crisis a { color: var(--paper); font-weight: 600; text-decoration: underline; }
.crisis a:hover { color: #fff; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
.masthead .wrap, .foot .wrap { max-width: 58rem; }

/* Header */
.masthead { padding: 22px 0 0; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; }
@media (max-width: 480px) {
  .brand-name { font-size: 1.3rem; }
  .masthead .nav-long { display: none; }
}
.masthead nav a { font-size: 0.9375rem; color: var(--muted); text-decoration: none; padding: 10px 4px; display: inline-flex; align-items: center; gap: 6px; }
.masthead nav a:hover { color: var(--ink); text-decoration: underline; }

main { padding: 28px 0 72px; min-height: 60vh; }
main:focus { outline: none; }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 500; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2.4rem, 7vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.lede { font-size: 1.1875rem; color: var(--muted); max-width: 34rem; }

/* Home */
.hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; padding: 8px 0 12px; }
.hero h1 { font-size: clamp(2.6rem, 9vw, 3.9rem); line-height: 1.04; max-width: 12ch; }
.hero .lede { margin-top: 14px; }
.hero-rings { width: clamp(84px, 24vw, 168px); height: auto; align-self: start; margin-top: 6px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  display: inline-flex; align-items: center; gap: 7px; font-size: 0.875rem; color: var(--sage-fg);
  background: var(--sage-bg); border-radius: 999px; padding: 6px 12px 6px 10px; font-weight: 600;
}
.from { font-size: 0.9375rem; color: var(--muted); margin: 40px 0 0; }

.group { margin-top: 34px; }
.group h2 { font-size: 1.6rem; margin-bottom: 14px; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 14px; }
.group-head h2 { margin: 0; }
.group-note { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--muted); margin: 0; }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
  appearance: none; font: inherit; text-align: left; cursor: pointer; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--text);
  transition: border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.tile .disk { margin-bottom: 10px; }
.tile:hover { border-color: var(--ring-4); transform: translateY(-2px); box-shadow: 0 6px 18px -10px rgba(45, 58, 46, 0.35); }
.tile-name { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; color: var(--ink); line-height: 1.1; }
.tile-tag { font-size: 0.9375rem; color: var(--muted); line-height: 1.35; }
.tile-time { display: inline-flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 10px; font-size: 0.8125rem; color: var(--muted); }
.tile-time .icon { width: 14px; height: 14px; }
/* Phones: two columns, and the first tile of a group of three runs full width, side on */
@media (max-width: 719px) {
  .tiles:not(.small) > li:first-child { grid-column: 1 / -1; }
  .tiles:not(.small) > li:first-child .tile {
    display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center;
  }
  .tiles:not(.small) > li:first-child .disk { grid-row: span 3; margin: 0; width: 56px; height: 56px; }
  .tiles:not(.small) > li:first-child .tile-time { padding-top: 4px; }
}

/* Tool pages */
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9375rem; color: var(--muted); margin-bottom: 16px; padding: 6px 0; text-decoration: none; }
.back:hover { text-decoration: underline; }
.tool-head { margin-bottom: 26px; }
.tool-title { display: flex; align-items: center; gap: 16px; }
.tool-title h1 { font-size: clamp(2.2rem, 7vw, 3.1rem); }
.tool-head .lede { margin-top: 14px; }
.center-text { text-align: center; }
.center-text .disk { margin: 4px auto 14px; }
.sec-head { display: flex; align-items: center; gap: 12px; }
.icon-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.icon-list li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; margin: 0; }
.icon-list li strong { display: block; color: var(--ink); }
.icon-list li span { white-space: pre-wrap; }
.icon-list li > span:only-of-type { padding-top: 5px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.stack > * + * { margin-top: 22px; }

label, .label { display: block; font-weight: 600; color: var(--ink); font-size: 1rem; margin-bottom: 4px; }
label .icon, .label .icon { color: var(--sage-ink); margin-right: 7px; }
.hint.tight { margin: 12px 0 0; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.9375rem; margin-bottom: 8px; }
input[type="text"], textarea, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1px solid #cfc6b6; border-radius: 12px;
  padding: 12px 14px; line-height: 1.5;
}
textarea { resize: vertical; min-height: 6.5em; }
input[type="text"]:focus, textarea:focus, select:focus { outline: 2px solid var(--sage-ink); outline-offset: 1px; border-color: transparent; }
::placeholder { color: #8a897f; }

.actions.center { justify-content: center; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; }
.btn {
  appearance: none; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font: inherit; font-weight: 600; font-size: 1rem; border-radius: 999px;
  padding: 12px 24px; min-height: 48px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color 0.2s, transform 0.15s;
}
.btn:hover { background: var(--ink-soft); color: var(--paper); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover { background: var(--ring-1); color: var(--ink); }
.btn.quiet {
  background: none; border-color: transparent; color: var(--sage-ink);
  padding-left: 6px; padding-right: 6px; text-decoration: underline; font-weight: 600;
}
.btn.quiet:hover { color: var(--ink); background: none; }
.btn .icon { width: 18px; height: 18px; }
.btn.quiet .icon { margin-right: -2px; }
.btn.soft { background: var(--sage-bg); border-color: var(--sage-bg); color: var(--sage-fg); }
.btn.soft:hover { background: #d3dfcd; color: var(--ink); }

.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice button {
  display: inline-flex; align-items: center; gap: 7px;
  appearance: none; font: inherit; font-size: 0.9375rem; color: var(--ink);
  background: transparent; border: 1px solid #cfc6b6; border-radius: 999px;
  padding: 9px 16px; min-height: 44px; cursor: pointer;
}
.choice button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.choice .icon { width: 17px; height: 17px; }
.settings { display: grid; gap: 20px; }

/* Breathe */
.breath { display: grid; place-items: center; padding: 18px 0 8px; }
.breath-stage { position: relative; width: min(260px, 64vw); aspect-ratio: 1; display: grid; place-items: center; }
.breath-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--ring-3) 0 34%, var(--ring-2) 35% 58%, var(--ring-1) 59% 100%);
  transform: scale(0.55); transition-property: transform; transition-timing-function: ease-in-out;
}
.breath-text { position: relative; text-align: center; color: var(--ink); }
.breath-phase { font-family: var(--serif); font-size: 1.9rem; font-weight: 500; line-height: 1.1; }
.breath-count { font-size: 1rem; color: var(--ink-soft); margin-top: 4px; font-variant-numeric: lining-nums tabular-nums; }
.breath-meta { text-align: center; color: var(--muted); font-size: 0.9375rem; margin-top: 14px; }

/* Peel rings */
.rings { width: 100%; height: auto; }
.peel-top { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: center; margin-bottom: 24px; }
.peel-depth { font-size: 0.9375rem; color: var(--muted); margin: 0; }
.peel-depth strong { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 500; color: var(--ink); }
.ring-shape { transition: fill 0.6s var(--ease), stroke 0.6s var(--ease); }
.quote {
  border-left: 3px solid var(--ring-3); padding: 4px 0 4px 14px; margin: 0 0 18px;
  color: var(--muted); font-style: italic;
}
.quote span { display: flex; align-items: center; gap: 6px; font-style: normal; font-size: 0.875rem; }
.quote span .icon { width: 14px; height: 14px; color: var(--ring-5); }
.prompt { font-family: var(--serif); font-size: 1.85rem; color: var(--ink); line-height: 1.2; margin: 0 0 14px; font-weight: 500; }

.pause {
  margin-top: 22px; background: var(--ring-1); border-radius: 16px; padding: 20px 22px;
}
.pause h3 { margin: 0; }
.pause .stage-head { margin-bottom: 12px; }
.pause .disk { background: var(--surface); }
.pause p:last-child { margin-bottom: 0; }

/* Summary */
.summary { margin-top: 36px; }
.summary h2 { margin-bottom: 6px; }
.summary-date { color: var(--muted); font-size: 0.9375rem; margin-bottom: 18px; }
.peel-summary { display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: start; }
.layers { list-style: none; margin: 0; padding: 0; }
.layers li { padding: 0 0 16px 18px; position: relative; }
.layers li::before {
  content: ''; position: absolute; left: 0; top: 0.55em; width: 9px; height: 9px; border-radius: 50%;
  background: var(--dot, var(--ring-3));
}
.layers .q { display: block; font-size: 0.875rem; color: var(--muted); }
.layers .a { white-space: pre-wrap; }
.kv { margin: 0; }
.kv dt { font-weight: 600; color: var(--ink); margin-top: 14px; }
.kv dt:first-child { margin-top: 0; }
.kv dd { margin: 2px 0 0; white-space: pre-wrap; }
.shift { font-variant-numeric: lining-nums; font-family: var(--serif); font-size: 1.5rem; color: var(--ink); margin: 0 0 16px; }
.status { min-height: 1.6em; color: var(--sage-ink); font-size: 0.9375rem; margin: 10px 0 0; }

/* Five senses */
.sense-steps { display: flex; gap: 10px; margin: 0 0 26px; list-style: none; padding: 0; }
.sense-steps li { display: flex; transition: opacity 0.3s; }
.sense-steps li:not(.done):not(.now) { opacity: 0.35; filter: grayscale(1); }
.sense-steps li.now .disk { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--tint-fg); }
.sense-now { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.sense-now h2 { font-size: clamp(1.6rem, 5vw, 2rem); line-height: 1.15; }
.badge {
  position: absolute; right: -4px; bottom: -4px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--paper);
  font-size: 1rem; font-weight: 600; line-height: 1; font-variant-numeric: lining-nums; border: 3px solid var(--surface);
}
.sense-fields { display: grid; gap: 10px; }

/* Worry scale */
.scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.scale button {
  appearance: none; font: inherit; font-size: 0.9375rem; color: var(--ink); font-weight: 600;
  background: var(--tone, var(--surface)); border: 1px solid transparent; border-radius: 10px;
  min-height: 44px; cursor: pointer; padding: 0; font-variant-numeric: lining-nums tabular-nums;
}
.scale button:hover { border-color: var(--ink); }
.scale button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: scale(1.08); }
.scale-ends { display: flex; justify-content: space-between; font-size: 0.875rem; color: var(--muted); margin-top: 6px; }
.example { margin-top: 18px; }
.example summary { cursor: pointer; color: var(--ochre-fg); font-weight: 600; padding: 8px 0; display: inline-flex; align-items: center; gap: 7px; }
.example summary::-webkit-details-marker { display: none; }
.example summary { list-style: none; }
.evidence { display: grid; gap: 16px; margin-top: 10px; padding: 16px; border-radius: 14px; background: var(--paper); }
.evidence label { font-size: 0.9375rem; }
.worry-shift { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.worry-shift > .icon { width: 28px; height: 28px; color: var(--muted); }
.worry-num { display: grid; justify-items: center; width: 84px; padding: 10px 0 8px; border-radius: 18px; background: var(--tone); }
.worry-num .n { font-family: var(--serif); font-variant-numeric: lining-nums; font-size: 2.6rem; line-height: 1; color: var(--ink); }
.worry-num .w { font-size: 0.8125rem; color: var(--ink-soft); }
.example .kv { margin-top: 10px; padding: 18px 20px; background: var(--ring-1); border-radius: 14px; }

/* Resets */
.tiles.small .tile { align-items: center; text-align: center; padding: 18px 10px 16px; gap: 0; }
.tiles.small .tile .disk { margin-bottom: 10px; }
.tiles.small .tile-name { font-size: 1.2rem; }
.tile[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.actions.top { margin: 0 0 18px; }
.stage { margin-bottom: 18px; scroll-margin-top: 16px; }
.stage-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.timer { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.timer-read { font-family: var(--serif); font-size: 2.2rem; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; min-width: 4ch; }
.scan-part { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); margin: 0; }
.bar { height: 6px; background: var(--ring-1); border-radius: 3px; overflow: hidden; margin: 12px 0; }
.bar > span { display: block; height: 100%; width: 0; background: var(--ring-4); transition: width 1s linear; }

/* Timebox */
.tb-cols { display: grid; gap: 28px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: center; }
.checklist input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--ink); margin: 0; }
.checklist input[type="checkbox"]:checked + input { text-decoration: line-through; color: var(--muted); }
.schedule { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.schedule th { font-weight: 600; color: var(--muted); font-size: 0.875rem; text-align: left; padding: 0 6px; }
.schedule td { padding: 0 3px; }
.schedule td:first-child, .schedule th:first-child { width: 4.2em; white-space: nowrap; font-weight: 600; color: var(--ink); font-size: 0.9375rem; padding-left: 0; }
.schedule input[type="text"] { padding: 9px 10px; border-radius: 9px; }
.range { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 10px; }
.range label { font-weight: 400; color: var(--muted); font-size: 0.9375rem; margin: 0; }
.range select { width: auto; padding: 8px 12px; margin-top: 4px; }

/* About */
.prose h2 { margin: 34px 0 10px; font-size: 1.6rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0 44px; font-size: 0.9375rem; color: var(--muted); }
.foot .wrap { display: grid; gap: 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot-links a { padding: 6px 0; }
.foot p { margin: 0; }

@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .wrap.home { max-width: 58rem; }
  .home .hero { padding-top: 20px; }
  .home .hero h1 { max-width: 15ch; }
  .home .tile { padding: 20px; }
  .tiles.small { grid-template-columns: repeat(4, 1fr); }
  .evidence { grid-template-columns: 1fr 1fr; }
  .tb-cols { grid-template-columns: 1fr 1fr; }
  .tb-cols .wide { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .tile { padding: 14px; }
  .tile-name { font-size: 1.3rem; }
  .sense-now { gap: 16px; }
  .sense-now .disk.xl { width: 72px; height: 72px; }
  .sense-now .disk.xl .icon { width: 34px; height: 34px; }
  .sense-steps { gap: 6px; }
  .peel-summary { grid-template-columns: 1fr; }
  .peel-summary .rings { width: 120px; }
  .scale { grid-template-columns: repeat(6, 1fr); }
  .panel { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .tile:hover, .scale button[aria-pressed="true"] { transform: none; }
  .breath-ring { transform: scale(0.8) !important; }
}

/* Print: only the takeaway (or the timebox itself), branded */
.print-head { display: none; }
@media print {
  @page { margin: 16mm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .crisis, .masthead, .foot, .back, .actions, .no-print, .pause, .status { display: none !important; }
  body.printing-summary main .wrap > *:not(.printable) { display: none !important; }
  .print-head { display: block; font-family: var(--serif); font-size: 13pt; color: #000; border-bottom: 1px solid #999; padding-bottom: 6px; margin-bottom: 14px; }
  .summary { margin-top: 0; }
  .tool-head .lede { display: none; }
  .panel { border: 0; padding: 0; }
  .disk { background: none !important; width: auto !important; height: auto !important; }
  .evidence { background: none; padding: 0; }
  input[type="text"], textarea, select { border: 0; border-bottom: 1px solid #bbb; border-radius: 0; padding: 4px 2px; background: none; }
  textarea { min-height: 0; resize: none; }
  a { color: #000; text-decoration: none; }
}
