:root {
  --bg: #ffffff;
  --bg-alt: #f6f5f4;
  --ink: rgba(0,0,0,0.95);
  --muted: #615d59;
  --muted-light: #a39e98;
  --soft: #f6f5f4;
  --line: rgba(0,0,0,0.1);
  --panel: #ffffff;
  --panel-2: #f6f5f4;
  --accent: #0075de;
  --accent-hover: #005bab;
  --accent-2: #ef4444;
  --accent-3: #f59e0b;
  --blue: #0075de;
  --focus-blue: #097fe8;
  --badge-bg: #f2f9ff;
  --badge-text: #097fe8;
  --shadow-card: rgba(0,0,0,0.04) 0px 4px 18px, rgba(0,0,0,0.027) 0px 2.025px 7.85px, rgba(0,0,0,0.02) 0px 0.8px 2.93px, rgba(0,0,0,0.01) 0px 0.175px 1.04px;
  --shadow-deep: rgba(0,0,0,0.01) 0px 1px 3px, rgba(0,0,0,0.02) 0px 3px 7px, rgba(0,0,0,0.02) 0px 7px 15px, rgba(0,0,0,0.04) 0px 14px 28px, rgba(0,0,0,0.05) 0px 23px 52px;
  --page: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, system-ui, "Segoe UI", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  width: min(calc(100% - 40px), var(--page));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.1;
}

.brand-copy small {
  color: var(--muted-light);
  font-size: 12px;
  font-weight: 400;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.topbar-links a {
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.topbar-links a:hover {
  color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 36px;
  align-items: end;
  padding: 36px 0 32px;
}

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

.eyebrow,
.stat-label,
.modal-kicker,
.prompt-head span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.125px;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  max-width: 980px;
  font-size: 48px;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -1.5px;
}

.hero-desc {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e8e7e5;
  box-shadow: var(--shadow-card);
}

.stat-block {
  min-height: 126px;
  padding: 18px;
  background: var(--panel);
}

.stat-block strong {
  display: block;
  margin-top: 10px;
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.5px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px 0;
  background: rgba(246, 245, 244, 0.92);
  backdrop-filter: blur(12px);
}

.search-box {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  min-height: 48px;
  border: 1px solid #dddddd;
  border-radius: 4px;
  background: var(--panel);
}

.search-box span {
  color: var(--muted-light);
  text-align: center;
  font-size: 20px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-box input::placeholder {
  color: var(--muted-light);
}

.search-box:focus-within {
  border-color: var(--focus-blue);
  box-shadow: 0 0 0 2px rgba(9, 127, 232, 0.15);
}

.view-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--muted);
  font-size: 20px;
  transition: background 0.15s, color 0.15s;
}

.icon-button:hover {
  background: var(--soft);
  color: var(--ink);
}

.icon-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 22px;
}

.filter-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--panel);
  color: var(--muted);
  padding: 4px 14px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-button:hover {
  background: var(--soft);
  color: var(--ink);
}

.filter-button.is-active {
  border-color: transparent;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-weight: 600;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 18px;
}

.section-head h2 {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.23;
  letter-spacing: -0.625px;
}

.section-head p:last-child {
  margin: 0;
  color: var(--muted-light);
  font-size: 14px;
  font-weight: 500;
}

.featured-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.feature-tile,
.case-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s;
}

.feature-tile:hover,
.case-card:hover {
  box-shadow: var(--shadow-deep);
}

.feature-tile {
  min-height: 190px;
  isolation: isolate;
}

.feature-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 22%, rgba(0, 0, 0, 0.74) 100%);
  pointer-events: none;
}

.feature-tile img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  transform: scale(1.02);
}

.feature-tile button {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  background: transparent;
  color: #ffffff;
  padding: 0;
  text-align: left;
}

.feature-copy {
  position: absolute;
  inset: auto 14px 14px;
  z-index: 2;
}

.feature-copy span,
.card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 9999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.125px;
}

.feature-copy strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.25;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 44px;
}

.case-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.case-button {
  display: grid;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.media-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  background: transparent;
}

.card-media {
  position: relative;
  background: var(--soft);
  aspect-ratio: 4 / 5;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
}

.favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 16px;
  transition: background 0.15s, color 0.15s;
}

.favorite-button:hover {
  background: #ffffff;
  color: var(--accent-2);
}

.favorite-button.is-active {
  background: var(--accent-2);
  color: #ffffff;
  border-color: transparent;
}

.card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.27;
  letter-spacing: -0.25px;
}

.card-summary {
  display: -webkit-box;
  min-height: 68px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted-light);
  font-size: 12px;
  font-weight: 400;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--soft);
  padding: 48px;
  color: var(--muted);
  text-align: center;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  padding: 24px;
}

.modal-layer.is-open {
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  width: min(1180px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-deep);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-media {
  min-height: 520px;
  background: var(--soft);
}

.modal-media img {
  width: 100%;
  height: 100%;
  max-height: min(860px, calc(100vh - 48px));
  object-fit: contain;
}

.modal-content {
  display: grid;
  align-content: start;
  gap: 14px;
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  padding: 34px;
}

.modal-content h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.23;
  letter-spacing: -0.625px;
}

.modal-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--soft);
  padding: 4px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.copy-button {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}

.copy-button:hover {
  background: var(--accent-hover);
}

.prompt-box {
  max-height: 280px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #31302e;
  color: #f6f5f4;
  padding: 16px;
  white-space: pre-wrap;
}

.prompt-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.prompt-box-agent {
  background: #171f2d;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  color: var(--muted-light);
  font-size: 14px;
  font-weight: 400;
}

.site-footer a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover {
  color: var(--accent);
}

@media (max-width: 1180px) {
  h1 {
    font-size: 40px;
    letter-spacing: -1px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 28px 0 24px;
  }

  .hero-panel {
    max-width: 560px;
  }

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

@media (max-width: 860px) {
  h1 {
    font-size: 34px;
    letter-spacing: -0.75px;
  }

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

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

  .view-actions {
    justify-content: flex-end;
  }

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

  .modal-card {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .modal-media {
    min-height: 360px;
  }

  .modal-content {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(calc(100% - 28px), var(--page));
  }

  h1 {
    font-size: 26px;
    letter-spacing: -0.5px;
    line-height: 1.23;
  }

  .hero {
    padding: 20px 0;
  }

  .hero-desc {
    font-size: 16px;
  }

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

  .featured-strip,
  .grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-layer {
    padding: 12px;
  }

  .modal-content {
    padding: 22px;
  }

  .modal-content h2 {
    font-size: 22px;
    letter-spacing: -0.25px;
  }
}

/* Notion-style warm alternating section */
.cases-section {
  background: var(--bg-alt);
  padding-top: 8px;
  padding-bottom: 32px;
}

/* Focus accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--focus-blue);
  outline-offset: 2px;
}

/* Smooth transitions for interactive elements */
a {
  transition: color 0.15s;
}
