:root {
  /* Aurium — a soft neutral ground, with the golds kept for the accents.
     The splash keeps its own warm ivory: that is the brand moment. */
  --bg-a: #fafaf9;
  --bg-b: #f1f1ef;
  --surface: #f4f4f2;
  --surface-2: #eaeae7;
  --line: #e2e2de;
  --text: #38383a;
  --muted: #6b6b65;

  --splash-a: #fffdf6;
  --splash-b: #faeed4;

  /* The spectrum, palest to deepest — the ring reads left to right along it. */
  --gold-champagne: #fbe7bc;
  --gold-honey: #f7d488;
  --gold-amber: #f0be55;
  --gold-deep: #e0a73a;

  --ink-line: #241d12;
  --ink-gold: #5c3f0a;
  --ink-gold-soft: #6a4a0c;

  --font-script: "Borel", "Snell Roundhand", "Apple Chancery", "Segoe Script", cursive;
  --font-round: "Quicksand", "Trebuchet MS", "Avenir Next Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius: 20px;
  --shadow-card: 0 4px 16px rgba(56, 56, 58, .09);
  --shadow-soft: 0 10px 26px rgba(56, 56, 58, .16);

  --pad: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

body {
  margin: 0;
  background: linear-gradient(165deg, var(--bg-a) 0%, var(--bg-b) 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 500 16px/1.45 var(--font-round);
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
[hidden] { display: none !important; }

/* ── Screens ───────────────────────────────────────────────────────────── */
.screen {
  min-height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) var(--pad) calc(var(--safe-b) + 18px);
  display: flex;
  flex-direction: column;
}
/* Keep the home screen's furniture clear of the wave band. */
.screen--home { padding-bottom: calc(var(--safe-b) + 10vh + 16px); }

.screen--list {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: linear-gradient(165deg, var(--bg-a) 0%, var(--bg-b) 100%);
  overflow-y: auto;
}

.topbar { display: flex; align-items: center; gap: 10px; }
.topbar--sheet { align-items: center; }
.topbar__title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: .2px; }

.brand { min-width: 0; }
.brand__name {
  margin: 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 30px;
  /* background-clip: text paints only inside the background box, so the line
     box has to clear Borel's tall dots — anything outside it renders
     transparent. Negative margins live outside that box, so they pull the
     layout tight without cropping the glyphs. */
  line-height: 1.6;
  letter-spacing: .2px;
  margin-top: -12px;
  margin-bottom: -13px;
  background: linear-gradient(100deg, #a86f14 0%, #d59b23 30%, #eecb6b 50%, #c58a15 70%, #96620f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Older engines that ignore background-clip still get gold, not nothing. */
  -webkit-text-fill-color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand__name { color: #b8791a; -webkit-text-fill-color: currentColor; background: none; }
}
.brand__tagline {
  margin: 2px 0 0;
  font-family: var(--font-round);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.topbar__date { margin: 0 0 0 auto; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.icon-btn svg { width: 20px; height: 20px; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero { margin: auto 0; padding: 28px 0; }
.hero__prompt { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.2px; }
.hero__hint { margin: 8px 0 0; color: var(--muted); }
.hero__plus {
  display: inline-grid;
  place-items: center;
  width: 21px; height: 21px;
  margin: 0 1px;
  border-radius: 50%;
  background: var(--gold-deep);
  color: var(--ink-gold);
  font-weight: 700;
  line-height: 1;
  vertical-align: -4px;
}

/* ── The plus, and its four actions in a ring ──────────────────────────── */
.fab {
  position: relative;
  /* Only lifts above the backdrop while the ring is out; otherwise it would
     also ride over the list screen. */
  z-index: 1;
  display: grid;
  place-items: center;
  height: 84px;
  margin-bottom: 22px;
}

.fab.is-open { z-index: 9; }

.plus {
  position: relative;
  z-index: 2;
  width: 76px; height: 76px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--gold-honey), var(--gold-deep));
  color: var(--ink-gold);
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease;
}
.plus svg { width: 34px; height: 34px; transition: transform .28s cubic-bezier(.34, 1.4, .5, 1); }
.plus:active { transform: scale(.94); }
.fab.is-open .plus svg { transform: rotate(135deg); }

/* Origin of the ring: the middle of the plus. */
.radial {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 0; height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.petal {
  position: absolute;
  left: 0; top: 0;
  width: 58px;
  display: flex;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.35);
  transition: transform .26s cubic-bezier(.34, 1.35, .5, 1), opacity .18s ease, visibility .26s;
}
/* Four seats on the upper half of a 122px circle: 160°, 115°, 65°, 20°. */
.petal:nth-child(1) { --x: -115px; --y:  -42px; }
.petal:nth-child(2) { --x:  -52px; --y: -111px; }
.petal:nth-child(3) { --x:   52px; --y: -111px; }
.petal:nth-child(4) { --x:  115px; --y:  -42px; }

.fab.is-open .petal {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1);
}
.fab.is-open .petal:nth-child(1) { transition-delay: .02s }
.fab.is-open .petal:nth-child(2) { transition-delay: .06s }
.fab.is-open .petal:nth-child(3) { transition-delay: .10s }
.fab.is-open .petal:nth-child(4) { transition-delay: .14s }

.petal__btn {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.petal__btn svg { width: 25px; height: 25px; }
.petal__btn:active { transform: scale(.92); }
.petal__label {
  position: absolute;
  top: 100%;
  left: -14px; right: -14px;
  margin-top: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff8e7;
  text-shadow: 0 1px 4px rgba(74, 50, 8, .55);
}

.petal--camera .petal__btn { background: var(--gold-deep); color: var(--ink-gold); }
.petal--mic    .petal__btn { background: var(--gold-honey);  color: var(--ink-gold); }
.petal--upload .petal__btn { background: var(--gold-amber); color: var(--ink-gold-soft); }
.petal--text   .petal__btn { background: var(--gold-champagne);  color: var(--ink-gold-soft); }

@media (prefers-reduced-motion: reduce) {
  .petal, .plus, .plus svg { transition: none; }
  .fab.is-open .petal { transition-delay: 0s; }
}

/* ── The list button ───────────────────────────────────────────────────── */
.entries-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-card);
}
.entries-btn:active { transform: translateY(2px); }
.entries-btn__icon { display: grid; place-items: center; color: var(--muted); }
.entries-btn__icon svg { width: 22px; height: 22px; }
.entries-btn__label { font-weight: 600; }
.entries-btn__count {
  margin-left: auto;
  min-width: 28px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--gold-honey);
  color: var(--ink-gold-soft);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

/* ── Filters ───────────────────────────────────────────────────────────── */
.filters {
  display: flex;
  gap: 8px;
  margin: 18px 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line);
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-card);
}
.chip.is-on { background: var(--gold-deep); border-color: transparent; color: var(--ink-gold); }

