@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --paper: #f3f5f1;
  --paper-deep: #e8ece6;
  --ink: #18211d;
  --muted: #68736d;
  --line: #d8dfd8;
  --line-strong: #c9d1ca;
  --accent: #c8f36a;
  --accent-deep: #91b741;
  --white: #fbfcfa;
  --warm: #f2e5c9;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.detail-close {
  display: none;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  font-size: 24px;
  line-height: 1;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand,
.topbar-status,
.hero-actions,
.keyboard-hint,
.search-note,
.sidebar-heading-row,
.results-meta,
.idea-card-top,
.idea-card-footer,
.detail-topline,
.detail-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
}

.brand-mark {
  width: 23px;
  height: 23px;
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  align-items: end;
}

.brand-mark span {
  display: block;
  background: var(--ink);
  border-radius: 4px 4px 2px 2px;
}

.brand-mark span:nth-child(1) {
  height: 13px;
}

.brand-mark span:nth-child(2) {
  height: 19px;
  background: var(--accent-deep);
}

.brand-mark span:nth-child(3) {
  height: 9px;
}

.brand-name {
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.brand-tag {
  margin-left: 5px;
  padding-left: 13px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.topbar-status {
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #7db338;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(125, 179, 56, 0.14);
}

.topbar-divider {
  width: 1px;
  height: 14px;
  margin: 0 5px;
  background: var(--line-strong);
}

.topbar-date {
  color: var(--ink);
  font-weight: 650;
}

.page {
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto;
}

.hero {
  padding: 82px 0 67px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 70px;
  align-items: end;
}

.eyebrow,
.sidebar-label,
.detail-label,
.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 740px;
  margin: 17px 0 20px;
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 640;
  letter-spacing: -0.075em;
  line-height: 0.98;
}

.hero-intro {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.hero-actions {
  gap: 22px;
  margin-top: 32px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 730;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  min-height: 44px;
  padding: 0 17px;
  background: var(--ink);
  color: var(--white);
}

.primary-button:hover {
  background: #2c3830;
  box-shadow: 4px 4px 0 var(--accent-deep);
  transform: translate(-1px, -1px);
}

.keyboard-hint {
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

kbd {
  min-width: 23px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.hero-stat {
  min-height: 96px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.36);
}

.hero-stat-accent {
  border-color: var(--ink);
  background: var(--accent);
}

.hero-stat strong {
  grid-row: 1 / 3;
  grid-column: 2;
  margin-left: 25px;
  font-size: 42px;
  font-weight: 620;
  letter-spacing: -0.08em;
  line-height: 1;
}

.stat-label {
  color: var(--ink);
  font-size: 9px;
}

.stat-detail {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.search-bar-wrap {
  padding: 0 0 63px;
}

.search-bar {
  min-height: 67px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 19px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--white);
  box-shadow: 7px 7px 0 var(--line);
}

.search-icon {
  color: var(--accent-deep);
  font-size: 28px;
  line-height: 1;
  transform: rotate(-18deg);
}

.search-bar input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-bar input::placeholder {
  color: #8a958e;
}

.search-shortcut {
  background: var(--paper);
}

.clear-search {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.search-note {
  gap: 8px;
  margin: 19px 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.note-star {
  color: var(--accent-deep);
  font-size: 15px;
}

.workspace {
  display: grid;
  grid-template-columns: 190px minmax(360px, 1.28fr) minmax(300px, 0.82fr);
  gap: 29px;
  align-items: start;
  scroll-margin-top: 24px;
}

.sidebar {
  position: sticky;
  top: 25px;
}

.sidebar-group {
  padding-bottom: 28px;
}

.sidebar-label {
  margin-bottom: 12px;
}

.filter-button,
.run-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.filter-button {
  min-height: 36px;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border-radius: 5px;
  font-size: 13px;
}

.filter-button:hover,
.filter-button.active {
  background: var(--white);
  color: var(--ink);
}

.filter-button.active {
  box-shadow: inset 3px 0 0 var(--accent-deep);
  font-weight: 720;
}

.filter-icon {
  color: var(--accent-deep);
  font-size: 17px;
  line-height: 1;
}

.filter-count,
.sidebar-total,
.run-count {
  color: #8a958e;
  font-size: 11px;
}

.sidebar-heading-row {
  justify-content: space-between;
  margin-bottom: 12px;
}

.sidebar-heading-row .sidebar-label {
  margin-bottom: 0;
}

.run-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 504px;
  overflow: auto;
  scrollbar-width: thin;
}

.run-button {
  min-height: 32px;
  display: flex;
  justify-content: space-between;
  padding: 0 9px;
  border-radius: 5px;
  font-size: 12px;
}

.run-button:hover,
.run-button.active {
  background: var(--white);
  color: var(--ink);
}

.run-button.active .run-date {
  font-weight: 750;
}

.results-panel {
  min-width: 0;
}

.results-header {
  min-height: 69px;
  padding-bottom: 19px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-strong);
}

.results-header h2 {
  margin: 7px 0 0;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.055em;
}

.results-meta {
  gap: 8px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.query-chip {
  max-width: 135px;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idea-list {
  display: flex;
  flex-direction: column;
}

.idea-card {
  position: relative;
  padding: 22px 4px 23px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: padding 160ms ease, background 160ms ease;
}

.idea-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -12px;
  width: 3px;
  background: transparent;
  transition: background 160ms ease;
}

.idea-card:hover,
.idea-card.selected {
  padding-left: 14px;
  background: rgba(255, 255, 255, 0.35);
}

.idea-card:hover::before,
.idea-card.selected::before {
  background: var(--accent-deep);
}

.idea-card:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: -2px;
}

.idea-card-top {
  justify-content: space-between;
  margin-bottom: 13px;
}

.idea-index {
  color: var(--accent-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
}

.idea-date {
  color: #89948d;
  font-size: 11px;
}

.idea-card h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.055em;
}

.idea-audience {
  margin: 6px 0 0;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 690;
  line-height: 1.4;
}

.idea-problem {
  max-width: 510px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.idea-card-footer {
  justify-content: space-between;
  margin-top: 20px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 720;
  opacity: 0;
  transition: opacity 160ms ease;
}

.idea-card:hover .idea-card-footer,
.idea-card.selected .idea-card-footer {
  opacity: 1;
}

.card-arrow {
  font-size: 17px;
  font-weight: 400;
}

.detail-panel {
  position: sticky;
  top: 25px;
  min-height: 550px;
  padding: 28px 26px 23px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 8px 8px 0 var(--accent);
}

.detail-topline {
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.17);
}

.detail-kicker,
.detail-date {
  color: var(--accent);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-date {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 650;
  letter-spacing: 0.04em;
}

.detail-panel h2 {
  margin: 26px 0 23px;
  color: var(--white);
  font-size: 34px;
  font-weight: 620;
  letter-spacing: -0.07em;
  line-height: 1;
}

.detail-audience,
.detail-section {
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.17);
}

.detail-panel .detail-label {
  display: block;
  color: rgba(255, 255, 255, 0.53);
  font-size: 9px;
}

.detail-panel p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.87);
  font-size: 13px;
  line-height: 1.5;
}

.detail-audience p {
  color: var(--accent);
  font-weight: 640;
}

.why-card {
  margin-top: 9px;
  padding: 16px;
  border-radius: 5px;
  background: rgba(200, 243, 106, 0.14);
}

.why-card .detail-label {
  color: var(--accent);
}

.why-card p {
  color: rgba(255, 255, 255, 0.84);
}

.detail-footer {
  justify-content: space-between;
  gap: 20px;
  margin-top: 26px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  line-height: 1.4;
}

.detail-mark {
  color: var(--accent);
  font-size: 20px;
}

.detail-empty {
  height: 100%;
  min-height: 500px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.detail-empty .empty-icon {
  color: var(--accent);
}

.loading-list {
  display: flex;
  flex-direction: column;
}

.loading-card {
  height: 176px;
  margin-bottom: 1px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  background-size: 240% 100%;
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -40% 0;
  }
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 28px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 20px;
  letter-spacing: -0.04em;
}

.empty-state p {
  max-width: 270px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.empty-icon {
  color: var(--accent-deep);
  font-size: 28px;
}

.secondary-button {
  min-height: 37px;
  padding: 0 13px;
  border-color: var(--line-strong);
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
}

.secondary-button:hover {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--accent);
}

.archive-note {
  position: relative;
  min-height: 177px;
  margin: 103px 0 90px;
  padding: 36px 40px;
  display: grid;
  grid-template-columns: 50px minmax(0, 500px) 1fr;
  gap: 22px;
  align-items: start;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--warm);
}

