/* shoutsecrets.com — clean, light, centered.
   Off-white paper, one blue accent, pill controls, mono for meta. */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --ink: #17171a;
  --muted: #6e6e73;
  --faint: #9a9aa0;
  --line: #e7e5e1;
  --blue: #2c4cff;
  --blue-dark: #1f3ae0;
  --blue-soft: #eef1ff;
  --kept-bg: #e8f5f0;
  --kept-ink: #0e7c5b;
  --danger: #d92d4b;

  --r-pill: 999px;
  --r-card: 16px;
  --r-sheet: 20px;
  --shadow: 0 1px 2px rgba(23, 23, 26, 0.04), 0 8px 24px rgba(23, 23, 26, 0.05);
  --shadow-lift: 0 2px 4px rgba(23, 23, 26, 0.05), 0 14px 36px rgba(23, 23, 26, 0.09);
  --ease: cubic-bezier(0.2, 0.9, 0.3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--blue); }

.mono {
  font-family: 'Space Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.25rem);
  background: rgba(250, 249, 247, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .tld { color: var(--blue); }

.topbar-right { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }
.who { display: flex; align-items: center; gap: 0.6rem; }
.who .whoami { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.who .whoami:hover { color: var(--blue); }

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
              transform 0.12s var(--ease), box-shadow 0.16s var(--ease);
}
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn-outline { border-color: var(--line); color: var(--blue); }
.btn-outline:hover { border-color: var(--blue); background: var(--blue-soft); }

.btn-solid { background: var(--blue); color: #fff; }
.btn-solid:hover { background: var(--blue-dark); }

.btn-loud { background: var(--ink); color: #fff; }
.btn-loud:hover { background: #000; }

.btn-quiet { background: transparent; color: var(--muted); padding: 0.5rem 0.7rem; }
.btn-quiet:hover { color: var(--ink); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.84rem; }
.btn-block { width: 100%; padding: 0.75rem 1rem; }

input[type='text'], input[type='password'], textarea, select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.field { margin-bottom: 1.1rem; }
.field > label, .field-head {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.optional { color: var(--faint); font-weight: 400; }
.counter { display: block; margin-top: 0.35rem; font-size: 0.76rem; color: var(--faint); }

/* ---------- hero ---------- */

.hero { padding: clamp(3rem, 9vw, 6rem) 1.25rem 0; text-align: center; }

.hero-title {
  margin: 0 auto;
  max-width: 16ch;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero-title em { font-style: normal; color: var(--blue); }

.hero-sub { margin: 1.25rem auto 0; max-width: 36ch; font-size: 1.12rem; color: var(--muted); }
.hero-sub span { display: block; }

.hero-count { margin: 1.5rem 0 0; color: var(--faint); }

/* ---------- search ---------- */

.searchbar { max-width: 32rem; margin: 2.25rem auto 0; padding: 0 1.25rem; }
.searchbar input {
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow);
  font: inherit;
  font-size: 0.98rem;
}
.searchbar input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.searchbar input::placeholder { color: var(--faint); }

/* ---------- wall ---------- */

main { padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.25rem) 5rem; }

.wall-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 82rem;
  margin: 0 auto 1.25rem;
}
.wall-head h2 {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.wall-head .spacer { flex: 1; }
.wall-head .mono { color: var(--faint); }

.wall {
  max-width: 82rem;
  margin: 0 auto;
  column-count: 4;
  column-gap: 1.25rem;
}
@media (max-width: 1200px) { .wall { column-count: 3; } }
@media (max-width: 860px)  { .wall { column-count: 2; } }
@media (max-width: 560px)  { .wall { column-count: 1; } }

/* ---------- a post ---------- */

.post {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  break-inside: avoid;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s;
}
.post:hover, .post:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  outline: none;
}
.post:focus-visible { border-color: var(--blue); }

.post-media { overflow: hidden; border-radius: 10px; background: #f1efec; }
.post-media img, .post-media video { width: 100%; height: auto; }

.post-play {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--r-pill);
  background: rgba(23, 23, 26, 0.72);
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Text posts: the shorter the secret, the larger it's set. */
.shout {
  margin: 0.35rem 0.25rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
.shout.v-loud  { font-size: 1.85rem; }
.shout.v-mid   { font-size: 1.45rem; }
.shout.v-quiet { font-size: 1.15rem; }
.shout.v-mutter {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: 0;
}

.post-caption { margin: 0.7rem 0.25rem 0; font-size: 0.95rem; overflow-wrap: anywhere; }

.post-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.25rem 0.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--faint);
}
.post-foot .by { font-weight: 600; color: var(--ink); }
.post-foot .by a { color: var(--ink); text-decoration: none; }
.post-foot .by a:hover { color: var(--blue); }
.post-foot .anon { font-weight: 400; color: var(--muted); font-style: italic; }
.post-foot .when { margin-left: auto; font-family: 'Space Mono', monospace; font-size: 0.7rem; }

.tag-kept {
  padding: 0.1rem 0.5rem;
  border-radius: var(--r-pill);
  background: var(--kept-bg);
  color: var(--kept-ink);
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- empty ---------- */

.notice {
  max-width: 30rem;
  margin: 3rem auto;
  padding: 3rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.notice p { margin: 0 0 0.5rem; color: var(--muted); }
.notice .big {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.notice .btn { margin-top: 0.75rem; }

/* ---------- modals ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(23, 23, 26, 0.4);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.modal[hidden] { display: none; }

.sheet {
  width: min(34rem, 100%);
  margin: auto;
  border-radius: var(--r-sheet);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(23, 23, 26, 0.18);
  overflow: hidden;
}
.sheet-narrow { width: min(24rem, 100%); }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.35rem 0.6rem;
}
.sheet-head h2 {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.sheet-close {
  border: none;
  background: none;
  color: var(--faint);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.sheet-close:hover { color: var(--ink); }
.sheet-body { padding: 0.5rem 1.35rem 1.35rem; }

/* compose */

.dropzone {
  display: grid;
  place-items: center;
  min-height: 9rem;
  margin-bottom: 1rem;
  padding: 1.25rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--blue); background: var(--blue-soft); }
.dz-plus { display: block; font-size: 1.6rem; line-height: 1.2; color: var(--blue); }
.dz-text { display: block; font-weight: 500; }
.dz-hint { display: block; margin-top: 0.3rem; font-size: 0.78rem; color: var(--faint); }
.dz-preview { max-height: 15rem; width: auto; margin: 0 auto; border-radius: 10px; }

.seg {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.6rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg);
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-pill);
  text-align: center;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.16s, color 0.16s;
}
.seg label:hover { color: var(--ink); }
.seg input:checked + label { background: var(--blue); color: #fff; }
.seg input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }
.seg-note { margin: 0 0 1.1rem 0.25rem; font-size: 0.8rem; color: var(--faint); }

.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0.4rem 0 1.1rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: var(--bg);
  font-size: 0.85rem;
  color: var(--muted);
}
.check input { margin-top: 0.2rem; accent-color: var(--blue); }

.form-error {
  margin: 0 0 0.9rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: #fdeaee;
  color: var(--danger);
  font-size: 0.88rem;
}
.sheet-alt { margin: 0.9rem 0 0; text-align: center; font-size: 0.88rem; color: var(--muted); }
.sheet-alt button { border: none; background: none; color: var(--blue); font-weight: 600; cursor: pointer; }

.keybox {
  margin-top: 0.9rem;
  padding: 0.8rem;
  border-radius: 12px;
  background: var(--blue-soft);
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  word-break: break-all;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(23, 23, 26, 0.55);
  backdrop-filter: blur(4px);
  overflow-y: auto;
}
.lightbox[hidden] { display: none; }

.lb-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.lb-close:hover { background: var(--blue); color: #fff; }

.lb-inner {
  width: min(50rem, 100%);
  margin: auto;
  padding: 1rem;
  border-radius: var(--r-sheet);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(23, 23, 26, 0.25);
}
.lb-stage { display: grid; place-items: center; }
.lb-stage img, .lb-stage video { max-height: 66vh; width: auto; max-width: 100%; border-radius: 12px; }
.lb-shout {
  margin: 0;
  padding: 2.5rem 1rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-align: center;
  overflow-wrap: anywhere;
}
.lb-body { margin: 1rem 0.25rem 0; font-size: 1.02rem; overflow-wrap: anywhere; }
.lb-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
}
.lb-meta .lb-by {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.lb-meta .lb-by a { color: var(--ink); text-decoration: none; }
.lb-meta .lb-by a:hover { color: var(--blue); }
.lb-actions { display: flex; gap: 0.5rem; margin-left: auto; }
.lb-actions .btn { border: 1px solid var(--line); color: var(--muted); }
.lb-actions .btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
#lb-delete:hover { border-color: var(--danger); color: var(--danger); background: #fdeaee; }

/* ---------- profile ---------- */

.profile-head { padding: clamp(2.5rem, 7vw, 4.5rem) 1.25rem 0; text-align: center; }
.profile-name {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.profile-handle { margin: 0.6rem 0 0; color: var(--faint); }
.profile-bio { margin: 1rem auto 0; max-width: 42ch; font-size: 1.05rem; color: var(--muted); }
.profile-tools { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }

.owner-note {
  max-width: 82rem;
  margin: 0 auto 1.5rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: var(--kept-bg);
  color: var(--kept-ink);
  font-size: 0.88rem;
}
.owner-note .tag-kept { background: #fff; }

/* ---------- footer / toast ---------- */

.sitefoot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.5rem;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 90;
  transform: translateX(-50%);
  padding: 0.75rem 1.2rem;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px rgba(23, 23, 26, 0.25);
}
.toast[hidden] { display: none; }

@media (max-width: 640px) {
  .topbar { gap: 0.5rem; padding: 0.85rem 1rem; }
  .btn { padding: 0.5rem 0.9rem; font-size: 0.88rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