/* ── Entries ───────────────────────────────────────────────────────────── */
.entries { list-style: none; margin: 0; padding: 0 0 8px; display: grid; gap: 10px; }
.entry {
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.entry__icon {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 18px;
}
.entry--camera .entry__icon { background: var(--gold-deep); }
.entry--mic    .entry__icon { background: var(--gold-honey); }
.entry--upload .entry__icon { background: var(--gold-amber); }
.entry--text   .entry__icon { background: var(--gold-champagne); }
.entry__body { min-width: 0; }
.entry__title {
  margin: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entry__meta { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ── Sheets ────────────────────────────────────────────────────────────── */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(56, 56, 58, .34);
  backdrop-filter: blur(2px);
}
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9;
  padding: 10px var(--pad) calc(var(--safe-b) + 20px);
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  animation: rise .22s ease;
}
@keyframes rise { from { transform: translateY(16px); opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none } }

.sheet__grip {
  width: 42px; height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: var(--line);
}
.sheet__title { margin: 0 0 14px; font-size: 18px; }
.sheet__meta { margin: 0 0 14px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }

.viewfinder {
  position: relative;
  height: 190px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--muted);
}
.viewfinder__frame {
  position: absolute;
  inset: 16px;
  border: 2px dashed var(--line);
  border-radius: 12px;
}
.viewfinder__note { font-size: 13px; }

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  height: 150px;
  margin-bottom: 14px;
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}
.dropzone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone__icon svg { width: 30px; height: 30px; }
.dropzone__note { padding: 0 18px; font-size: 13px; }
.dropzone:focus-within { outline: 2px solid var(--gold-deep); outline-offset: 1px; }

