/* Link a date: warm, rounded, a little romantic. Colours are variables; dark mode has its own set. */
:root {
  --bg: #fff6f4;
  --bg-glow: #ffd9e3;
  --card: #ffffff;
  --text: #241a1d;
  --muted: #62555a;
  --line: #e2cfd5;
  --field: #ffffff;
  --accent: #b02453;
  --accent-2: #d02a5b;
  --accent-text: #ffffff;
  --focus: #0b57d0;
  --error: #b3261e;
  --shadow: 0 8px 30px rgba(176, 36, 83, 0.12);
  --bubble: #f3e7ea;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cpath d='M40 34c-6-10-22-6-22 7 0 12 22 24 22 24s22-12 22-24c0-13-16-17-22-7z' fill='%23d02a5b' fill-opacity='.08'/%3E%3Ccircle cx='132' cy='120' r='10' fill='%23d02a5b' fill-opacity='.06'/%3E%3Cpath d='M120 30c-4-7-15-4-15 5 0 8 15 16 15 16s15-8 15-16c0-9-11-12-15-5z' fill='%23d02a5b' fill-opacity='.06'/%3E%3Ccircle cx='40' cy='140' r='6' fill='%23d02a5b' fill-opacity='.07'/%3E%3C/svg%3E");
  --st-pending-bg: #fff0c2; --st-pending-fg: #5c3b00;
  --st-accepted-bg: #d6f1df; --st-accepted-fg: #0f4a26;
  --st-proposed-bg: #ffdce8; --st-proposed-fg: #7a1236;
  --st-closed-bg: #e8e4e5; --st-closed-fg: #363133;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #1a1018;
    --bg-glow: #4a1d38;
    --card: #271a25;
    --text: #f8eef1;
    --muted: #cdb9c1;
    --line: #523b4c;
    --field: #1f141d;
    --accent: #f08aa9;
    --accent-2: #ff9db8;
    --accent-text: #2a0f1a;
    --focus: #8ab4f8;
    --error: #ff8a80;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --bubble: #3a2837;
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cpath d='M40 34c-6-10-22-6-22 7 0 12 22 24 22 24s22-12 22-24c0-13-16-17-22-7z' fill='%23f08aa9' fill-opacity='.09'/%3E%3Ccircle cx='132' cy='120' r='10' fill='%23f08aa9' fill-opacity='.07'/%3E%3Cpath d='M120 30c-4-7-15-4-15 5 0 8 15 16 15 16s15-8 15-16c0-9-11-12-15-5z' fill='%23f08aa9' fill-opacity='.07'/%3E%3Ccircle cx='40' cy='140' r='6' fill='%23f08aa9' fill-opacity='.08'/%3E%3C/svg%3E");
    --st-pending-bg: #4d3a12; --st-pending-fg: #ffe7a8;
    --st-accepted-bg: #1d4630; --st-accepted-fg: #c8f2d8;
    --st-proposed-bg: #5a2238; --st-proposed-fg: #ffd3e1;
    --st-closed-bg: #3d3339; --st-closed-fg: #e8dde2;
  }
}
:root[data-theme='dark'] {
  --bg: #1a1018;
  --bg-glow: #4a1d38;
  --card: #271a25;
  --text: #f8eef1;
  --muted: #cdb9c1;
  --line: #523b4c;
  --field: #1f141d;
  --accent: #f08aa9;
  --accent-2: #ff9db8;
  --accent-text: #2a0f1a;
  --focus: #8ab4f8;
  --error: #ff8a80;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --bubble: #3a2837;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cpath d='M40 34c-6-10-22-6-22 7 0 12 22 24 22 24s22-12 22-24c0-13-16-17-22-7z' fill='%23f08aa9' fill-opacity='.09'/%3E%3Ccircle cx='132' cy='120' r='10' fill='%23f08aa9' fill-opacity='.07'/%3E%3Cpath d='M120 30c-4-7-15-4-15 5 0 8 15 16 15 16s15-8 15-16c0-9-11-12-15-5z' fill='%23f08aa9' fill-opacity='.07'/%3E%3Ccircle cx='40' cy='140' r='6' fill='%23f08aa9' fill-opacity='.08'/%3E%3C/svg%3E");
  --st-pending-bg: #4d3a12; --st-pending-fg: #ffe7a8;
  --st-accepted-bg: #1d4630; --st-accepted-fg: #c8f2d8;
  --st-proposed-bg: #5a2238; --st-proposed-fg: #ffd3e1;
  --st-closed-bg: #3d3339; --st-closed-fg: #e8dde2;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--text); min-height: 100vh;
  font: 1.125rem/1.55 ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: radial-gradient(120% 60% at 50% -10%, var(--bg-glow) 0%, transparent 70%);
}
/* Decorative hearts and dots, faded, behind everything. Nothing here is content. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--pattern); background-size: 180px 180px;
}

header, main, footer { max-width: 40rem; margin: 0 auto; }
header { padding: 1rem 1rem 0.25rem; }
main {
  background: var(--card); border-radius: 1.5rem; box-shadow: var(--shadow);
  padding: 1.25rem 1.1rem 1.5rem; margin-top: 0.5rem; margin-bottom: 1rem;
  width: calc(100% - 1.5rem);
}
footer { padding: 0.5rem 1rem 1.5rem; color: var(--muted); font-size: 0.95rem; }
footer p { margin: 0.25rem 0; }

.brand { display: flex; align-items: center; gap: 0.55rem; margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.2; color: var(--text); text-decoration: none; }
h1.brand { margin: 0.25rem 0; }
.logo { flex: none; width: 2rem; height: 2rem; }
.logo rect { fill: var(--accent); }
.logo path { fill: var(--accent-text); }

h1 { font-size: 1.75rem; line-height: 1.2; margin: 0.25rem 0 0.75rem; font-weight: 800; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; font-weight: 750; }
a { color: var(--accent); }
.lead { font-size: 1.55rem; font-weight: 800; line-height: 1.25; margin: 0.25rem 0 0.75rem; }

label { display: block; font-weight: 650; margin-top: 1rem; }
.hint { color: var(--muted); font-weight: 400; font-size: 0.95rem; }
.hint-line { display: block; margin-top: 0.1rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: 0.3rem; padding: 0.7rem 0.85rem;
  font: inherit; color: var(--text); background: var(--field);
  border: 2px solid var(--line); border-radius: 0.9rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 5.5rem; }

button, .button {
  display: inline-block; margin: 0.85rem 0.5rem 0 0; padding: 0.75rem 1.4rem; font: inherit; font-weight: 700;
  color: var(--accent-text); background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border: 2px solid transparent; border-radius: 999px; text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(176, 36, 83, 0.25);
}
button:active, .button:active { transform: translateY(1px); }
button.secondary, .button.secondary {
  color: var(--text); background: transparent; border-color: var(--line); box-shadow: none;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.error { color: var(--error); font-weight: 650; }
.status { font-weight: 650; }
[hidden] { display: none !important; }

/* The date as an invitation card. The little icons are drawn by CSS, so screen readers never meet them. */
dl { margin: 1rem 0; padding: 0.25rem 1rem 1rem; border: 2px solid var(--line); border-radius: 1.1rem; background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
dt { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.9rem; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
dt::before {
  content: ''; width: 1.1rem; height: 1.1rem; background: var(--accent);
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
dd { margin: 0.15rem 0 0; overflow-wrap: anywhere; }
#when { font-size: 1.3rem; font-weight: 800; line-height: 1.3; }
dt:nth-of-type(1) { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2v3M17 2v3M3 8h18M5 4h14a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
dt:nth-of-type(2) { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s7-6.2 7-11.5A7 7 0 0 0 5 9.5C5 14.8 12 21 12 21z' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='12' cy='9.5' r='2.5' fill='black'/%3E%3C/svg%3E"); }
dt:nth-of-type(3) { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 4h14v12H9l-4 4z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
dt:nth-of-type(4) { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 12l3 3 5-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* The status as a coloured pill. The words are always there; colour is only extra. */
#state { display: inline-block; padding: 0.2rem 0.9rem; border-radius: 999px; font-weight: 750; background: var(--st-pending-bg); color: var(--st-pending-fg); }
#state[data-status='accepted'] { background: var(--st-accepted-bg); color: var(--st-accepted-fg); }
#state[data-status='proposed'] { background: var(--st-proposed-bg); color: var(--st-proposed-fg); }
#state[data-status='declined'], #state[data-status='cancelled'] { background: var(--st-closed-bg); color: var(--st-closed-fg); }
#proposal { padding: 0.75rem 1rem; border-radius: 1rem; background: var(--st-proposed-bg); color: var(--st-proposed-fg); font-weight: 650; }

/* The chat as speech bubbles: yours on the right, the other person's on the left. */
.log { list-style: none; margin: 0.75rem 0; padding: 0; }
.log li { display: flex; flex-direction: column; margin: 0.6rem 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.log li.mine { align-items: flex-end; }
.log li.other { align-items: flex-start; }
.log .who { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin: 0 0.5rem 0.15rem; }
.log .msg { max-width: 88%; padding: 0.55rem 0.95rem; border-radius: 1.2rem; background: var(--bubble); }
.log li.mine .msg { background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 0.35rem; }
.log li.other .msg { border-bottom-left-radius: 0.35rem; }

input[type='checkbox'] { display: inline-block; width: auto; margin: 0 0.5rem 0 0; transform: scale(1.3); accent-color: var(--accent); }
label.check { display: block; margin-top: 1rem; }

details { border-bottom: 1px solid var(--line); padding: 0.25rem 0; }
summary { cursor: pointer; padding: 0.5rem 0; }
summary h2 { display: inline; font-size: 1.15rem; margin: 0; }
details > :not(summary) { margin-left: 0.25rem; }

.theme { display: inline; }
.theme select { display: inline-block; width: auto; margin: 0 0.3rem; padding: 0.35rem 0.6rem; vertical-align: middle; border-radius: 999px; }
.theme-ic { display: inline-block; vertical-align: middle; width: 1.2rem; height: 1.2rem; stroke: currentColor; fill: none; stroke-width: 2; }

@media (min-width: 40rem) {
  main { padding: 1.75rem 2rem 2rem; margin-top: 1rem; }
  .lead { font-size: 1.9rem; }
  h1.brand { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) { button:active, .button:active { transform: none; } }
header p { margin: 0.25rem 0; }
.posts { list-style: none; margin: 0.75rem 0; padding: 0; }
.posts li { border: 2px solid var(--line); border-radius: 1.1rem; padding: 0.1rem 1rem 1rem; margin: 0.75rem 0; overflow-wrap: anywhere; }
.posts h3 { margin: 0.75rem 0 0.25rem; font-size: 1.15rem; }
.posts p { margin: 0.35rem 0; }

/* ===== Design pass: serif headlines, a link motif, a second warm accent, profile-style cards, two-column home ===== */
:root {
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --peach: #ffb48a;
  --lavender: #c7b3ff;
  --mint: #a8e6cf;
  --glow-2: #ffe6d3;
  --chip-bg: #ffe8da;
  --av-text: #ffffff;
  --av0: #b02453; --av1: #6d3fb8; --av2: #b34a00; --av3: #1b7255; --av4: #a3265f;
  --art-table: #ebcdd5; --art-saucer: #ffffff; --art-a: #d02a5b; --art-b: #ff9a63; --art-steam: #e9a9bb; --art-heart: #d02a5b;
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 88 20'%3E%3Cpath d='M13 11C28-3 40-3 44 9s18 13 31 2' fill='none' stroke='%23d02a5b' stroke-width='2.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11' r='5' fill='%23d02a5b'/%3E%3Ccircle cx='80' cy='11' r='5' fill='%23ff9a63'/%3E%3C/svg%3E");
  --heart-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 24.5s-8-5-8-10.2c0-3 2.3-4.8 4.6-4.8 1.4 0 2.7.7 3.4 1.9.7-1.2 2-1.9 3.4-1.9 2.3 0 4.6 1.8 4.6 4.8 0 5.2-8 10.2-8 10.2z'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --peach: #ffb48a; --lavender: #b79cff; --mint: #7fd6b2; --glow-2: #3d2234; --chip-bg: #4a3041; --av-text: #2a0f1a;
    --av0: #f08aa9; --av1: #b79cff; --av2: #ffb48a; --av3: #7fd6b2; --av4: #ff9db8;
    --art-table: #523b4c; --art-saucer: #3a2837; --art-a: #f08aa9; --art-b: #ffb48a; --art-steam: #8a6579; --art-heart: #f08aa9;
    --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 88 20'%3E%3Cpath d='M13 11C28-3 40-3 44 9s18 13 31 2' fill='none' stroke='%23f08aa9' stroke-width='2.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11' r='5' fill='%23f08aa9'/%3E%3Ccircle cx='80' cy='11' r='5' fill='%23ffb48a'/%3E%3C/svg%3E");
  }
}
:root[data-theme='dark'] {
  --peach: #ffb48a; --lavender: #b79cff; --mint: #7fd6b2; --glow-2: #3d2234; --chip-bg: #4a3041; --av-text: #2a0f1a;
  --av0: #f08aa9; --av1: #b79cff; --av2: #ffb48a; --av3: #7fd6b2; --av4: #ff9db8;
  --art-table: #523b4c; --art-saucer: #3a2837; --art-a: #f08aa9; --art-b: #ffb48a; --art-steam: #8a6579; --art-heart: #f08aa9;
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 88 20'%3E%3Cpath d='M13 11C28-3 40-3 44 9s18 13 31 2' fill='none' stroke='%23f08aa9' stroke-width='2.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11' r='5' fill='%23f08aa9'/%3E%3Ccircle cx='80' cy='11' r='5' fill='%23ffb48a'/%3E%3C/svg%3E");
}

/* Serif for headlines (the device's own serif font: nothing is downloaded). The brand name and small headings stay sans. */
h1, h2, .lead { font-family: var(--serif); }
h1.brand { font-family: inherit; }
.lead { font-weight: 700; letter-spacing: -0.01em; }

/* A second warm glow behind the page, and the link motif under each page title. */
body { background: radial-gradient(120% 60% at 50% -10%, var(--bg-glow) 0%, transparent 70%), radial-gradient(70% 40% at 105% 25%, var(--glow-2) 0%, transparent 70%); }
main h1::after, .lead::after {
  content: ''; display: block; width: 5.5rem; height: 1.25rem; margin-top: 0.45rem;
  background: var(--motif) left center / contain no-repeat;
}

/* The home page: introduction beside the cups on a wide screen. */
.hero { display: block; }
.hero-art { display: block; width: 100%; max-width: 15rem; height: auto; margin: 0.5rem auto 1rem; }
.art-table { fill: var(--art-table); }
.art-saucer { fill: var(--art-saucer); stroke: var(--art-table); stroke-width: 1.5; }
.art-cup-a { fill: var(--art-a); }
.art-cup-b { fill: var(--art-b); }
.art-handle-a { stroke: var(--art-a); }
.art-handle-b { stroke: var(--art-b); }
.art-steam { stroke: var(--art-steam); }
.art-link-line { stroke: var(--art-a); }
.art-dot-a { fill: var(--art-a); }
.art-dot-b { fill: var(--art-b); }
@media (min-width: 52rem) {
  body.home header, body.home main, body.home footer { max-width: 60rem; }
  .hero { display: grid; grid-template-columns: 1fr 17rem; gap: 2rem; align-items: center; }
  .hero-art { margin: 0; max-width: none; }
  body.home form { max-width: 36rem; }
}

/* Profile-style cards for invitations. */
.post-head { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.8rem; }
.post-head h3 { margin: 0; }
.avatar { flex: none; display: flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; font-weight: 800; font-size: 1.15rem; color: var(--av-text); background: var(--av0); }
.avatar.av1 { background: var(--av1); } .avatar.av2 { background: var(--av2); } .avatar.av3 { background: var(--av3); } .avatar.av4 { background: var(--av4); }
.chips { margin: 0.5rem 0; }
.chip { display: inline-block; margin: 0 0.4rem 0.4rem 0; padding: 0.15rem 0.75rem; border-radius: 999px; background: var(--chip-bg); font-size: 0.92rem; font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.posts li { transition: border-color 0.15s; }
.posts li:hover { border-color: var(--accent); }
.posts li:nth-child(3n+1) { background: color-mix(in srgb, var(--peach) 16%, var(--card)); }
.posts li:nth-child(3n+2) { background: color-mix(in srgb, var(--lavender) 16%, var(--card)); }
.posts li:nth-child(3n) { background: color-mix(in srgb, var(--mint) 16%, var(--card)); }

/* Calm touches: a soft hover on buttons, and a heart that pulses twice when a date is accepted. */
button:hover, .button:hover { filter: brightness(1.06); }
button.secondary:hover, .button.secondary:hover { border-color: var(--accent); filter: none; }
#state[data-status='accepted']::after {
  content: ''; display: inline-block; width: 1rem; height: 1rem; margin-left: 0.45rem; vertical-align: -0.1rem;
  background: var(--st-accepted-fg);
  -webkit-mask: var(--heart-mask) center / contain no-repeat; mask: var(--heart-mask) center / contain no-repeat;
  animation: heart-pulse 1.1s ease-out 2;
}
@keyframes heart-pulse { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  #state[data-status='accepted']::after { animation: none; }
  .posts li { transition: none; }
}
