:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-soft: #f5f6f7;
  --ink: #101418;
  --ink-soft: #2a3139;
  --muted: #68717d;
  --subtle: #9099a6;
  --line: #e1e4e8;
  --line-strong: #c5ccd5;
  --accent: #0b5bd3;
  --accent-soft: #edf4ff;
  --success: #146c4a;
  --success-soft: #e8f6ef;
  --danger: #b42318;
  --danger-soft: #fff0ed;
  --warning: #8a6200;
  --warning-soft: #fff6d9;
  --radius: 4px;
  --content: 1040px;
  --shadow: 0 8px 18px rgba(16, 20, 24, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

button,
input {
  font: inherit;
}

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(100% - 2rem, var(--content));
  min-height: 54px;
  margin: 0 auto;
}

.brand {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 760;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 620;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.6);
  transition: opacity 140ms ease, transform 140ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  margin: 4px auto;
  background: var(--ink);
}

.page-shell {
  width: min(100% - 2rem, var(--content));
  margin: 0 auto;
  padding: 0 0 2rem;
}

.welcome-panel {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 54px);
  text-align: center;
}

.welcome-panel h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  font-weight: 760;
  line-height: 1;
}

.welcome-word span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.18em);
  animation: welcome-letter 520ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--i) * 85ms);
}

@keyframes welcome-letter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-word span {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

.eyebrow,
.card-kicker,
.panel-label {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.launch-icon,
.application-marker,
.workspace-marker,
.empty-marker,
.mini-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.launch-icon svg,
.application-marker svg,
.workspace-marker svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.launch-item strong,
.launch-item small {
  display: block;
}

.launch-item strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 680;
}

.launch-item small {
  margin-top: 0.3rem;
  color: var(--muted);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0 0.55rem;
}

.section-heading h2,
.section-title h2,
.company-overview h2,
.empty-state h2,
.memo-card h2,
.workspace-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.2;
  font-weight: 650;
}

.applications-heading .eyebrow {
  margin-bottom: 0.25rem;
}

.application-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.application-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.application-copy h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.2;
  font-weight: 650;
}

.application-copy p,
.workspace-card p,
.memo-card p,
.metric-card p,
.empty-state p,
.message-card p,
.company-summary p {
  max-width: 620px;
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.capability-row,
.company-meta,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.capability-row {
  justify-content: flex-end;
}

.capability-row span,
.company-meta span,
.tag-row span,
.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  padding: 0.18rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 520;
}

.card-action {
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 620;
  white-space: nowrap;
}

.card-action::after {
  margin-left: 0.35rem;
  content: "->";
  transition: transform 140ms ease;
}

.card-action:hover {
  color: var(--ink);
}

.card-action:hover::after {
  transform: translateX(2px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 36px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

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

.button.primary:hover {
  background: #000000;
  border-color: #000000;
}

.button.secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.button.secondary:hover {
  border-color: var(--ink);
}

.button:focus-visible,
.nav-link:focus-visible,
.tag-pill:focus-visible,
.card-action:focus-visible,
.launch-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.16);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid rgba(35, 116, 86, 0.18);
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  padding: 0.18rem 0.56rem;
  font-size: 0.76rem;
  font-weight: 620;
}

.status-badge.muted {
  border-color: rgba(138, 98, 0, 0.18);
  background: var(--warning-soft);
  color: var(--warning);
}

.disabled-button {
  cursor: default;
  opacity: 0.68;
}

.page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 410px);
  gap: 1rem;
  align-items: stretch;
  margin: 1.2rem 0 1rem;
}

.page-intro--compact {
  align-items: end;
}

.research-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.8rem;
}

.page-intro h1,
.memo-detail-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  line-height: 1.08;
  font-weight: 720;
}

.lede {
  max-width: 680px;
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.intro-panel,
.search-panel,
.company-overview,
.section-panel,
.message-card,
.empty-state,
.pdf-shell,
.workspace-card,
.memo-card,
.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-panel,
.section-panel,
.message-card,
.empty-state,
.workspace-card,
.memo-card,
.metric-card {
  padding: 1.05rem;
}

.search-panel label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
}

