@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f3e6d4;
  --paper: #fffaf4;
  --ink: #2a160f;
  --muted: #7c6458;
  --line: #eadccb;
  --tomato: #d24b2c;
  --tomato-dark: #a33a22;
  --olive: #5f7344;
  --gold: #e0a15a;
  --cream: #fff6ea;
  --heart: #e1262d;
  --shadow: 0 12px 32px rgba(80, 36, 12, 0.08);
  --radius: 22px;
  --font: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #1b1411;
  --paper: #2a1e18;
  --ink: #f6ece4;
  --muted: #cbb5a6;
  --line: #433229;
  --tomato: #e36a4c;
  --tomato-dark: #ffb29f;
  --olive: #b7cc8d;
  --gold: #e0a15a;
  --cream: #3a2a22;
  --heart: #ff5d66;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at -10% -10%, rgba(224, 161, 90, 0.45), transparent 55%),
    radial-gradient(700px 380px at 110% 0%, rgba(210, 75, 44, 0.16), transparent 50%),
    var(--bg);
  line-height: 1.45;
}
body.has-nav { padding-bottom: 84px; }
img { max-width: 100%; display: block; }
a { color: var(--tomato-dark); }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.4rem;
}
h1 { font-size: clamp(2.2rem, 8vw, 4.4rem); }
p { margin: 0 0 0.7rem; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
  position: sticky;
  top: 0;
  z-index: 15;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}
.brand-short { display: none; }
.mark { display: flex; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn, .heart, .comment-link, .text-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff6ea, #e0a15a 45%, #d24b2c);
  box-shadow: inset -4px -2px 0 #2a160f;
}
[data-theme="dark"] .theme-icon {
  background: #f6ece4;
  box-shadow: none;
}
.badge-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 600;
}
.badge-count {
  display: inline-flex;
  min-width: 1.3rem;
  height: 1.3rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--tomato);
  color: white;
  font-size: 0.75rem;
  padding: 0 5px;
}
.who-mini { display: flex; text-decoration: none; }

