/* Hallmark · shape: app screen · theme: custom · idea: an embossed family note opens the wedding album · nav: glass dock with gold Add · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S4 R5 V4 · give the family note the strongest contrast and let the gallery carry the photos */
:root {
  color-scheme: light;
  --paper: #fffaf5;
  --surface: #fffdf9;
  --canvas: #f0e2dc;
  --ink: #351d23;
  --muted: #6b5157;
  --wine: #78182a;
  --deep: #501523;
  --gold: #efbe67;
  --gold-light: #ffe4a8;
  --gold-shade: #d8a148;
  --trim: #995e23;
  --cream: #fff3da;
  --blush: #f9e3df;
  --blush-edge: #f3cdc3;
  --petal: #e7afbc;
  --rule: #decac3;
  --shadow: #50152321;
  --shadow-heavy: #351d235c;
  --glass: #fffaf5d9;
  --glass-edge: #ffffffeb;
  --glass-selected: #78182a14;
  --note-rule: #e8ae4875;
  --note-muted: #f7ddd4;
  --note-tint: #fff3da1a;
  --success: #265a43;
  --focus: #8d2546;
  --font: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --display: "Snell Roundhand", "Apple Chancery", Georgia, serif;
  --serif: Georgia, serif;
  --app-width: 520px;
  --dock-height: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 16px/1.5 var(--font); }
a { color: var(--wine); text-underline-offset: .17em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled { cursor: not-allowed; background: var(--blush); color: var(--muted); }
.button:not(:disabled):active, .icon-button:not(:disabled):active, .tabs a:active { background: var(--blush); }
button, a, input, select, textarea, summary { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { min-width: 0; overflow-wrap: break-word; line-height: 1.16; }
h1 { font-size: clamp(30px, 8vw, 42px); text-wrap: balance; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.app {
  position: relative;
  isolation: isolate;
  max-width: var(--app-width);
  min-height: 100dvh;
  margin-inline: auto;
  background: var(--paper);
  box-shadow: 0 8px 40px var(--shadow);
}
.app[data-background="blush"] { background: radial-gradient(ellipse at 50% 12%, var(--paper), var(--blush-edge)); }
.app[data-background="petal"] {
  background: radial-gradient(ellipse at 100% 0%, var(--petal), transparent 49%),
    radial-gradient(ellipse at 0% 100%, var(--blush-edge), var(--paper) 69%);
}
#screen {
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 20px calc(var(--dock-height) + 52px + var(--safe-bottom));
}
#screen[data-screen="host"], #screen[data-screen="upload"] { padding-bottom: max(24px, var(--safe-bottom)); }

.home-heading h1 {
  margin: 16px 0 20px;
  color: var(--wine);
  font: 400 clamp(35px, 10.1vw, 49px)/1.16 var(--display);
}
.brand { min-width: 0; color: var(--wine); font-weight: 720; overflow-wrap: anywhere; }
.wedding-date { max-width: 65%; color: var(--muted); font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.home-widgets { display: grid; gap: 28px; }
.announcement {
  background: radial-gradient(ellipse at 100% 0%, var(--wine), transparent 72%), var(--deep);
  color: var(--cream);
  padding: 20px;
  border: 1px solid var(--deep);
  border-radius: 24px;
  box-shadow: 0 8px 20px var(--shadow);
}
.announcement-top { margin-bottom: 16px; }
.announcement-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: var(--gold-light);
  border: 1px solid var(--note-rule);
  background: var(--note-tint);
}
.announcement h2 { font: 400 28px/1.16 var(--serif); }
.announcement p { margin-top: 8px; overflow-wrap: anywhere; white-space: pre-line; color: var(--note-muted); }
.announcement footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--note-rule); color: var(--note-muted); font-size: 13px; }
.announcement .announcement-status { background: var(--note-tint); color: var(--cream); border: 1px solid var(--note-rule); }
.app[data-widget="gold"] .announcement {
  background: linear-gradient(145deg, var(--surface), var(--blush));
  border: 3px double var(--trim);
  color: var(--wine);
  text-align: center;
}
.app[data-widget="gold"] .announcement :is(p, footer, .announcement-status, .announcement-icon) { color: var(--deep); border-color: var(--trim); }
.latest-heading a { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; font-size: 14px; white-space: nowrap; }
.latest-heading a .icon { width: 16px; height: 16px; }
.gallery-add { align-self: start; }

