/* Amen Prayers design system. Linked from every board. */

:root {
  /* Color: page, surface, ink */
  --page: #FBF9F6;
  --surface: #FFFFFF;
  --sunken: #F3EDE4;
  --line: #EAE6E1;
  --line-soft: #F3F0EC;
  --line-gold: #E4D9C8;
  --ink: #262320;
  --ink-2: #5B5650;
  --ink-3: #77716A;
  /* Gold: accent fill, accent text, pressed */
  --gold: #A4865A;
  --gold-text: #86683D;
  --gold-deep: #6E5531;
  --gold-soft: #CDB48D;
  --danger: #A0402B;
  /* Modes */
  --sister-bg: #FCEEF3; --sister-surface: #FFF8FB; --sister-line: #F1D3DF; --sister-ink: #3A1F2B; --sister-ink-2: #7A5363; --sister-accent: #B04A72;
  --brother-bg: #EEF3FC; --brother-surface: #F8FAFF; --brother-line: #D3DFF1; --brother-ink: #1C2638; --brother-ink-2: #53627A; --brother-accent: #3A67AE;

  /* Type */
  --serif: Fraunces, Georgia, serif;
  --sans: Inter, system-ui, -apple-system, sans-serif;
  --t-micro: 11px;   /* counts, eyebrow caps (0.08em, uppercase) */
  --t-small: 12px;   /* meta, badges */
  --t-label: 13px;   /* chips, buttons, tabs */
  --t-body: 15px;    /* UI body, list rows */
  --t-lead: 17px;    /* card prayer text */
  --t-title: 20px;   /* sheet titles */
  --t-h2: 24px;      /* screen titles */
  --t-h1: 28px;
  --t-prayer: clamp(22px, min(8.2cqw, 5cqh), 32px); /* Focus prayer */
  --lh-tight: 1.15;  /* display, Amen */
  --lh-head: 1.28;   /* headings, prayers */
  --lh-ui: 1.35;     /* labels, buttons (2 lines max) */
  --lh-body: 1.5;    /* paragraphs */

  /* Space: 4pt grid */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 22px; --s6: 32px;
  --gutter: clamp(14px, 5.6cqw, 22px);

  /* Radius */
  --r-bar: 2px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-sheet: 24px; --r-pill: 999px;

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(38,35,32,.06);
  --shadow-2: 0 6px 24px rgba(38,35,32,.10);

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --d-fast: 120ms; --d-base: 220ms; --d-slow: 320ms;

  --tap: 44px;
}

/* Base */
html, body { background: var(--page); color: var(--ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -webkit-tap-highlight-color: transparent; }
button, a, [role="button"], input, textarea, select { font: inherit; }
button, a, [role="button"] { cursor: pointer; touch-action: manipulation; }

/* Interaction: every tappable thing behaves the same */
button, a, [role="button"], [role="switch"], [role="tab"], label[for] {
  transition: background-color var(--d-base) var(--ease), color var(--d-base) var(--ease),
    border-color var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease),
    opacity var(--d-base) var(--ease), transform var(--d-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover, a:hover, [role="button"]:hover { filter: brightness(.97); }
}
button:not(:disabled):active, a:active, [role="button"]:active { transform: scale(.97); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: inherit; }
button:disabled, [aria-disabled="true"] { opacity: .45; cursor: default; }
::selection { background: var(--line-gold); color: var(--ink); }
input, textarea { caret-color: var(--gold); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }

/* Text behavior */
h1, h2, h3, [data-ds="title"] { text-wrap: balance; }
p, [data-ds="prayer"] { text-wrap: pretty; hyphens: manual; }
[data-ds="prayer"] { font-family: var(--serif); font-weight: 300; line-height: var(--lh-head); letter-spacing: -0.01em; }

/* Components */
/* Label: one word ideally; shrinks once, then wraps to two lines, then truncates. */
.ds-label { font: 500 clamp(12px, 3.4cqw, var(--t-label))/var(--lh-ui) var(--sans); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.ds-eyebrow { font: 600 var(--t-micro)/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ds-meta { font: 400 var(--t-small)/var(--lh-ui) var(--sans); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ds-btn { min-height: var(--tap); padding: 0 var(--s4); border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 var(--t-label)/var(--lh-ui) var(--sans); display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); }
.ds-btn--primary { background: var(--ink); border-color: var(--ink); color: var(--page); }
.ds-btn--accent { background: var(--sunken); border: 1.5px solid var(--gold); color: var(--gold-deep); }
.ds-btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.ds-chip { min-height: 32px; padding: 0 var(--s3); border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 500 var(--t-label)/1 var(--sans); display: inline-flex; align-items: center; gap: 6px; position: relative; }
.ds-chip::after { content: ""; position: absolute; inset: -6px 0; } /* 44px hit area */
.ds-chip[aria-pressed="true"] { background: var(--sunken); border: 1.5px solid var(--gold); color: var(--gold-deep); }
.ds-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-1); }
.ds-sheet { background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--shadow-2); animation: ds-rise var(--d-slow) var(--ease-out); }
.ds-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--gold); color: #fff; font: 600 10px/18px var(--sans); text-align: center; font-variant-numeric: tabular-nums; }
.ds-switch { width: 52px; height: 32px; border-radius: var(--r-pill); background: var(--line); position: relative; }
.ds-switch[aria-checked="true"] { background: var(--gold); }

@keyframes ds-rise { from { transform: translateY(16px); opacity: 0; } }
@keyframes ds-fade { from { opacity: 0; } }

/* Numbers never jump */
[data-ds="count"], .ds-badge, .ds-meta { font-variant-numeric: tabular-nums; }

/* Respect reduced motion everywhere */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  button:active, a:active { transform: none; }
}

/* Switch on a native checkbox: <input type="checkbox" role="switch" class="sw"> */
input.sw { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 52px; height: 32px; margin: 0; border-radius: var(--r-pill); background: var(--line); cursor: pointer; transition: background-color var(--d-base) var(--ease); }
input.sw::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(38,35,32,.2); transition: transform var(--d-base) var(--ease); }
input.sw:checked { background: var(--ink); }
input.sw:checked::after { transform: translateX(20px); }

/* Glass bars: sticky top and bottom bars blur what scrolls beneath them. */
.glass { background: rgba(251,249,246,.72) !important; -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); }
.glass-top { position: absolute; top: 0; left: 0; right: 0; z-index: 5; }
.glass-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; }