.shell { width: min(680px, calc(100% - 24px)); margin: 0 auto 28px; }
.shell-wide { width: min(1080px, calc(100% - 28px)); }
.landing-grid { display: grid; gap: 8px; }
.hero { padding: 18px 0 8px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--tomato);
  margin-bottom: 8px;
}
.lede { font-size: 1.08rem; max-width: 40rem; color: var(--ink); }
.lede-tight { color: var(--muted); font-size: 1rem; }
.cta-row, .row-actions, .avatar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.points {
  list-style: none;
  padding: 0;
  margin: 22px 0;
  display: grid;
  gap: 12px;
}
.points li, .panel, .empty, .gate {
  background: var(--paper);
  border: 1px solid rgba(90, 50, 20, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.points h2 { font-size: 1.4rem; }
.section-head { margin: 18px 0 12px; }
.section-head h1, .section-head h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.section-head p, .muted, .hint, .form-note, .footer-note { color: var(--muted); }
.footer-note { margin-top: 18px; font-size: 0.92rem; }

.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(90, 50, 20, 0.06);
  margin: 0 0 16px;
  overflow: hidden;
}
.card-top, .card-actions, .caption, .recipe, .x-embed { padding: 12px 14px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; }
.who { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; min-width: 0; }
.who strong, .by { font-weight: 650; }
.who time, .comment-meta time { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.stamp {
  flex: none;
  font-family: var(--display);
  border: 1.5px dashed var(--tomato);
  color: var(--tomato);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  transform: rotate(-2deg);
}
.frame { background: #1c120e; }
.scroller {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller img {
  scroll-snap-align: center;
  min-width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #2a1c16;
}
.card-actions { display: flex; align-items: center; gap: 14px; padding-bottom: 0; }
.like-form, .heart-link, .heart.is-locked, .comment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 650;
}
.heart svg, .comment-link svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.heart.is-on { color: var(--heart); }
.heart.is-on svg { fill: currentColor; }
.heart.pop { animation: pop 0.28s ease; }
.heart.is-locked { opacity: 0.55; }
@keyframes pop { 40% { transform: scale(1.28); } }
.caption p:last-child { margin-bottom: 0; }
.by { margin-right: 6px; text-decoration: none; color: inherit; }
.hash { text-decoration: none; font-weight: 650; }
.x-by span { color: var(--muted); }
.x-embed { padding-top: 0; }
blockquote.twitter-tweet {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--cream);
}
.card.is-x.x-live .x-fallback { display: none; }
.recipe { border-top: 1px solid var(--line); }
.recipe summary { cursor: pointer; font-weight: 700; }
.recipe h3 { font-size: 1.05rem; margin-top: 10px; }
.recipe-copy { white-space: pre-wrap; }

.avatar, .avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #2a160f;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.85rem; }
.avatar-lg { width: 84px; height: 84px; font-size: 2rem; }
.tone-0 { background: #f0b27a; }
.tone-1 { background: #e7a39a; }
.tone-2 { background: #d7c4a3; }
.tone-3 { background: #c9d3a3; }
.tone-4 { background: #efc56d; }
.tone-5 { background: #e8b4c4; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-top: 1px solid var(--line);
  z-index: 16;
  backdrop-filter: blur(12px);
}
.nav-link {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  padding: 4px;
  border-radius: 12px;
}
.nav-link.is-on { color: var(--tomato); background: color-mix(in srgb, var(--tomato) 12%, transparent); }
.nav-new { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--tomato);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--tomato-dark); }
.btn-small { padding: 8px 12px; font-size: 0.92rem; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--cream); }
.btn-olive { background: var(--olive); color: white; }
.btn-olive:hover { filter: brightness(0.95); }
.btn-danger { background: transparent; color: var(--tomato); border: 1px solid var(--tomato); }
.btn-danger:hover { background: color-mix(in srgb, var(--tomato) 12%, transparent); }
.stack .btn { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 650; }
.field em { font-weight: 500; color: var(--muted); font-style: normal; }
input[type="text"], input[type="email"], input[type="password"], input[type="file"], input:not([type]), textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
}
textarea { resize: vertical; }
.stack { display: grid; gap: 12px; margin: 12px 0 20px; }
.alert {
  border-radius: 16px;
  padding: 12px 14px;
  margin: 8px 0 14px;
}
.alert p { margin: 0; }
.alert-error { background: #fde8e2; color: #6d2418; }
.alert-ok { background: #e7f0dc; color: #2d4318; }
[data-theme="dark"] .alert-error { background: #4a261f; color: #ffd2c8; }
[data-theme="dark"] .alert-ok { background: #2c3a22; color: #e4f2c8; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 650; }
.check input { width: auto; margin-top: 4px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.tabs a {
  flex: none;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.92rem;
}
.tabs a.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.people { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.person {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: var(--paper);
  border-radius: 18px;
  padding: 12px;
  border: 1px solid rgba(90, 50, 20, 0.06);
  box-shadow: var(--shadow);
}
.person > div:first-child { display: flex; gap: 10px; align-items: center; min-width: 0; }
.person p { margin: 0.15rem 0 0; }
.pill {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
  color: var(--muted);
  font-weight: 650;
}
.profile-head { display: flex; gap: 14px; align-items: center; margin: 8px 0 18px; }
.bio { white-space: pre-wrap; }
.panel { margin-bottom: 16px; }
.panel h2 { font-size: 1.5rem; }
.logout-form { margin-bottom: 12px; }

.comment-list, .comment-replies { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.comment { display: flex; gap: 8px; }
.comment-replies { margin-top: 8px; padding-left: 8px; border-left: 2px solid var(--line); }
.reply-form, .comment-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.reply-form input, .comment-form textarea { flex: 1; }
.comments-panel { margin-top: 8px; }
.text-btn { color: var(--muted); font-size: 0.85rem; padding: 0; }
.load-more, .end-mark { display: block; text-align: center; margin: 8px 0 20px; }
.load-more {
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px;
  font-weight: 700;
  color: var(--ink);
}

.drawer-root[hidden] { display: none; }
.drawer-root { position: fixed; inset: 0; z-index: 40; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(28, 16, 10, 0.48); }
.drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(82vh, 720px);
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.drawer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.drawer-bar h2 { font-size: 1.3rem; margin: 0; }
.drawer-body { overflow: auto; padding: 12px 14px 24px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 999px;
  z-index: 50;
  max-width: min(90vw, 420px);
}
.check-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.check-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ok { color: var(--olive); font-weight: 700; }
.bad { color: var(--tomato); font-weight: 700; }

@media (max-width: 420px) {
  .brand-full { display: none; }
  .brand-short { display: inline; }
  .badge-link { font-size: 0; padding: 6px; }
  .badge-link .badge-count { font-size: 0.75rem; }
}
@media (min-width: 800px) {
  body.has-nav { padding-bottom: 0; }
  .bottom-nav {
    position: sticky;
    top: 64px;
    bottom: auto;
    width: min(680px, calc(100% - 24px));
    margin: -8px auto 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    justify-content: space-between;
    padding: 6px;
  }
  .nav-link { flex-direction: row; justify-content: center; gap: 6px; font-size: 0.95rem; }
  .points { grid-template-columns: repeat(3, 1fr); }
  .landing-grid { grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.85fr); gap: 28px; align-items: start; }
  .landing-grid .points { grid-template-columns: 1fr; }
  .drawer {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 10vh;
    width: min(560px, calc(100% - 32px));
    transform: translateX(-50%);
    border-radius: 22px;
    max-height: 76vh;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
