@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --pine: #123b30;
  --pine-deep: #0c2a22;
  --pine-soft: #1d5545;
  --paper: #fffdf6;
  --paper-shade: #efeadb;
  --ink: #1a2b25;
  --ink-soft: #52635c;
  --on-pine: #f4f6ee;
  --on-pine-soft: #b9cfc5;
  --gold: #e9b44c;
  --cranberry: #a81e3c;
  --display: "Bricolage", "Trebuchet MS", sans-serif;
  --body: "Figtree", "Verdana", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--pine);
  color: var(--on-pine);
  font: 400 1.0625rem/1.5 var(--body);
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tag :focus-visible, dialog :focus-visible { outline-color: var(--cranberry); }

/* Buttons */
.btn {
  min-height: 44px;
  padding: .5rem 1rem;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  font-weight: 700;
  cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--cranberry); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #8e1731; }
.btn-gold { background: var(--gold); color: var(--pine-deep); }
.btn-gold:hover:not(:disabled) { background: #f2c566; }
.btn-line { border-color: var(--ink); color: var(--ink); }
.btn-line:hover:not(:disabled) { background: var(--paper-shade); }
.btn-quiet { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; padding-inline: .25rem; font-weight: 400; }
.btn-quiet:hover { color: var(--ink); }
.btn-on-pine { color: var(--on-pine); text-decoration: underline; text-underline-offset: 3px; font-weight: 400; padding-inline: .25rem; }

/* Top */
.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--pine-deep);
  padding-top: env(safe-area-inset-top);
}
.top-row {
  max-width: 1200px; margin: 0 auto;
  padding: .5rem 1rem 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { font: 800 1.15rem/1 var(--display); }
.tabs {
  max-width: 1200px; margin: 0 auto;
  display: flex; gap: .35rem;
  padding: .5rem 1rem .75rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; min-height: 40px;
  padding: .3rem .85rem;
  border: 1px solid var(--pine-soft); border-radius: 999px;
  background: none; color: var(--on-pine);
  cursor: pointer; white-space: nowrap;
}
.tab:hover { border-color: var(--on-pine-soft); }
.tab[aria-current="page"] { background: var(--gold); border-color: var(--gold); color: var(--pine-deep); font-weight: 700; }
.tab-split { margin-left: .5rem; }

main { max-width: 1200px; margin: 0 auto; padding: 1.75rem 1rem 6rem; }
.view-head { margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; justify-content: space-between; }
.view-title { font: 800 clamp(2.1rem, 8vw, 3.75rem)/1.02 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.view-sub { margin-top: .5rem; color: var(--on-pine-soft); max-width: 60ch; }
.group-title { font: 700 1.5rem/1.2 var(--display); margin: 2rem 0 1rem; }
.group-title:first-of-type { margin-top: 0; }
.empty { padding: 2.5rem 0; color: var(--on-pine-soft); max-width: 50ch; }
.empty strong { display: block; color: var(--on-pine); font: 700 1.35rem/1.2 var(--display); margin-bottom: .35rem; }

/* Gift tags */
.tags { columns: 3 320px; column-gap: 1.25rem; }
.tag-wrap {
  break-inside: avoid;
  padding-top: 1.5rem; margin-bottom: 1.25rem;
  position: relative;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .28));
}
.tag-wrap::before { /* string */
  content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 2.25rem;
  background: var(--gold); transform: rotate(4deg); transform-origin: top; z-index: 1;
}
.tag {
  position: relative;
  background: var(--paper); color: var(--ink);
  padding: 2.1rem 1.15rem 1.1rem;
  clip-path: polygon(26px 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%, 0 26px);
  overflow: hidden;
}
.tag::before { /* punched hole */
  content: ""; position: absolute; left: 50%; top: .55rem;
  width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--pine); box-shadow: 0 0 0 2px var(--gold);
}
.tag-heart { box-shadow: inset 0 -6px 0 var(--gold); }
.prio { font-size: .9rem; color: var(--ink-soft); margin-bottom: .2rem; }
.tag-heart .prio { color: #7c5306; font-weight: 700; }
.tag-title { font: 700 1.3rem/1.2 var(--display); overflow-wrap: anywhere; }
.tag-note { margin-top: .5rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.tag-price { margin-top: .5rem; font-weight: 700; }
.tag-link {
  display: inline-block; margin-top: .5rem; padding: .35rem 0;
  color: var(--cranberry); font-weight: 700; overflow-wrap: anywhere;
}
.idea {
  margin: 0 0 .6rem; padding: .35rem .6rem;
  background: var(--pine); color: var(--on-pine);
  font-size: .9rem; border-radius: 4px;
}
.photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .4rem; margin-top: .75rem; }
.photo { padding: 0; border: 0; background: var(--paper-shade); cursor: zoom-in; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 3px; }
.photos.single .photo { aspect-ratio: 16 / 11; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.status { margin-top: .9rem; padding-top: .75rem; border-top: 2px dashed var(--paper-shade); }
.tag-actions { display: flex; flex-wrap: wrap; gap: .4rem .75rem; align-items: center; margin-top: .85rem; }
.status .tag-actions { margin-top: .6rem; }
.stamp {
  display: inline-block; max-width: 100%;
  padding: .25rem .6rem;
  border: 3px double var(--cranberry); border-radius: 4px;
  color: var(--cranberry);
  font: 800 1.05rem/1.2 var(--display);
  transform: rotate(-2.5deg);
  overflow-wrap: anywhere;
}
.stamp-new { animation: stamp .32s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes stamp { from { transform: rotate(-9deg) scale(1.7); opacity: 0; } to { transform: rotate(-2.5deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .stamp-new { animation: none; } }
.claim-notes { list-style: none; margin: .55rem 0 0; padding: 0; font-size: .95rem; }
.claim-notes li { overflow-wrap: anywhere; }
.claim-notes b { font-weight: 700; }
.note-field { margin-top: .6rem; }
.note-field label { display: block; font-size: .9rem; color: var(--ink-soft); margin-bottom: .15rem; }
.gone {
  margin-bottom: .75rem; padding: .5rem .65rem;
  background: var(--cranberry); color: #fff; border-radius: 4px; font-size: .95rem;
}
.is-gone .tag-title, .is-gone .tag-note { text-decoration: line-through; text-decoration-thickness: 1px; }

/* Forms */
.field { margin-bottom: 1rem; }
.field > label, .field > legend, .label { display: block; font-weight: 700; margin-bottom: .25rem; padding: 0; }
.hint { font-size: .9rem; color: var(--ink-soft); margin-top: .2rem; }
input[type=text], input[type=password], input[type=url], input[type=search], textarea {
  width: 100%; min-height: 44px;
  padding: .5rem .65rem;
  background: #fff; color: var(--ink);
  border: 2px solid #8b9a93; border-radius: 6px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--cranberry); outline: none; }
fieldset { border: 0; margin: 0 0 1rem; padding: 0; }
.radio { display: flex; gap: .5rem; align-items: center; min-height: 36px; cursor: pointer; }
.radio input { width: 20px; height: 20px; accent-color: var(--cranberry); margin: 0; flex: none; }
.form-error { background: #fbe4e8; color: #7a1029; padding: .55rem .7rem; border-radius: 6px; margin-bottom: 1rem; }
.field > .file-btn { display: inline-flex; align-items: center; margin-bottom: 0; padding: .5rem 1rem; cursor: pointer; }
.file-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-btn:focus-within { outline: 3px solid var(--cranberry); outline-offset: 2px; }
.thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.thumb { position: relative; width: 84px; height: 84px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; display: block; }
.thumb button {
  position: absolute; top: -8px; right: -8px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: var(--ink); color: #fff; font-weight: 700; cursor: pointer;
}

/* Dialog */
dialog {
  width: min(560px, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  border: 0; border-radius: 10px; padding: 1.25rem;
  background: var(--paper); color: var(--ink);
  overflow-y: auto;
}
dialog::backdrop { background: rgba(6, 22, 17, .72); }
dialog h2 { font: 800 1.6rem/1.15 var(--display); margin-bottom: 1rem; overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
dialog.lightbox { width: auto; max-width: calc(100vw - 1rem); padding: .5rem; background: var(--pine-deep); }
.lightbox img { display: block; max-width: 100%; max-height: calc(100dvh - 6rem); margin: 0 auto; }
.lightbox .dialog-actions .btn { color: var(--on-pine); }

/* Sign-in */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-box { width: 100%; max-width: 440px; }
.auth-title { font: 800 clamp(3rem, 15vw, 4.75rem)/.95 var(--display); letter-spacing: -.03em; margin-bottom: .75rem; text-align: center; }
.auth-sub { text-align: center; color: var(--on-pine-soft); margin-bottom: 1rem; }
.auth .tag { padding-top: 2.4rem; }
.auth-switch { display: flex; gap: .25rem; margin-bottom: 1.1rem; }
.auth-switch button { flex: 1; min-height: 44px; background: none; border: 0; border-bottom: 3px solid var(--paper-shade); color: var(--ink-soft); cursor: pointer; }
.auth-switch button[aria-pressed=true] { border-color: var(--cranberry); color: var(--ink); font-weight: 700; }
.auth .btn-primary { width: 100%; }

.notice { max-width: 560px; margin: 15vh auto; padding: 0 1rem; }
.notice h1 { font: 800 2.25rem/1.1 var(--display); margin-bottom: .75rem; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 20;
  max-width: calc(100vw - 2rem); width: max-content;
  background: var(--gold); color: var(--pine-deep);
  padding: .55rem 1rem; border-radius: 8px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
#toast.show { opacity: 1; }
#toast.bad { background: #fbe4e8; color: #7a1029; }

/* Demo band */
.demo-band { background: var(--gold); color: var(--pine-deep); padding: .45rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-size: .95rem; }
.demo-band button { min-height: 34px; padding: .1rem .7rem; border: 2px solid var(--pine-deep); background: none; color: var(--pine-deep); border-radius: 999px; cursor: pointer; }
.demo-band button[aria-pressed=true] { background: var(--pine-deep); color: var(--gold); font-weight: 700; }

@media (max-width: 480px) {
  .view-head .btn { width: 100%; }
}
