:root {
  color-scheme: dark;
  --ink: #f7f1ea;
  --muted: #d9cfc4;
  --quiet: rgba(247, 241, 234, 0.74);
  --line: rgba(255, 255, 255, 0.18);
  --panel: rgba(18, 24, 27, 0.72);
  --panel-strong: rgba(12, 17, 20, 0.86);
  --teal: #74d7c4;
  --rose: #f0a6a6;
  --gold: #f4d58d;
  --clay: #c98468;
  --sage: #a9c9a7;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(5, 10, 12, 0.42), rgba(5, 10, 12, 0.96) 88%),
    linear-gradient(90deg, rgba(4, 10, 13, 0.78), rgba(8, 13, 16, 0.34) 52%, rgba(4, 10, 13, 0.76)),
    url("assets/hero.png") center top / cover fixed,
    #10181b;
}

button,
textarea,
input,
select {
  max-width: 100%;
  font: inherit;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(3.2rem, 10vw, 7.8rem);
  line-height: 0.89;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.9rem, 4vw, 3.35rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  font-size: 1.05rem;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 20;
  transform: translateY(-150%);
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--teal);
  color: #07110f;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.site-footer,
.hero-section,
.content-band,
.policy-page {
  width: min(1180px, calc(100% - 32px));
  max-width: 100%;
  margin: 0 auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.brand-row,
.site-header nav,
.meta-row,
.choice-row,
.filter-group,
.post-card header,
.post-card header > div,
.comfort-row,
.site-footer {
  display: flex;
  align-items: center;
}

.brand-row {
  min-width: 0;
  gap: 12px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mobile-menu {
  display: none;
}

.hamburger-button {
  width: 42px;
  height: 38px;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.hamburger-button span {
  width: 18px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: var(--ink);
}

.mobile-menu.open .hamburger-button {
  border-color: rgba(116, 215, 196, 0.55);
}

.site-header nav a,
.site-footer a {
  padding: 9px 10px;
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover,
.site-footer a:hover {
  color: var(--ink);
}

.mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.54);
  background:
    radial-gradient(circle at 35% 35%, var(--teal), transparent 34%),
    radial-gradient(circle at 70% 64%, var(--rose), transparent 32%),
    rgba(255, 255, 255, 0.12);
}

.crisis-box {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  width: min(318px, calc(100% - 36px));
  padding: 14px;
  border: 1px solid rgba(244, 213, 141, 0.42);
  border-radius: 8px;
  background: rgba(18, 16, 13, 0.88);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.crisis-box strong {
  display: block;
  margin-bottom: 6px;
}

.crisis-box p {
  margin: 0;
  color: var(--quiet);
  font-size: 0.9rem;
  line-height: 1.4;
}

.hero-section {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.7fr);
  gap: 32px;
  align-items: center;
  padding: 38px 0 80px;
}

.hero-copy {
  padding-top: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.subhead {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  line-height: 1.5;
}

.write-panel,
.content-band,
.post-card,
.policy-card,
.archive-card,
.tool-panel,
.private-item {
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.write-panel {
  padding: clamp(20px, 3vw, 30px);
}

.feeling-form > label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}

.prompt-hint {
  margin: -2px 0 12px;
}

.prompt-hint span {
  display: block;
  margin-bottom: 4px;
  color: var(--quiet);
  font-size: 0.86rem;
}

.prompt-hint p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.4;
}

textarea {
  width: 100%;
  max-width: 100%;
  min-height: 198px;
  resize: vertical;
  display: block;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.09);
  line-height: 1.55;
}

textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(116, 215, 196, 0.15);
}

.meta-row {
  gap: 18px;
  justify-content: space-between;
  margin: 16px 0 22px;
}

.mood-group,
.filter-group {
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border: 0;
}

.mood-group legend,
.filter-group legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.mood-group input,
.filter-group input {
  position: absolute;
  opacity: 0;
}

.mood-group span,
.filter-group span {
  display: block;
  min-width: 78px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.mood-group input:checked + span,
.filter-group input:checked + span {
  color: #07110f;
  background: var(--teal);
  border-color: transparent;
}

.counter {
  flex: 0 0 auto;
  color: var(--muted);
}

.choice-row {
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.report-button,
.image-share-button {
  padding: 0 16px;
}

.primary-button {
  color: #07110f;
  background: var(--teal);
  font-weight: 850;
}

.secondary-button {
  color: #120c0b;
  background: var(--rose);
  font-weight: 850;
}

.ghost-button,
.report-button,
.image-share-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}

.message-well {
  min-height: 104px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  overflow: hidden;
}

.message-well p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.message-well.releasing p {
  animation: release 2.2s ease forwards;
}

.content-band {
  margin-bottom: 28px;
  padding: clamp(24px, 4vw, 44px);
}

.about-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.58fr) minmax(0, 1fr);
  gap: 28px;
}

