/* Morning Notes: photo-led, calm, large type. */
:root {
  --ground: #eef0ed;
  --ink: #1e211f;
  --muted: #666c68;
  --glass: rgba(250, 250, 247, 0.90);
  --glass-strong: rgba(250, 250, 247, 0.97);
  --line: rgba(30, 33, 31, 0.10);
  --accent: #4f7a5c;
  --accent-ink: #ffffff;
  --today: #d4a017;
  --shadow: 0 18px 50px rgba(20, 24, 22, 0.18);
  --hero-scrim: linear-gradient(180deg, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,0.58) 100%);
  --tile-scrim: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,0.64) 100%);
  --display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --body: "Nunito Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; cursor: pointer; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.date { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 8px; }
.hint { color: var(--muted); font-size: 15px; }
.hint a { color: var(--muted); }
.error { color: #a12b2b; font-weight: 700; }

/* ---------- Buttons ---------- */
.btn { border: 1px solid var(--line); background: var(--glass-strong); color: var(--ink); border-radius: 999px; padding: 12px 20px; min-height: 48px; font-weight: 600; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.btn.read { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-size: 19px; }
.btn.read:hover { filter: brightness(0.94); }
.btn:disabled { opacity: 0.55; cursor: default; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; min-height: 44px; }
.pill { background: rgba(0,0,0,0.35); color: #fff; border: 1px solid rgba(255,255,255,0.45); border-radius: 999px; padding: 10px 16px; min-height: 44px; font-weight: 600; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.pill.dark { background: var(--ink); color: var(--ground); border-color: var(--ink); backdrop-filter: none; }

/* ---------- Gates: on today's picture, with a welcome ---------- */
.gates { position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 22px; background: #3a4740 center / cover no-repeat; color: #fff; }
.gates::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.55)); }
.gates > * { position: relative; z-index: 1; }
.welcome { text-align: center; max-width: 600px; }
.welcome .date { opacity: 0.85; margin-bottom: 10px; }
.welcome h1 { font-size: clamp(34px, 7vw, 58px); font-weight: 500; }
.welcome .from { font-size: 20px; opacity: 0.9; margin: 8px 0 0; }
.panel { width: 100%; max-width: 480px; background: var(--glass-strong); color: var(--ink); border: 1px solid var(--line); border-radius: 22px; padding: 26px 24px; box-shadow: var(--shadow); }
.panel h2 { font-size: 34px; margin-bottom: 4px; }
.panel .muted { margin: 0 0 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.bigin { font: inherit; font-size: 20px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; flex: 1; min-width: 140px; background: #fff; color: var(--ink); }
.bigin.pin { max-width: 150px; letter-spacing: 6px; }
.pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 6px 0 14px; }
.pick button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; font-weight: 700; }
.pick button:hover { border-color: var(--accent); }
.pick button:disabled { opacity: 0.5; }
.pick img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.status { color: #fff; opacity: 0.9; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 76svh; background: #3a4740 center / cover no-repeat; color: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.hero::after { content: ""; position: absolute; inset: 0; background: var(--hero-scrim); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: calc(16px + env(safe-area-inset-top)) 20px 16px; }
.brand { font-family: var(--display); font-size: 19px; line-height: 1.15; opacity: 0.95; max-width: 60%; }
.brand span { display: block; font-family: var(--body); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; margin-top: 2px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.avatar { width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.85); background: #ccc center / cover; padding: 0; }
.greet { padding: 0 20px 84px; max-width: 900px; }
.greet .date { opacity: 0.85; }
.greet h1 { font-size: clamp(34px, 9vw, 72px); font-weight: 500; }
.greet .where { font-size: 17px; opacity: 0.92; margin: 12px 0 0; max-width: 60ch; }
.credit { max-width: 720px; margin: 8px auto 0; padding: 0 4px; font-size: 12px; color: var(--muted); opacity: 0.8; text-align: left; line-height: 1.35; }
.credit.onphoto { position: absolute; right: 12px; bottom: 8px; margin: 0; max-width: 70%; color: #fff; opacity: 0.75; text-align: right; font-size: 11px; }
.sheet.zen .credit.onphoto { display: block; }

/* ---------- Today card ---------- */
.wrap { max-width: 860px; margin: 0 auto; padding-inline: 16px; }
.today { position: relative; z-index: 2; margin-top: -54px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 22px; box-shadow: var(--shadow); padding: 22px 22px 18px; }
.today h2 { font-size: 30px; margin-bottom: 6px; }
.today p { margin: 0; }
.today .quote { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.4; }
.today .attr { color: var(--muted); font-size: 15px; margin-top: 6px; }
.today .actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.today .notice { background: #fff3cd; border: 1px solid #ffe08a; padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 16px; }

/* ---------- Family faces ---------- */
.family { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.faces { display: flex; }
.face { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--glass-strong); background: #999 center / cover; margin-left: -8px; filter: grayscale(1); opacity: 0.5; position: relative; flex: none; }
.face:first-child { margin-left: 0; }
.face.opened { opacity: 0.75; }
.face.read { filter: none; opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
.face.read::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--glass-strong); }
.family .who { color: var(--muted); font-size: 15px; margin: 0; }
.family .who b { color: var(--ink); }

/* ---------- Tiles ---------- */
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { font-size: 28px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: #556 center / cover; color: #fff; text-align: left; padding: 0; border: 0; box-shadow: 0 6px 20px rgba(20,24,22,0.12); transition: transform .2s ease; }
.tile:hover, .tile:focus-visible { transform: translateY(-3px); outline: 2px solid var(--accent); outline-offset: 2px; }
.tile::after { content: ""; position: absolute; inset: 0; background: var(--tile-scrim); }
.tile .t { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; }
.tile .d { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.9; margin: 0 0 2px; }
.tile .q { font-family: var(--serif); font-size: 18px; font-weight: 400; line-height: 1.3; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile .mini { position: absolute; top: 10px; right: 10px; z-index: 1; display: flex; }
.tile .mini .face { width: 20px; height: 20px; border: 1.5px solid #fff; margin-left: -6px; box-shadow: none; }
.tile .mini .face::after { display: none; }
footer { color: var(--muted); font-size: 14px; text-align: center; padding: 40px 0 30px; }

/* ---------- Reading sheet (day) and month ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; background: var(--ground); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet .photo { position: relative; height: 46svh; min-height: 280px; background: #3a4740 center / cover; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; transition: height .35s ease; }
.sheet .photo::after { content: ""; position: absolute; inset: 0; background: var(--hero-scrim); pointer-events: none; }
.sheet .photo > * { position: relative; z-index: 1; }
.sheet-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.sheet-bar.solid { position: sticky; background: var(--ground); }
.sheet .title { padding: 0 20px 24px; }
.sheet .title .date { opacity: 0.85; }
.sheet .title h1 { font-size: clamp(30px, 6vw, 54px); font-weight: 500; }
.sheet .title .where { display: none; font-size: 17px; opacity: 0.92; margin: 12px 0 0; max-width: 60ch; }
.reading { max-width: 720px; margin: 0 auto; padding: 8px 16px 40px; }
.reading .note { font-family: var(--serif); font-size: 19px; line-height: 1.65; }
.reading .note strong { font-weight: 700; }
.reading .family { margin-top: 14px; padding-top: 0; border-top: 0; }
.daynav { display: flex; gap: 8px; justify-content: space-between; margin: 10px 0 0; }
.daynav .btn { flex: 1; text-align: center; }
.note { padding: 28px 0; border-bottom: 1px solid var(--line); }
.note h2 { font-size: 30px; font-weight: 700; margin: 0 0 14px; }
.note h2.with-face { display: flex; align-items: center; gap: 12px; }
.note h2 .face { width: 36px; height: 36px; margin: 0; filter: none; opacity: 1; box-shadow: none; }
.note h2 .face::after { display: none; }
.note:last-child { border-bottom: 0; }
.note .to { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.note .to .face { width: 28px; height: 28px; margin: 0; filter: none; opacity: 1; box-shadow: none; }
.note .to .face::after { display: none; }
.note h3 { font-size: 27px; margin-bottom: 6px; }
.note blockquote { margin: 0 0 10px; font-family: var(--serif); font-size: 23px; line-height: 1.4; font-weight: 400; }
.note .attr { color: var(--muted); font-size: 19px; margin: 0 0 14px; }

.note p { margin: 0 0 12px; }
.note .prompt { font-weight: 700; }
.note .lens { border-left: 2px solid var(--accent); padding-left: 14px; }
.note .lens strong { color: var(--accent); }

details { margin: 12px 0; }
summary { cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 30px; color: var(--ink); list-style-position: outside; }
details[open] summary { margin-bottom: 14px; }
details p { margin: 8px 0; }
.readbar { position: sticky; bottom: 0; z-index: 2; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.readbar .btn { width: min(100%, 380px); }
.readbar .done { margin: 0; font-weight: 700; color: var(--accent); font-size: 18px; }
.readbar .error { margin: 0; font-size: 15px; }

/* Just the picture */
.sheet.zen .reading, .sheet.zen .readbar, .sheet.zen .credit, .sheet.zen #btn-zen { display: none; }
.sheet.zen .photo { height: 100svh; }
.sheet.zen .title { padding-bottom: 56px; }
.sheet.zen .title .where { display: block; }

/* Month */
.sheet.plain .reading { padding-top: 0; }
.nav { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin: 4px 0 12px; }
.nav h2 { margin: 0; font-size: 28px; flex: 1; text-align: center; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar .dow { text-align: center; font-weight: 700; color: var(--muted); font-size: 14px; }
.calendar .day { aspect-ratio: 1; display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center; border-radius: 12px; font-size: 18px; padding: 0; min-height: 44px; border: 1px solid var(--line); background: var(--glass-strong); }
.calendar button.day { font-weight: 700; }
.calendar span.day { color: #b5b8b3; border-color: transparent; background: transparent; }
.calendar .day.istoday { outline: 3px solid var(--today); }
.calendar .day.current { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.calendar .dots { display: flex; gap: 3px; height: 8px; }
.calendar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.calendar .day.current .dot { background: #fff; }

@media (max-width: 720px) {
  .hero { min-height: 82svh; }
  .greet { padding-bottom: 68px; }
  .today { margin-top: -40px; padding: 18px 18px 14px; border-radius: 20px; }
  .today h2 { font-size: 26px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today .actions .btn { flex: 1; text-align: center; }
  .pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .tile, .sheet .photo { transition: none; } }
.fold-btn { font-family: var(--body); font-size: 17px; }
.fold-body { margin-top: 18px; }
