:root {
  --ink: #173c31;
  --ink-soft: #35574d;
  --paper: #f5f3ed;
  --white: #fff;
  --sage: #dce9df;
  --mint: #9fcbb2;
  --sand: #d9bda1;
  --line: rgba(23, 60, 49, 0.18);
  --mono: "DM Mono", monospace;
  --body: "Manrope", sans-serif;
  --display: "Newsreader", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 243, 237, 0.92);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 500;
  line-height: 0.8;
  text-decoration: none;
}

.brand small {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.22em;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 23px;
}

.topbar-actions,
.channel-links,
.workspace-toolbar > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.global-status > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c39a64;
  box-shadow: 0 0 0 4px rgba(195, 154, 100, 0.12);
}

.global-status[data-state="ready"] > i {
  background: #4e9b6d;
  box-shadow: 0 0 0 4px rgba(78, 155, 109, 0.12);
}

.global-status[data-state="unlocked"] > i {
  background: #246b4b;
  box-shadow: 0 0 0 4px rgba(36, 107, 75, 0.16);
}

.global-status[data-state="error"] > i {
  background: #a4443f;
  box-shadow: 0 0 0 4px rgba(164, 68, 63, 0.12);
}

.primary-button,
.quiet-button,
.toolbar-button,
.upload-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  background: var(--ink);
  color: var(--white);
}

.quiet-button,
.toolbar-button,
.upload-button {
  background: transparent;
  color: var(--ink);
}

.quiet-button.is-unlocked {
  border-color: #246b4b;
  background: var(--sage);
}

.toolbar-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.hero {
  display: grid;
  min-height: 730px;
  grid-template-columns: minmax(0, 0.92fr) minmax(520px, 1.08fr);
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(80px, 9vw, 150px) clamp(24px, 7vw, 110px);
}

.eyebrow {
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 40px;
  font-family: var(--display);
  font-size: clamp(72px, 8vw, 128px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.82;
}

.hero h1 em {
  color: #a26f4c;
  font-weight: 400;
}

.hero-copy > p:last-child {
  max-width: 610px;
  margin: 0;
  color: rgba(23, 60, 49, 0.74);
  font-size: 17px;
  line-height: 1.7;
}

.hero-proof {
  position: relative;
  min-height: 730px;
}

.hero-proof figure {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
}

.hero-proof img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-proof figure::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(9, 33, 26, 0.72), transparent 48%);
  content: "";
}

.hero-proof figcaption {
  position: absolute;
  z-index: 2;
  right: 24px;
  bottom: 24px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.88);
  font-family: var(--mono);
  font-size: 9px;
}

.hero-stats {
  position: absolute;
  z-index: 3;
  bottom: 42px;
  left: 42px;
  display: grid;
  gap: 8px;
  color: var(--white);
}

.hero-stats span {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 12px;
}

.hero-stats strong {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 400;
}

.strategy {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--ink);
  color: var(--white);
}

.strategy article {
  min-height: 285px;
  padding: clamp(34px, 4vw, 62px);
}