.wave { display: flex; align-items: center; justify-content: center; gap: 5px; height: 84px; margin-bottom: 10px; }
.wave i {
  width: 5px;
  border-radius: 999px;
  background: var(--gold-honey);
  animation: pulse 1s ease-in-out infinite;
}
.wave i:nth-child(odd)  { height: 46px; }
.wave i:nth-child(even) { height: 26px; }
.wave i:nth-child(2)  { animation-delay: .08s }
.wave i:nth-child(3)  { animation-delay: .16s }
.wave i:nth-child(4)  { animation-delay: .24s }
.wave i:nth-child(5)  { animation-delay: .32s }
.wave i:nth-child(6)  { animation-delay: .40s }
.wave i:nth-child(7)  { animation-delay: .48s }
.wave i:nth-child(8)  { animation-delay: .56s }
.wave i:nth-child(9)  { animation-delay: .64s }
@keyframes pulse { 50% { transform: scaleY(.42) } }
@media (prefers-reduced-motion: reduce) { .wave i { animation: none } }

.field {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.field--area { resize: none; }
.field:focus { outline: 2px solid var(--gold-deep); outline-offset: 1px; }

.primary {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  background: var(--gold-deep);
  color: var(--ink-gold);
  font-weight: 700;
}
.primary:active { transform: translateY(2px); }

/* ── Splash ────────────────────────────────────────────────────────────── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(165deg, var(--splash-a) 0%, var(--splash-b) 100%);
  transition: opacity .45s ease;
}
.splash.is-gone { opacity: 0; pointer-events: none; }

.splash__name {
  margin: 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 46px;
  line-height: 1.55;
  margin-bottom: -10px;
  background: linear-gradient(100deg, #a86f14, #d59b23 30%, #eecb6b 50%, #c58a15 70%, #96620f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .splash__name { color: #b8791a; -webkit-text-fill-color: currentColor; background: none; }
}
.splash__tagline {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

/* The sunflower: heavy ink outlines and flat gold fills, after the logo. */
.bloom {
  width: min(46vw, 200px);
  height: auto;
  margin-bottom: 10px;
  animation: bloom-in .5s cubic-bezier(.34, 1.4, .5, 1) both;
}
.bloom__head {
  transform-box: view-box;
  transform-origin: 100px 100px;
  animation: turn 12s linear infinite;
}
.bloom__petal {
  fill: var(--gold-honey);
  stroke: var(--ink-line);
  stroke-width: 5;
  stroke-linejoin: round;
}
.bloom__petal:nth-of-type(even) { fill: var(--gold-amber); }
.bloom__core {
  fill: var(--gold-deep);
  stroke: var(--ink-line);
  stroke-width: 5;
}
.bloom__seed { fill: var(--ink-line); }

@keyframes bloom-in { from { transform: scale(.55); opacity: 0 } }
@keyframes turn { to { transform: rotate(360deg) } }

/* ── The wave field ────────────────────────────────────────────────────── */
.wave-field {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 10vh;
  min-height: 62px;
  /* Above the splash as well, so the band never blinks between screens. */
  z-index: 21;
  pointer-events: none;
  overflow: hidden;
  transition: opacity .25s ease;
}
.wave-field svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The list screen wants a quiet backdrop. */
body.is-listing .wave-field { opacity: 0; }

.wave {
  /* Each path runs eight half-periods wide, so a 600-unit shift loops. */
  animation: drift 11s linear infinite;
}
.wave--back  { fill: var(--gold-honey); opacity: .30; }
.wave--mid   { fill: var(--gold-amber); opacity: .26; animation-duration: 8s; animation-direction: reverse; }
.wave--front { fill: var(--gold-deep);  opacity: .22; animation-duration: 15s; }

@keyframes drift { to { transform: translateX(-600px) } }

@media (prefers-reduced-motion: reduce) {
  .bloom, .bloom__head, .wave { animation: none; }
}