.archive-note-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent);
  font-size: 21px;
}

.archive-note h2 {
  margin: 8px 0 8px;
  font-size: 25px;
  font-weight: 680;
  letter-spacing: -0.055em;
}

.archive-note p:last-child {
  max-width: 510px;
  margin: 0;
  color: #706653;
  font-size: 13px;
  line-height: 1.55;
}

.archive-note-line {
  width: 180px;
  height: 180px;
  justify-self: end;
  margin: -86px 56px 0 0;
  border: 1px solid rgba(24, 33, 29, 0.19);
  border-radius: 50%;
  box-shadow: 0 0 0 15px rgba(24, 33, 29, 0.04), 0 0 0 30px rgba(24, 33, 29, 0.04);
}

.footer {
  width: min(1440px, calc(100% - 64px));
  min-height: 80px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.footer span:first-child {
  color: var(--ink);
  font-weight: 740;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 170px minmax(340px, 1fr);
  }

  .detail-panel {
    grid-column: 2;
    position: relative;
    top: auto;
    min-height: auto;
    margin-top: 12px;
  }
}

@media (max-width: 760px) {
  .topbar,
  .page,
  .footer {
    width: min(100% - 32px, 620px);
  }

  .topbar {
    min-height: 68px;
  }

  .brand-tag,
  .topbar-divider,
  .topbar-date {
    display: none;
  }

  .hero {
    padding: 57px 0 48px;
    grid-template-columns: 1fr;
    gap: 39px;
  }

  .hero h1 {
    font-size: clamp(42px, 13vw, 61px);
  }

  .hero-intro {
    font-size: 15px;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .hero-stat {
    min-height: 109px;
    padding: 13px;
    display: block;
  }

  .hero-stat strong {
    display: block;
    margin: 14px 0 0;
    font-size: 31px;
  }

  .stat-detail {
    display: none;
  }

  .search-bar-wrap {
    padding-bottom: 47px;
  }

  .search-bar {
    min-height: 58px;
    padding: 0 14px;
  }

  .search-bar input {
    font-size: 14px;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    position: relative;
    top: auto;
    display: flex;
    gap: 15px;
    margin-bottom: 33px;
    overflow: auto;
  }

  .sidebar-group {
    min-width: max-content;
    padding: 0;
  }

  .runs-group {
    flex: 1;
  }

  .sidebar-label,
  .sidebar-heading-row {
    display: none;
  }

  .filter-button {
    min-width: 118px;
    min-height: 35px;
  }

  .filter-button.active {
    box-shadow: inset 0 -3px 0 var(--accent-deep);
  }

  .run-list {
    flex-direction: row;
    max-width: calc(100vw - 160px);
    max-height: none;
  }

  .run-button {
    min-width: 62px;
    justify-content: center;
    padding: 0 10px;
  }

  .run-count {
    display: none;
  }

  .detail-panel {
    margin-top: 29px;
  }

  .archive-note {
    margin: 73px 0 64px;
    padding: 26px;
    grid-template-columns: 1fr;
  }

  .archive-note-line {
    position: absolute;
    right: -37px;
    bottom: -99px;
    margin: 0;
  }

  .footer {
    min-height: 68px;
    gap: 10px;
  }
}

@media (max-width: 460px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stat {
    min-height: 79px;
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .hero-stat strong {
    grid-row: 1 / 3;
    grid-column: 2;
    display: block;
    margin: 0 0 0 12px;
  }

  .stat-detail {
    display: block;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }

  .results-header {
    display: block;
  }

  .results-meta {
    margin-top: 11px;
  }

  .detail-panel {
    padding: 23px 20px 20px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

/* The original reader remains a side panel on larger screens and becomes the
   full-page mobile brief requested for the Hostinger archive. */
@media (max-width: 760px) {
  .detail-panel {
    display: none;
  }

  .detail-panel.is-open {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 24px 20px 36px;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.detail-open {
    overflow: hidden;
  }

  .detail-panel.is-open .detail-close {
    display: inline-flex;
  }

  .detail-panel.is-open .detail-topline {
    position: sticky;
    top: -24px;
    z-index: 1;
    margin: -24px -20px 20px;
    padding: 20px;
    background: rgba(24, 33, 29, 0.97);
    backdrop-filter: blur(10px);
  }

  .detail-panel.is-open h2 {
    max-width: 13ch;
    overflow-wrap: anywhere;
  }
}