.about-band p,
.section-heading p,
.policy-card p,
.policy-card li {
  color: var(--muted);
  line-height: 1.62;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.48fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.feed-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.post-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  box-shadow: none;
}

.post-card header {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.post-card header > div {
  gap: 8px;
}

.post-card strong {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.52;
}

.image-share-button {
  width: 100%;
  min-height: 40px;
  margin-top: 18px;
  color: var(--quiet);
  font-size: 0.88rem;
}

.comfort-row {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.comfort-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--quiet);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
}

.comfort-button.sent {
  color: #07110f;
  background: var(--sage);
}

.post-card.is-reported {
  opacity: 0.56;
}

.post-card.is-reported p {
  font-style: italic;
}

.report-button {
  min-height: 34px;
  color: var(--muted);
  font-size: 0.82rem;
}

.mood-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal);
}

.mood-angry .mood-dot {
  background: var(--clay);
}

.mood-lonely .mood-dot {
  background: var(--rose);
}

.mood-hopeful .mood-dot {
  background: var(--gold);
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
}

.error-state,
.error-text {
  border-color: rgba(240, 166, 166, 0.42);
  color: #f0c1c1;
}

.archive-band {
  display: grid;
  gap: 16px;
}

.archive-card {
  min-height: 150px;
  padding: 22px;
  box-shadow: none;
  background: var(--panel-strong);
}

.archive-card strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-card p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.58;
}

.archive-band > .ghost-button {
  justify-self: start;
}

.tools-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-panel {
  padding: clamp(20px, 3vw, 30px);
  box-shadow: none;
}

.quiet-form {
  display: grid;
  gap: 12px;
}

.quiet-form label {
  color: var(--muted);
  font-weight: 800;
}

.quiet-form textarea {
  min-height: 138px;
}

select {
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.09);
}

.private-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.private-item {
  padding: 14px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.07);
}

.private-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.82rem;
}

.private-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.site-footer {
  gap: 8px;
  padding: 24px 0 112px;
  color: var(--muted);
}

.site-footer span {
  margin-right: auto;
  color: var(--ink);
  font-weight: 800;
}

.site-footer small {
  color: var(--quiet);
}

.policy-page {
  padding: 38px 0 120px;
}

.policy-hero {
  max-width: 820px;
  margin: 38px 0 28px;
}

.policy-card {
  max-width: 880px;
  padding: clamp(24px, 4vw, 44px);
}

.policy-card ul {
  padding-left: 22px;
}

.policy-card li + li {
  margin-top: 10px;
}

.quiet-link {
  display: inline-block;
  margin-top: 18px;
}

@keyframes release {
  0% {
    transform: translateY(0);
    opacity: 1;
    filter: blur(0);
  }
  100% {
    transform: translateY(-32px);
    opacity: 0;
    filter: blur(8px);
  }
}