.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.spread { justify-content: space-between; }
.stack { display: grid; align-content: start; gap: 16px; min-width: 0; }
.muted { color: var(--muted); }
.screen-head { margin-bottom: 16px; }
.screen-head h1 { margin-block: 4px; }
.button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--rule);
  border-radius: 15px;
  padding: 8px 16px;
  background: var(--surface);
  color: var(--wine);
  font-weight: 650;
  text-decoration: none;
  text-align: center;
}
.icon-button { padding: 8px; }
.button.primary { border-color: var(--wine); background: var(--wine); color: var(--surface); }
.button.danger { border-color: var(--wine); color: var(--wine); }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.field { display: grid; gap: 4px; font-weight: 600; }
input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]), textarea, select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--rule);
  border-radius: 11px;
  padding: 8px 12px;
  background: var(--surface);
  font-size: 16px;
}
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"], progress { accent-color: var(--wine); }
.empty { padding: 20px; border: 1px solid var(--rule); border-radius: 18px; background: var(--surface); }
.empty h2 { font-size: 18px; }
.empty .button { justify-self: start; }
.status { display: inline-block; padding: 4px 8px; border-radius: 20px; background: var(--blush); color: var(--deep); font-size: 12px; }
.segmented { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
.segmented > * {
  display: grid;
  place-items: center;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 4px;
  background: transparent;
  color: var(--wine);
  text-align: center;
  text-decoration: none;
}
.segmented :is([aria-selected="true"], [aria-pressed="true"], [aria-current]) { background: var(--blush); font-weight: 700; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.photo-tile {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  overflow: clip;
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: var(--blush);
  color: var(--wine);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile > span { position: absolute; inset: auto auto 6px 6px; border-radius: 9px; padding: 4px 8px; background: var(--surface); font-size: 12px; }
.cover { display: block; overflow: clip; aspect-ratio: 16 / 9; border-radius: 19px; background: var(--blush); }
.cover img { width: 100%; height: 100%; object-fit: cover; }

.tabs {
  position: fixed;
  z-index: 4;
  inset: auto 0 max(12px, var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  width: min(calc(100% - 24px), calc(var(--app-width) - 24px));
  min-height: var(--dock-height);
  margin-inline: auto;
  padding: 8px;
  border: 1px solid var(--glass-edge);
  border-radius: 36px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--rule), 0 8px 26px var(--shadow), inset 0 2px 0 var(--glass-edge);
}
@supports (backdrop-filter: blur(1px)) {
  .tabs { background: var(--glass); backdrop-filter: blur(22px) saturate(155%); }
}
.tabs a {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 4px;
  min-height: 52px;
  padding: 4px 0;
  border-radius: 27px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
  text-decoration: none;
  text-align: center;
}
.tabs a[aria-current="page"] { color: var(--wine); background: var(--glass-selected); font-weight: 700; }
.tabs .add-tab { color: var(--deep); font-weight: 700; }
.add-tab .tab-icon {
  position: absolute;
  top: -19px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--trim);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 20%, var(--gold-light), var(--gold) 61%, var(--gold-shade));
  box-shadow: 0 0 0 3px var(--glass), 0 5px 12px var(--shadow-heavy);
}
.add-tab .icon { width: 24px; height: 24px; }
.sheet {
  inset: auto 0 0;
  width: min(100%, var(--app-width));
  max-width: 100%;
  max-height: min(88dvh, 760px);
  margin: 0 auto;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  color: var(--ink);
}
.sheet::backdrop { background: var(--shadow-heavy); }
.sheet-inner { display: grid; gap: 16px; padding: 20px 20px max(24px, var(--safe-bottom)); }
.toast:not(:empty) {
  position: fixed;
  z-index: 6;
  inset: auto 0 calc(var(--dock-height) + var(--safe-bottom) + 25px);
  width: fit-content;
  max-width: min(calc(100% - 40px), var(--app-width));
  margin-inline: auto;
  border-radius: 20px;
  padding: 8px 16px;
  background: var(--deep);
  color: var(--cream);
  font-size: 14px;
}
.loading { padding-block: 44px; color: var(--muted); }
@media (max-width: 360px) {
  #screen { padding-inline: 16px; }
  .announcement { padding: 16px; }
}
@media (max-height: 740px) {
  #screen[data-screen="home"] { padding-top: max(16px, env(safe-area-inset-top)); }
  .home-heading h1 { margin-block: 8px 12px; }
  .home-widgets { gap: 16px; }
  .announcement { padding: 16px; }
  .announcement-top { margin-bottom: 8px; }
  .announcement h2 { font-size: 24px; }
  .announcement footer { margin-top: 12px; padding-top: 8px; }
  .latest { gap: 8px; }
  .latest .empty { gap: 4px; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