.search-panel--inline {
  width: 100%;
  max-width: 460px;
  justify-self: end;
  border: 0;
  background: transparent;
  padding: 0;
}

.ticker-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem;
}

.ticker-search input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 0.45rem 0.65rem;
  outline: none;
}

.ticker-search input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.12);
}

.error-state {
  border-color: #fac5bd;
  background: var(--danger-soft);
}

.error-state strong {
  color: var(--danger);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  text-align: center;
}

.empty-state .empty-marker {
  margin-bottom: 1rem;
}

.empty-state p {
  max-width: 560px;
  margin-top: 0.5rem;
}

.company-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.company-overview h2 {
  font-size: 1.35rem;
}

.company-overview h2 span {
  color: var(--subtle);
  font-weight: 650;
}

.company-meta {
  margin-top: 0.65rem;
}

.workspace-grid,
.memo-grid,
.metric-grid {
  display: grid;
  gap: 0.8rem;
}

.memo-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.memo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}

.memo-title {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 680;
}

.memo-title:hover {
  color: var(--accent);
}

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

.hero-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0.8rem;
}

.workspace-card,
.memo-card,
.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.metric-card {
  min-height: 126px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 620;
}

.metric-card strong {
  display: block;
  margin: 0.1rem 0;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.1;
}

.metric-card p {
  font-size: 0.84rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.company-summary {
  grid-column: 1 / -1;
  padding: 1.25rem 1.4rem;
}

.company-summary .section-title {
  margin-bottom: 1rem;
}

.company-summary p {
  width: 100%;
  max-width: none;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.64;
}

.table-wrap {
  width: 100%;
  margin-top: 0.75rem;
  overflow-x: auto;
}

.metric-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
}

.metric-table tr {
  border-top: 1px solid var(--line);
}

.metric-table th,
.metric-table td {
  padding: 0.68rem 0;
  text-align: left;
  vertical-align: middle;
}

.metric-table th {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 560;
}

.metric-table td {
  color: var(--ink);
  font-weight: 650;
  text-align: right;
}

.muted-value {
  color: var(--subtle) !important;
  font-weight: 560 !important;
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: -0.25rem 0 1rem;
}

.tag-pill.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.memo-card {
  min-height: 250px;
}

.memo-card-body {
  display: grid;
  gap: 0.55rem;
}

.memo-date {
  color: var(--subtle);
  font-size: 0.82rem;
  font-weight: 560;
}

.memo-actions,
.memo-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.text-action {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 650;
}

.text-action.muted {
  color: var(--muted);
}

.text-action:hover {
  color: var(--ink);
}

.memo-detail-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
  padding: 1.2rem 0 0.8rem;
}

.back-link {
  display: inline-flex;
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 620;
}

.pdf-shell {
  height: 78vh;
  min-height: 620px;
  overflow: hidden;
}

.pdf-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

@media (max-width: 820px) {
  .page-intro {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .workspace-grid,
  .memo-grid,
  .hero-metrics,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .application-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .research-header {
    align-items: start;
  }

  .search-panel--inline {
    justify-self: stretch;
    max-width: none;
  }

  .memo-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .capability-row {
    justify-content: flex-start;
  }

}

@media (max-width: 680px) {
  .header-inner,
  .page-shell {
    width: min(100% - 1rem, var(--content));
  }

  .header-inner {
    min-height: 54px;
  }

  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    position: absolute;
    top: 54px;
    right: 0.5rem;
    left: 0.5rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 0.35rem 0.6rem;
  }

  .site-nav[data-open] {
    display: flex;
  }

  .nav-link {
    min-height: 40px;
  }

  .ticker-search {
    grid-template-columns: 1fr;
  }

  .ticker-search .button,
  .memo-actions .button,
  .memo-detail-actions .button,
  .company-overview .button {
    width: 100%;
  }

  .metric-table {
    min-width: 360px;
  }

  .company-overview,
  .memo-detail-header {
    align-items: stretch;
    flex-direction: column;
  }
}
