:root {
  color-scheme: light;
  --ink: #261d1a;
  --muted: #725f58;
  --paper: #fbf7f1;
  --cream: #f3e9db;
  --terracotta: #9c4f3c;
  --terracotta-dark: #75382b;
  --line: #ddcfc2;
  --white: #fffdf9;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

a { color: var(--terracotta-dark); }

.site-header,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.92);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.brand span { color: var(--muted); }

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  max-width: 780px;
  padding: clamp(4rem, 10vw, 8rem) 0 4rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--terracotta);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

h1 {
  max-width: 760px;
  margin-bottom: 1.3rem;
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

h2 { font-size: clamp(1.65rem, 3vw, 2.25rem); }

.hero-copy {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.65;
}

.boundary {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--terracotta);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.button.primary { background: var(--terracotta); color: white; }
.button.primary:hover { background: var(--terracotta-dark); }
.button.secondary { background: transparent; color: var(--terracotta-dark); }
.button.small { min-height: 36px; padding: 0.45rem 0.85rem; font-size: 0.85rem; }

.workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 0 0 5rem;
}

.workspace[hidden] { display: none; }

.panel,
.results-panel,
.profile-card,
.post-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
}

.panel,
.results-panel { padding: clamp(1.25rem, 3vw, 2rem); }
.results-panel { grid-column: 1 / -1; }

form { display: grid; gap: 1rem; }
label { display: grid; gap: 0.45rem; color: var(--muted); font-size: 0.88rem; font-weight: 650; }

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.results-heading { display: flex; justify-content: space-between; gap: 1rem; }
.results.empty, .empty { color: var(--muted); }
.results.error { color: #8b261d; }
.post-list { display: grid; gap: 0.8rem; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.7rem; margin: 0.8rem 0; }
.metrics div { display: grid; gap: 0.2rem; padding: 0.9rem; border: 1px solid var(--line); border-radius: 14px; background: var(--cream); }
.metrics strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.6rem; font-weight: 500; }
.metrics span { color: var(--muted); font-size: 0.75rem; text-transform: capitalize; }
.post-card, .profile-card { padding: 1.15rem; }
.post-card p { line-height: 1.55; white-space: pre-wrap; }
.post-meta { display: flex; justify-content: space-between; gap: 0.75rem; color: var(--muted); font-size: 0.82rem; }
.tag { display: inline-block; margin: 0 0.65rem 0.65rem 0; padding: 0.3rem 0.55rem; border-radius: 999px; background: var(--cream); font-size: 0.8rem; }

.legal { max-width: 760px; padding: clamp(3rem, 8vw, 7rem) 0; line-height: 1.7; }
.legal h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }

footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

footer nav { display: flex; flex-wrap: wrap; gap: 1rem; }

@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .site-header, footer { align-items: flex-start; flex-direction: column; }
}