@media (max-width: 980px) {
  body {
    background-attachment: scroll;
  }

  .hero-section,
  .about-band,
  .section-heading,
  .tools-band {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
    padding-top: 22px;
  }

  .feed-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body {
    background:
      linear-gradient(180deg, rgba(5, 10, 12, 0.5), rgba(5, 10, 12, 0.98) 88%),
      linear-gradient(90deg, rgba(4, 10, 13, 0.82), rgba(8, 13, 16, 0.48) 52%, rgba(4, 10, 13, 0.82)),
      url("assets/hero.png") center top / cover no-repeat,
      #10181b;
  }

  .site-header,
  .site-footer,
  .hero-section,
  .content-band,
  .policy-page,
  .crisis-box {
    width: calc(100% - 32px);
    max-width: 100%;
  }

  .hero-section,
  .about-band,
  .section-heading,
  .feed-list,
  .tools-band,
  .site-header nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-header {
    min-height: 48px;
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 8px 0 6px;
  }

  .desktop-nav {
    display: none;
  }

  .brand-row {
    max-width: calc(100% - 56px);
    white-space: nowrap;
  }

  .brand-row span:last-child {
    font-size: clamp(1rem, 5.1vw, 1.2rem);
    white-space: nowrap;
  }

  .mobile-menu {
    display: block;
    margin-left: auto;
    position: relative;
    flex: 0 0 auto;
  }

  .mobile-nav-links {
    display: none;
  }

  .mobile-menu.open .mobile-nav-links {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 12;
    width: min(252px, calc(100vw - 32px));
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(12, 17, 20, 0.97);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(16px);
  }

  .mobile-nav-links a {
    min-height: 38px;
    display: grid;
    place-items: center;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--ink);
    text-align: center;
    text-decoration: none;
    line-height: 1.18;
  }

  .hero-section {
    min-height: auto;
    gap: 12px;
    padding: 4px 0 18px;
  }

  .hero-copy {
    padding-top: 0;
  }

  .hero-section,
  .content-band,
  .write-panel,
  .policy-card,
  .archive-card,
  .tool-panel,
  .post-card,
  .private-item,
  .message-well {
    max-width: 100%;
    min-width: 0;
  }

  h1 {
    font-size: clamp(2.25rem, 11vw, 3.25rem);
    line-height: 1;
    white-space: nowrap;
  }

  h2 {
    font-size: clamp(1.6rem, 7vw, 2.5rem);
  }

  .choice-row,
  .meta-row,
  .comfort-row,
  .filter-group,
  .mood-group {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .post-card header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .post-card header > div {
    min-width: 0;
  }

  .choice-row button,
  .quiet-form button,
  .archive-band > .ghost-button {
    width: 100%;
    min-width: 0;
  }

  .comfort-button {
    flex: 1 1 140px;
    min-width: 0;
    white-space: normal;
  }

  .mood-group label,
  .filter-group label {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .mood-group span,
  .filter-group span {
    min-width: 0;
    width: 100%;
  }

  textarea,
  input,
  select {
    width: 100%;
  }

  .subhead {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.36;
  }

  .write-panel {
    padding: 14px;
  }

  textarea {
    min-height: 118px;
    padding: 14px;
  }

  .message-well {
    min-height: 78px;
    margin-top: 12px;
    padding: 14px;
  }
}

@media (max-width: 680px) {
  body {
    padding-bottom: 0;
  }

  .site-header,
  .site-footer,
  .hero-section,
  .content-band,
  .policy-page {
    width: calc(100% - 32px);
  }

  h1 {
    font-size: clamp(2.2rem, 11vw, 3rem);
    line-height: 1;
  }

  h2 {
    font-size: clamp(1.75rem, 9vw, 2.35rem);
    line-height: 1.05;
  }

  .hero-section {
    gap: 12px;
    padding: 2px 0 18px;
  }

  .hero-copy {
    padding-top: 8px;
  }

  .subhead {
    font-size: 1rem;
    line-height: 1.42;
  }

  .write-panel,
  .content-band,
  .tool-panel {
    padding: 14px;
  }

  .content-band {
    margin-bottom: 16px;
  }

  textarea {
    min-height: 112px;
  }

  .quiet-form textarea {
    min-height: 126px;
  }

  .meta-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .counter {
    align-self: flex-end;
  }

  .choice-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .choice-row button,
  .quiet-form button,
  .archive-band > .ghost-button {
    width: 100%;
  }

  .mood-group label,
  .filter-group label {
    flex: 1 1 calc(50% - 8px);
  }

  .mood-group span,
  .filter-group span {
    min-width: 0;
  }

  .feed-list {
    grid-template-columns: 1fr;
  }

  .post-card {
    min-height: auto;
  }

  .comfort-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 28px;
  }

  .site-footer span {
    margin-right: 0;
  }

  .crisis-box {
    position: static;
    width: calc(100% - 32px);
    margin: 0 auto 16px;
    padding: 12px;
    display: grid;
    column-gap: 12px;
    align-items: center;
    box-shadow: none;
  }

  .crisis-box strong {
    margin: 0;
    font-size: 0.9rem;
  }

  .crisis-box p {
    margin-top: 4px;
    font-size: 0.82rem;
  }

  #write,
  #about,
  #feed,
  #archive,
  #letters,
  #capsule {
    scroll-margin-top: 12px;
  }
}

@media (max-width: 420px) {
  .brand-row {
    gap: 9px;
  }

  .brand-row span:last-child {
    font-size: clamp(0.98rem, 5vw, 1.12rem);
  }

  .mark {
    width: 24px;
    height: 24px;
  }

  .site-header {
    gap: 10px;
  }

  .mood-group label,
  .filter-group label {
    flex-basis: 100%;
  }
}

/* Rebuilt mobile header: one brand, one button, one hidden nav list. */
.hamburger-button {
  display: none;
}

@media (max-width: 768px) {
  .site-header {
    width: calc(100% - 32px);
    min-height: 48px;
    display: flex !important;
    flex-flow: row wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0 6px;
  }

  .brand-row {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 54px);
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
  }

  .brand-row span:last-child {
    display: inline;
    color: var(--ink);
    font-size: clamp(1rem, 4.8vw, 1.2rem);
    line-height: 1;
    white-space: nowrap;
  }

  .hamburger-button {
    width: 42px;
    height: 38px;
    flex: 0 0 42px;
    display: grid !important;
    place-content: center;
    gap: 4px;
    padding: 0;
  }

  .hamburger-button span {
    width: 18px;
    height: 2px;
    display: block;
  }

  .site-header .nav-links {
    display: none !important;
  }

  .site-header .nav-links.open {
    position: static !important;
    order: 3;
    width: 100%;
    flex: 1 0 100%;
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(12, 17, 20, 0.96);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
  }

  .site-header .nav-links.open a {
    min-height: 38px;
    display: grid;
    place-items: center;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--ink);
    text-align: center;
    text-decoration: none;
  }

  .hero-section {
    padding-top: 4px;
  }
}
