:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #5f6f68;
  --line: #d8ded9;
  --line-strong: #aebbb3;
  --paper: #f8faf7;
  --surface: #ffffff;
  --surface-2: #eef4f1;
  --tech: #1f6f8b;
  --tech-bg: #e5f2f8;
  --consumer: #9a4d4d;
  --consumer-bg: #f7ebea;
  --accent: #2f6f55;
  --amber: #a76a1f;
  --shadow: 0 16px 48px rgba(33, 45, 39, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

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

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(216, 222, 217, 0.82);
  background: rgba(248, 250, 247, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, rgba(31, 111, 139, 0.92) 0 34%, transparent 34% 100%),
    linear-gradient(45deg, transparent 0 38%, rgba(47, 111, 85, 0.82) 38% 64%, transparent 64% 100%),
    linear-gradient(315deg, rgba(154, 77, 77, 0.88) 0 32%, transparent 32% 100%),
    #fff;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  flex: 0 0 auto;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.98rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav a {
  padding: 8px 10px;
}

.nav a:hover {
  color: var(--ink);
}

main {
  min-height: 100vh;
}

.workspace-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: clamp(24px, 5vw, 56px);
  align-items: end;
  padding: clamp(44px, 7vw, 92px) clamp(18px, 5vw, 72px) clamp(28px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  max-width: 920px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 980px;
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 6vw, 5.65rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.24rem);
}

.operating-rules {
  border-left: 4px solid var(--accent);
  padding: 18px 0 18px 22px;
}

.operating-rules h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.operating-rules ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.control-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 18px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.search-box {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 85, 0.13);
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.segment {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.segment.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(23, 32, 29, 0.1);
}

.section-band {
  padding: clamp(34px, 6vw, 72px) clamp(18px, 5vw, 72px);
}

.section-band.alt {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(240px, 0.3fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1.02;
}

.section-head > p {
  margin-bottom: 4px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

.themes-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.objects-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.item-card,
.signal-row,
.note-row,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.item-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  padding: 18px;
}

.card-topline,
.theme-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.card-topline {
  min-height: 26px;
  margin-bottom: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 0.74rem;
  font-weight: 700;
}

.tag.tech {
  border-color: rgba(31, 111, 139, 0.22);
  color: var(--tech);
  background: var(--tech-bg);
}

.tag.consumer {
  border-color: rgba(154, 77, 77, 0.22);
  color: var(--consumer);
  background: var(--consumer-bg);
}

.item-card h3,
.signal-row h3,
.note-row h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  line-height: 1.2;
}

.item-card p,
.signal-row p,
.note-row p {
  color: var(--muted);
}

.theme-card p {
  min-height: 116px;
}

.object-type {
  font-weight: 700;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: auto 0 16px;
}

.meta-grid div,
.signal-meta div {
  display: grid;
  gap: 2px;
}

dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 0;
  color: var(--ink);
}

.watch-list {
  display: grid;
  gap: 7px;
}

.watch-list span {
  border-top: 1px solid var(--line);
  padding-top: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.theme-links {
  margin-top: auto;
  padding-top: 14px;
}

.item-card small {
  margin-top: 12px;
  color: var(--muted);
}

.stack-list,
.note-list {
  display: grid;
  gap: 12px;
}

.signal-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
}

.signal-date {
  color: var(--accent);
  font-weight: 800;
}

.signal-meta {
  display: grid;
  grid-template-columns: minmax(0, 0.48fr) minmax(0, 0.52fr);
  gap: 18px;
  margin: 14px 0 0;
}

.note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 22px;
  padding: 18px;
}

.note-thesis {
  color: var(--ink);
  font-weight: 700;
}

.gap-box {
  border-left: 3px solid var(--amber);
  padding-left: 16px;
}

.gap-box strong {
  display: block;
  margin-bottom: 8px;
}

.gap-box ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.empty-state {
  padding: 28px;
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 1180px) {
  .themes-grid,
  .objects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .workspace-hero,
  .control-strip,
  .section-head,
  .signal-row,
  .note-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.2rem, 16vw, 4.2rem);
  }

  .themes-grid,
  .objects-grid {
    grid-template-columns: 1fr;
  }

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

  .theme-card p {
    min-height: auto;
  }

  .segmented {
    width: 100%;
    grid-auto-flow: row;
  }

  .signal-meta {
    grid-template-columns: 1fr;
  }
}