.strategy article + article {
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.strategy span {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 11px;
}

.strategy h2,
.channel-meta h2,
.research-notes h2 {
  margin: 44px 0 16px;
  font-family: var(--display);
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
}

.strategy p {
  max-width: 400px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.7;
}

.controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 48px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  min-height: 37px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.filter.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.search {
  display: grid;
  min-width: min(340px, 100%);
  gap: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search input {
  height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  text-transform: none;
}

.channel-card {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(290px, 0.68fr) minmax(0, 1.32fr);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.channel-card[hidden] {
  display: none;
}

.channel-meta {
  min-width: 0;
  padding: clamp(48px, 5vw, 82px) clamp(24px, 5vw, 78px);
  border-right: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.channel-rank {
  margin-bottom: 18px;
  color: #a26f4c;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.channel-lane {
  display: inline-flex;
  padding: 6px 9px;
  background: var(--sage);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.channel-meta h2 {
  margin: 28px 0 18px;
  font-size: clamp(48px, 5vw, 68px);
}

.channel-fit {
  margin: 0 0 36px;
  color: rgba(23, 60, 49, 0.72);
  font-size: 14px;
  line-height: 1.7;
}

.channel-meta dl {
  margin: 0;
  border-top: 1px solid var(--line);
}

.channel-meta dl > div {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.channel-meta dt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.channel-meta dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.channel-rule {
  margin: 28px 0;
  padding-left: 15px;
  border-left: 2px solid #a26f4c;
  color: rgba(23, 60, 49, 0.72);
  font-size: 12px;
  line-height: 1.65;
}

.channel-links {
  align-items: flex-start;
  flex-direction: column;
}

.channel-links .primary-button {
  width: 100%;
}

.quiet-link,
.source-link {
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

.source-link {
  color: rgba(23, 60, 49, 0.64);
  font-family: var(--mono);
  font-size: 9px;
}

.channel-workspace {
  min-width: 0;
  padding: clamp(36px, 5vw, 78px);
  background: var(--white);
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.workspace-toolbar > span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 10px;
}

.platform-shell {
  overflow: hidden;
  border: 1px solid rgba(12, 28, 22, 0.16);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(23, 60, 49, 0.1);
}

.platform-chrome {
  display: grid;
  min-height: 64px;
  grid-template-columns: 34px auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #e5e7eb;
}

.platform-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
}

.platform-wordmark {
  font-weight: 800;
}

.platform-context {
  justify-self: end;
  color: #71717a;
  font-size: 11px;
}

.platform-photo-strip {
  display: grid;
  height: 280px;
  grid-template-columns: 1.4fr 0.6fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  overflow: hidden;
  background: #e5e7eb;
}

.platform-photo-strip figure {
  position: relative;
  margin: 0;
  overflow: hidden;
}

.platform-photo-strip figure:first-child {
  grid-row: 1 / -1;
}

.platform-photo-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.platform-fields {
  padding: 24px;
}

.platform-fields label {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.platform-fields label > span {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.platform-fields textarea {
  width: 100%;
  resize: vertical;
  border: 0;
  border-bottom: 1px solid #d9dde2;
  border-radius: 0;
  background: transparent;
  color: #18201d;
  line-height: 1.62;
}

.platform-fields textarea[readonly] {
  cursor: text;
  opacity: 0.84;
}

.title-editor {
  min-height: 70px;
  font-family: var(--display);
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1 !important;
}

.body-editor {
  min-height: 380px;
  font-size: 14px;
}

.editor-status {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: #777;
  font-family: var(--mono);
  font-size: 9px;
}

.save-status[data-state="saving"] {
  color: #986635;
}

.save-status[data-state="saved"] {
  color: #246b4b;
}

.save-status[data-state="error"] {
  color: #a4443f;
}

.photo-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
}

.photo-tools > div {
  display: grid;
  gap: 5px;
}

.photo-tools strong {
  font-size: 12px;
}

.photo-note {
  color: rgba(23, 60, 49, 0.65);
  font-size: 10px;
}

.photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.channel-card[data-platform="discord"] .platform-shell {
  border-color: #202225;
  background: #313338;
}

.channel-card[data-platform="discord"] .platform-chrome {
  border-color: #41434a;
  background: #2b2d31;
  color: #f2f3f5;
}

.channel-card[data-platform="discord"] .platform-avatar {
  background: #5865f2;
}

.channel-card[data-platform="discord"] .platform-fields,
.channel-card[data-platform="discord"] textarea {
  background: #313338;
  color: #dbdee1;
}

.channel-card[data-platform="discord"] textarea {
  border-color: #4e5058;
}

.channel-card[data-platform="reddit"] .platform-avatar {
  background: #ff4500;
}

.channel-card[data-platform="facebook"] .platform-avatar {
  background: #1877f2;
}

.channel-card[data-platform="craigslist"] .platform-shell {
  border-radius: 0;
}

.channel-card[data-platform="craigslist"] .platform-avatar {
  border-radius: 0;
  background: #5c2d91;
}

.channel-card[data-platform="furnished"] .platform-avatar {
  background: #ef355b;
}

.channel-card[data-platform="zillow"] .platform-avatar {
  background: #006aff;
}

.channel-card[data-platform="ucr"] .platform-avatar {
  background: #003da5;
}

.research-notes {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(50px, 9vw, 150px);
  padding: clamp(100px, 12vw, 170px) clamp(24px, 7vw, 110px);
  background: var(--sage);
}

.research-notes h2 {
  margin: 0;
  font-size: clamp(58px, 7vw, 96px);
}

.research-notes > div:last-child {
  align-self: end;
}

.research-notes > div:last-child p {
  max-width: 680px;
  margin: 0 0 24px;
  color: rgba(23, 60, 49, 0.76);
  font-size: 16px;
  line-height: 1.8;
}

footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 50px clamp(24px, 7vw, 110px) 90px;
  background: var(--ink);
  color: var(--white);
}

footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
}

footer > a:last-child {
  color: var(--white);
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  padding: 13px 16px;
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.unlock-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 32px 100px rgba(8, 30, 23, 0.32);
}

.unlock-dialog::backdrop {
  background: rgba(8, 30, 23, 0.62);
  backdrop-filter: blur(5px);
}

.unlock-dialog form {
  position: relative;
  display: grid;
  gap: 22px;
  padding: clamp(34px, 6vw, 58px);
}

.unlock-dialog .eyebrow {
  margin: 0;
}

.unlock-dialog h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(44px, 7vw, 64px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.unlock-dialog p {
  margin: 0;
  color: rgba(23, 60, 49, 0.72);
  font-size: 14px;
  line-height: 1.7;
}

.unlock-dialog label {
  display: grid;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.unlock-dialog input {
  height: 48px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
}

.unlock-dialog .primary-button {
  width: 100%;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 27px;
}

.unlock-dialog .unlock-error {
  min-height: 18px;
  color: #a4443f;
  font-size: 12px;
}

@media (max-width: 1050px) {
  .global-status {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-proof {
    min-height: 68vw;
  }

  .strategy {
    grid-template-columns: 1fr;
  }

  .strategy article {
    min-height: 0;
  }

  .strategy article + article {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 0;
  }

  .channel-card {
    grid-template-columns: 1fr;
  }

  .channel-meta {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 64px;
  }

  .topbar #export-all {
    display: none;
  }

  .topbar-actions {
    gap: 7px;
  }

  .topbar #unlock-editor {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 9px;
  }

  .brand {
    font-size: 19px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .topbar .primary-button {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 10px;
  }

  .hero {
    min-height: 0;
  }

  .hero-copy {
    padding: 95px 20px 90px;
  }

  .hero h1 {
    font-size: clamp(67px, 20vw, 92px);
  }

  .hero-proof {
    min-height: 92vw;
  }

  .hero-stats {
    bottom: 22px;
    left: 20px;
  }

  .strategy h2 {
    margin-top: 25px;
  }

  .controls {
    align-items: stretch;
    flex-direction: column;
    padding: 30px 16px;
  }

  .search {
    width: 100%;
  }

  .channel-meta,
  .channel-workspace {
    padding: 52px 16px;
  }

  .channel-meta h2 {
    font-size: 52px;
  }

  .workspace-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .platform-photo-strip {
    height: 210px;
  }

  .platform-fields {
    padding: 20px 16px;
  }

  .title-editor {
    font-size: 25px;
  }

  .body-editor {
    min-height: 440px;
  }

  .photo-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .research-notes {
    grid-template-columns: 1fr;
    padding: 95px 20px;
  }

  footer {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 48px 20px 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
