@font-face {
  font-family: "Sara Blohm Hand";
  src: url("assets/fonts/SaraBlohmHand-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Blohm Sans";
  src: url("assets/fonts/Blohm-Sans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Blohm Sans";
  src: url("assets/fonts/Blohm-Sans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fffdf8;
  --bg-raised: #ffffff;
  --bg-card: #f4ecdc;
  --cream: #f4ecdc;
  --ink: #2a241c;
  --ink-soft: #3a342c;
  --gold: #d6b270;
  --gold-text: #8a6230;
  --muted: #5c564c;
  --line: rgba(42, 36, 28, 0.12);
  --line-strong: rgba(138, 98, 48, 0.45);
  --pink: #e73475;
  --shadow: 0 8px 24px rgba(42, 36, 28, 0.08);
  --font-hand: "Sara Blohm Hand", Palatino, "Palatino Linotype", serif;
  --font-sans: "Blohm Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --top: 52px;
  --tab: 68px;
  --pad: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overscroll-behavior: none;
}

img {
  max-width: 100%;
  display: block;
}

button, textarea, input {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  min-height: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--top);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wordmark {
  font-family: var(--font-hand);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  padding-top: 4px;
  white-space: nowrap;
}

.preview-tag {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 7px 2px;
  border-radius: 2px;
  flex-shrink: 0;
}

main {
  flex: 1;
  padding: 0 var(--pad) calc(var(--tab) + var(--safe-bottom) + 16px);
  min-height: 0;
}

.view { display: none; }
.view.is-active { display: block; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin: 14px 0 14px;
}

.page-title {
  font-family: var(--font-hand);
  font-size: 36px;
  line-height: 1;
  color: var(--ink);
  margin: 14px 0 8px;
  font-weight: 400;
}

.lead {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 0 0 22px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Home: this week's card */
.prompt-card {
  position: relative;
  background: var(--bg-card);
  margin: 0 calc(var(--pad) * -1);
  padding: 18px var(--pad) 12px;
}

.prompt-kicker {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.prompt-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  min-width: 0;
}

.prompt-num {
  font-family: var(--font-hand);
  font-size: 44px;
  line-height: 0.85;
  color: var(--gold-text);
  flex-shrink: 0;
  padding-top: 2px;
}

.prompt-title {
  font-family: var(--font-hand);
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  padding-top: 6px;
  white-space: nowrap;
}

.prompt-body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 16px;
}

.prompt-question {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.28;
  color: var(--gold-text);
  margin: 0 0 16px;
}

.painting {
  position: relative;
  margin: 0 calc(var(--pad) * -1);
  overflow: hidden;
  background: var(--bg-card);
}

.painting img {
  width: 100%;
  height: 318px;
  object-fit: cover;
  object-position: center 28%;
}

.credit {
  margin: 8px 0 2px;
  font-size: 10px;
  letter-spacing: 0.01em;
  text-align: center;
  color: var(--muted);
  line-height: 1.3;
}

.actions {
  margin-top: 16px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.btn:active {
  opacity: 0.85;
}

.btn-gold {
  background: var(--gold);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--gold-text);
  border: 1px solid var(--line-strong);
}

.btn[disabled],
.btn.is-disabled {
  cursor: not-allowed;
}

/* Lists */
.entry {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  align-items: center;
  color: inherit;
}

.entry:last-child {
  border-bottom: 1px solid var(--line);
}

.entry-thumb {
  width: 72px;
  height: 72px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-card);
}

.entry-body {
  min-width: 0;
  flex: 1;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.entry-num {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--gold-text);
  line-height: 1;
  padding-top: 3px;
}

.pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text);
  border: 1px solid var(--line-strong);
  padding: 2px 6px 1px;
  border-radius: 2px;
}

.entry-title {
  font-family: var(--font-hand);
  font-size: 20px;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 4px;
}

.entry-sub,
.entry-status {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.entry-status.is-written {
  color: var(--ink-soft);
}

.chevron {
  color: var(--muted);
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.footnote {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Members */
.tier {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px 18px 16px;
  margin-bottom: 12px;
}

.tier.is-featured {
  border-color: var(--gold);
  background: var(--bg-card);
  box-shadow: inset 0 0 0 1px rgba(214, 178, 112, 0.35);
}

.tier-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin: 0 0 8px;
}

.tier h3 {
  font-family: var(--font-hand);
  font-size: 28px;
  line-height: 1;
  margin: 0 0 10px;
  font-weight: 400;
  color: var(--ink);
}

.tier .price {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin: 0 0 12px;
}

.tier ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tier li {
  position: relative;
  padding: 0 0 8px 14px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.tier li:last-child { padding-bottom: 0; }

.tier li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.placeholder-note {
  margin: 12px 0 14px;
  padding: 10px 12px;
  border-left: 2px solid var(--gold);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
  background: rgba(214, 178, 112, 0.12);
}

/* Journal writer */
.sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  max-width: 430px;
  margin: 0 auto;
  flex-direction: column;
}

.sheet.is-open {
  display: flex;
}

.sheet-bar {
  height: var(--top);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.back {
  background: none;
  border: 0;
  color: var(--gold-text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 0;
  cursor: pointer;
}

.sheet-bar .label {
  font-family: var(--font-sans);
  font-size: 22px;
  padding-top: 4px;
  color: var(--ink);
}

.sheet-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 4px var(--pad) calc(20px + var(--safe-bottom));
  min-height: 0;
}

.sheet-body .prompt-title {
  white-space: normal;
  font-size: 26px;
  margin-bottom: 10px;
  padding-top: 0;
}

.sheet-body .prompt-question {
  margin-bottom: 14px;
}

textarea.entry-text {
  flex: 1;
  width: 100%;
  min-height: 220px;
  resize: none;
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 14px 14px;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  outline: none;
}

textarea.entry-text:focus {
  border-color: var(--line-strong);
}

textarea.entry-text::placeholder {
  color: var(--muted);
}

.save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 12px;
}

.save-state {
  font-size: 12px;
  color: var(--muted);
}

.save-row .btn {
  width: auto;
  padding: 0 22px;
  height: 42px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab) + var(--safe-bottom) + 16px);
  transform: translateX(-50%) translateY(12px);
  max-width: 360px;
  width: calc(100% - 40px);
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.4;
  padding: 12px 14px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  text-align: center;
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Tab bar */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  height: calc(var(--tab) + var(--safe-bottom));
  padding: 6px 6px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg);
  border-top: 1px solid var(--line);
  z-index: 30;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 4px 0 6px;
}

.tab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab.is-active {
  color: var(--gold-text);
}

.tab.is-active svg {
  stroke-width: 1.9;
}

/* Desktop frame when previewed on a large screen */
@media (min-width: 500px) {
  body {
    background: #f0ebe1;
  }
  .app {
    box-shadow: var(--shadow);
  }
}

:root{--bg:#F0EEE9;--bg-card:#E6E0D8;--cream:#E6E0D8;--gold:#57504C;--gold-text:#57504C;--line-strong:#57504C;}
.topbar,.tabbar{background:#57504C !important;border-color:transparent !important;}
.preview-tag{color:#F0EEE9 !important;border-color:#F0EEE9 !important;opacity:.8}
.tab{color:#F0EEE9 !important;opacity:.7}
.tab.is-active{opacity:1;color:#F0EEE9 !important}
.tab svg,.tab.is-active svg{color:#F0EEE9 !important;stroke:currentColor}
.btn-gold{background:#57504C !important;color:#F0EEE9 !important;}
