:root {
  --bg: #fbf7ef;
  --surface: #fffdfa;
  --surface-strong: #ffffff;
  --ink: #071126;
  --muted: #606776;
  --line: #e6ddd1;
  --line-strong: #d9cec0;
  --red: #bd211f;
  --red-dark: #961817;
  --red-soft: #fff0ed;
  --cream: #f4eee4;
  --shadow-sm: 0 8px 20px rgba(24, 19, 12, 0.045);
  --shadow-md: 0 18px 44px rgba(24, 19, 12, 0.09);
  --radius: 8px;
  --container: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(189, 33, 31, 0.035), transparent 34rem),
    var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body.menu-open,
body.modal-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 247, 239, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  transition: box-shadow 180ms ease, background 180ms ease;
}

.site-header.is-scrolled {
  background: rgba(255, 253, 250, 0.96);
  box-shadow: 0 10px 28px rgba(14, 18, 31, 0.08);
}

.navbar {
  display: flex;
  align-items: center;
  width: min(100% - 40px, var(--container));
  min-height: 66px;
  margin: 0 auto;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-size: clamp(0.98rem, 1.4vw, 1.17rem);
  font-weight: 850;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  min-width: 31px;
  height: 31px;
  border: 1px solid var(--red);
  border-radius: 7px;
  background: #fff7f5;
  color: var(--red);
}

.brand-mark svg,
.nav-search svg,
.search-btn svg,
.stat-icon svg,
.strip-icon svg,
.card-footer svg,
.read-story-btn svg,
.bookmark-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  gap: 16px;
  min-width: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  gap: clamp(10px, 1.25vw, 20px);
  min-width: 0;
}

.nav-link,
.text-link {
  border: 0;
  background: transparent;
  color: #101522;
  font-weight: 650;
  letter-spacing: 0;
}

.nav-link {
  padding: 9px 0;
  font-size: 0.92rem;
  white-space: nowrap;
}

.nav-link:hover,
.text-link:hover {
  color: var(--red);
}

.nav-dropdown {
  position: relative;
}

.category-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: -8px;
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.category-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.category-menu button {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 0.92rem;
  font-weight: 650;
}

.category-menu button:hover {
  background: var(--red-soft);
  color: var(--red);
}

.nav-search,
.hero-search {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.nav-search:focus-within,
.hero-search:focus-within {
  border-color: rgba(189, 33, 31, 0.42);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(189, 33, 31, 0.08);
}

.nav-search {
  flex: 0 1 250px;
  width: 250px;
  min-width: 190px;
  height: 42px;
}

.nav-search input,
.hero-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.nav-search input {
  padding: 0 10px 0 14px;
  font-size: 0.92rem;
}

.nav-search button {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: #4d5563;
}

.primary-btn,
.search-btn,
.outline-btn {
  border-radius: 8px;
  font-weight: 750;
  letter-spacing: 0;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.primary-btn,
.search-btn {
  border: 1px solid var(--red);
  background: linear-gradient(180deg, #c62b28, #a91918);
  color: #fff;
}

.primary-btn {
  flex: 0 0 auto;
  padding: 11px 16px;
  font-size: 0.92rem;
  white-space: nowrap;
}

.primary-btn:hover,
.search-btn:hover {
  background: linear-gradient(180deg, #d03632, #971716);
  box-shadow: 0 10px 22px rgba(189, 33, 31, 0.18);
  transform: translateY(-1px);
}

.outline-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(189, 33, 31, 0.6);
  background: #fffaf8;
  color: var(--red);
  padding: 11px 16px;
}

.outline-btn:hover {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 22px rgba(189, 33, 31, 0.16);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
  transition: transform 180ms ease, opacity 180ms ease;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 500px);
  align-items: center;
  gap: clamp(32px, 5vw, 56px);
  width: min(100% - 40px, var(--container));
  margin: 0 auto;
  padding: clamp(34px, 5vw, 58px) 0 clamp(30px, 4vw, 44px);
}

.hero h1 {
  max-width: 620px;
  margin: 0 0 16px;
  font-size: clamp(3.4rem, 6vw, 5.05rem);
  line-height: 1.01;
  font-weight: 880;
  letter-spacing: 0;
}

.hero h1 span {
  display: block;
  color: var(--red);
}

.hero-copy > p {
  max-width: 610px;
  margin: 0 0 22px;
  color: #172031;
  font-size: clamp(1rem, 1.35vw, 1.08rem);
}

.hero-search {
  width: min(100%, 540px);
  height: 54px;
}

.hero-search input {
  padding: 0 17px;
  font-size: 0.98rem;
}

.search-btn {
  display: grid;
  place-items: center;
  width: 64px;
  min-width: 64px;
  height: 54px;
  border-radius: 0;
}

.search-btn svg {
  width: 22px;
  height: 22px;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 0;
  margin-top: 26px;
}

.stats-row div {
  display: grid;
  grid-template-columns: 30px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 9px;
  padding: 0 22px;
  border-right: 1px solid var(--line);
}

.stats-row div:first-child {
  padding-left: 0;
}

.stats-row div:last-child {
  border-right: 0;
}

.stat-icon {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--red);
}

.stat-icon svg {
  width: 27px;
  height: 27px;
  stroke-width: 1.8;
}

.stats-row strong {
  color: #0b1220;
  font-size: 1rem;
  line-height: 1.05;
}

.stats-row small {
  color: #272e3b;
  font-size: 0.82rem;
}

.featured-card {
  display: grid;
  grid-template-columns: minmax(156px, 190px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  min-height: 292px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 250, 0.82);
  box-shadow: var(--shadow-sm);
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 180ms ease;
}

.featured-card:hover {
  box-shadow: var(--shadow-md);
}

.featured-card.is-changing {
  opacity: 0;
  transform: translateX(14px);
}

.featured-visual,
.card-visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

.featured-visual {
  height: 236px;
  border-radius: 16px;
}

.featured-visual::after,
.card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.18), transparent 25%),
    linear-gradient(125deg, rgba(255, 255, 255, 0.06), transparent 46%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.featured-card h2 {
  margin: 0 0 5px;
  font-size: 1.72rem;
  line-height: 1.12;
  font-weight: 800;
}

.meta {
  color: #313847;
  font-size: 0.9rem;
  font-weight: 520;
}

.featured-content > p:not(.eyebrow):not(.meta) {
  max-width: 310px;
  margin: 16px 0 22px;
  color: #161d2b;
  font-size: 0.96rem;
}

.carousel-dots {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.carousel-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #cfc8be;
  transition: width 160ms ease, background 160ms ease;
}

.carousel-dots button.is-active {
  width: 22px;
  border-radius: 999px;
  background: var(--red);
}

.failures-section {
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.52);
  padding: 28px 0 34px;
}

.section-heading,
.failure-grid,
.feature-strip,
.results-status {
  width: min(100% - 40px, var(--container));
  margin-right: auto;
  margin-left: auto;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2,
.filter-label {
  margin: 0;
}

.section-heading h2 {
  font-size: clamp(1.35rem, 2vw, 1.58rem);
  line-height: 1.2;
  font-weight: 800;
}

.filter-label {
  min-height: 0;
  margin-bottom: 2px;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 750;
}

.filter-label:empty {
  display: none;
}

.text-link {
  color: var(--red);
  font-size: 0.92rem;
  white-space: nowrap;
}

.results-status {
  min-height: 22px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.failure-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.failure-card {
  display: flex;
  flex-direction: column;
  min-height: 372px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  overflow: hidden;
  box-shadow: 0 5px 16px rgba(18, 15, 10, 0.035);
  opacity: 0;
  transform: translateY(10px);
  animation: cardIn 260ms ease forwards;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.failure-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 34px rgba(18, 15, 10, 0.1);
}

.failure-card:hover .card-visual::before {
  transform: scale(1.045);
}

.card-visual {
  height: 122px;
  color: #fff;
}

.card-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--visual-bg);
  transition: transform 240ms ease;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 15px 16px 14px;
}

.card-body h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  line-height: 1.2;
  font-weight: 780;
}

.card-body .meta {
  margin: 0 0 10px;
  color: #3c4454;
  font-size: 0.8rem;
}

.card-body p {
  margin: 0;
  color: #1d2430;
  font-size: 0.89rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.tag {
  border: 1px solid #ecdcd7;
  border-radius: 999px;
  background: #fff9f7;
  color: var(--red-dark);
  padding: 4px 7px;
  font-size: 0.68rem;
  font-weight: 720;
  line-height: 1.1;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.tag:hover {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.card-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: auto;
  padding-top: 16px;
  color: #384152;
  font-size: 0.82rem;
}

.card-footer span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-footer svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.9;
}

.read-story-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 760;
  padding: 0;
}

.read-story-btn svg {
  width: 15px;
  height: 15px;
}

.read-story-btn:hover {
  color: var(--red-dark);
}

.bookmark-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #242c39;
}

.bookmark-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}

.bookmark-btn:hover,
.bookmark-btn.is-saved {
  border-color: #f0d5d0;
  background: var(--red-soft);
  color: var(--red);
}

.bookmark-btn.is-saved svg {
  fill: currentColor;
}

.bookmark-btn.is-popping {
  animation: bookmarkPop 280ms ease;
}

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

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 0;
  margin-bottom: 44px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 250, 0.86);
  box-shadow: 0 5px 18px rgba(18, 15, 10, 0.025);
}

.feature-strip > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.strip-icon {
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  border: 1px solid #f0d5d0;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
}

.strip-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.9;
}

.feature-strip h3,
.feature-strip p {
  margin: 0;
}

.feature-strip h3 {
  font-size: 0.95rem;
  line-height: 1.2;
}

.feature-strip p {
  color: var(--muted);
  font-size: 0.84rem;
}

.brand-visual {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
}

.logo-plate {
  position: relative;
  display: grid;
  place-items: center;
  width: min(76%, 210px);
  min-height: 66px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.14);
}

.brand-visual.is-featured .logo-plate {
  width: min(82%, 280px);
  min-height: 96px;
  padding: 22px 24px;
  border-radius: 18px;
}

.real-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
}

.brand-visual.is-featured .real-logo {
  max-height: 110px;
}

.logo-error .real-logo {
  display: none;
}

.uses-real-logo .fallback-mark {
  display: none;
  color: var(--ink);
}

.uses-real-logo.logo-error .fallback-mark {
  display: grid;
}

.brand-visual-quibi .logo-plate {
  background: rgba(8, 12, 25, 0.72);
  border-color: rgba(157, 77, 255, 0.44);
}

.brand-visual-google-plus .logo-plate,
.brand-visual-pets-com .logo-plate,
.brand-visual-glass .logo-plate {
  background: rgba(255, 255, 255, 0.94);
}

.brand-visual-jawbone .logo-plate {
  background: rgba(255, 255, 255, 0.82);
}

.brand-visual-vine .logo-plate {
  background: rgba(255, 255, 255, 0.95);
}

.brand-visual svg {
  max-width: 78%;
  max-height: 78%;
}

.brand-visual.is-featured svg {
  max-width: 86%;
  max-height: 86%;
}

.quibi-mark {
  position: relative;
  color: #8e31f5;
  font-size: 5.1rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 18px 26px rgba(87, 25, 193, 0.34);
}

.brand-visual.is-featured .quibi-mark {
  font-size: 7.2rem;
}

.gplus-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: #fff;
  font-size: 3.4rem;
  font-weight: 760;
  line-height: 1;
}

.brand-visual.is-featured .gplus-mark {
  font-size: 4.8rem;
}

.gplus-mark i {
  font-style: normal;
  font-weight: 450;
}

.jawbone-mark {
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.18));
}

.pets-paw {
  position: relative;
  width: 38px;
  height: 34px;
  margin-right: 8px;
}

.pets-paw,
.pets-word {
  display: inline-block;
  vertical-align: middle;
}

.pets-paw::after,
.pets-paw i {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.pets-paw::after {
  left: 10px;
  bottom: 2px;
  width: 21px;
  height: 19px;
}

.pets-paw i:nth-child(1) { left: 2px; top: 11px; width: 10px; height: 10px; }
.pets-paw i:nth-child(2) { left: 10px; top: 1px; width: 10px; height: 12px; }
.pets-paw i:nth-child(3) { left: 23px; top: 1px; width: 10px; height: 12px; }
.pets-paw i:nth-child(4) { right: 0; top: 11px; width: 10px; height: 10px; }

.pets-word {
  font-size: 2rem;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-visual.is-featured .pets-word {
  font-size: 2.6rem;
}

.vine-mark {
  width: 88px;
  color: #fff;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.17));
}

.brand-visual.is-featured .vine-mark {
  width: 128px;
}

.glass-mark {
  color: #fff;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.18));
}

.fallback-mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 850;
}

.visual-quibi {
  --visual-bg: radial-gradient(circle at 50% 76%, rgba(124, 49, 255, 0.58), transparent 22%), linear-gradient(135deg, #071126, #111629 52%, #050814);
  background: var(--visual-bg);
}

.visual-google-plus {
  --visual-bg: linear-gradient(135deg, #c92926, #ec463f);
  background: var(--visual-bg);
}

.visual-jawbone {
  --visual-bg: radial-gradient(circle at 50% 22%, #f6f0e7, #d8d0c4 58%, #b8afa3);
  background: var(--visual-bg);
}

.visual-pets {
  --visual-bg: linear-gradient(135deg, #062d3d, #0b5164);
  background: var(--visual-bg);
}

.visual-vine {
  --visual-bg: linear-gradient(135deg, #00a478, #007260);
  background: var(--visual-bg);
}

.visual-glass {
  --visual-bg: linear-gradient(135deg, #101827, #316d9d 56%, #cfe6f8);
  background: var(--visual-bg);
}

.visual-user {
  --visual-bg: linear-gradient(135deg, #252b36, #bd211f);
  background: var(--visual-bg);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 20px;
  background: rgba(7, 10, 18, 0.48);
  opacity: 0;
  transition: opacity 180ms ease;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop.is-open {
  opacity: 1;
}

.modal {
  position: relative;
  width: min(680px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  transform: scale(0.96) translateY(10px);
  transition: transform 180ms ease;
}

.modal-backdrop.is-open .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: sticky;
  top: 14px;
  float: right;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 14px 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 1.45rem;
}

.modal-content {
  padding: 34px;
}

.modal-content h2 {
  margin: 0 0 6px;
  font-size: 1.9rem;
  line-height: 1.15;
}

.modal-content h3 {
  margin: 24px 0 8px;
}

.modal-content p,
.modal-content li {
  color: #202631;
}

.modal-content ul {
  padding-left: 20px;
}

.modal-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.modal-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
}

.modal-form input,
.modal-form textarea,
.modal-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
}

.modal-form input:focus,
.modal-form textarea:focus,
.modal-form select:focus {
  border-color: rgba(189, 33, 31, 0.42);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(189, 33, 31, 0.08);
}

.modal-form textarea {
  min-height: 110px;
  resize: vertical;
}

.blog-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.blog-list article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.blog-list h3,
.blog-list p {
  margin: 0;
}

.blog-list p {
  margin-top: 6px;
}

.story-page {
  width: min(100% - 40px, var(--container));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  color: var(--red);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
}

.back-link:hover {
  color: var(--red-dark);
}

.story-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 250, 0.9);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.story-hero {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 30px;
  border-bottom: 1px solid var(--line);
}

.story-logo {
  display: grid;
  place-items: center;
  height: 230px;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
}

.story-logo .brand-visual {
  min-height: 100%;
}

.story-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 1;
  font-weight: 880;
  letter-spacing: 0;
}

.story-meta {
  margin: 0 0 18px;
  color: #343c4b;
  font-weight: 650;
}

.story-summary {
  max-width: 660px;
  margin: 0;
  color: #172031;
  font-size: 1.08rem;
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 38px;
  padding: 32px 30px 36px;
}

.story-main h2,
.story-aside h2 {
  margin: 0 0 10px;
  font-size: 1.12rem;
  line-height: 1.2;
}

.story-main h2:not(:first-child) {
  margin-top: 28px;
}

.story-main p,
.story-main li,
.story-not-found p {
  color: #202838;
}

.story-main p {
  margin: 0;
  max-width: 780px;
  font-size: 1rem;
}

.story-main ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.story-aside {
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf6;
}

.story-aside .tag-row {
  margin-top: 0;
  margin-bottom: 18px;
}

.story-aside .tag {
  text-decoration: none;
}

.story-bookmark {
  width: 100%;
  justify-content: center;
}

.story-bookmark.is-saved {
  background: var(--red);
  color: #fff;
}

.primary-link {
  display: inline-flex;
  margin-top: 14px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  padding: 11px 16px;
  font-weight: 750;
  text-decoration: none;
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bookmarkPop {
  50% {
    transform: scale(1.22);
  }
}

@media (max-width: 1120px) {
  .navbar {
    width: min(100% - 32px, var(--container));
  }

  .brand {
    font-size: 0.98rem;
  }

  .nav-panel {
    gap: 12px;
  }

  .nav-links {
    gap: 11px;
  }

  .nav-link {
    font-size: 0.88rem;
  }

  .nav-search {
    flex-basis: 210px;
    min-width: 160px;
  }

  .primary-btn {
    padding-inline: 13px;
  }

  .hero {
    grid-template-columns: 1fr;
    width: min(100% - 32px, 860px);
  }

  .featured-card {
    width: min(720px, 100%);
  }

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

@media (max-width: 920px) {
  .navbar {
    min-height: 66px;
  }

  .menu-toggle {
    display: block;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-panel {
    position: fixed;
    top: 66px;
    right: 0;
    bottom: 0;
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    width: min(380px, 88vw);
    padding: 22px;
    border-left: 1px solid var(--line);
    background: var(--surface-strong);
    box-shadow: -18px 0 38px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 220ms ease;
  }

  .nav-panel.is-open {
    transform: translateX(0);
  }

  .nav-links {
    align-items: stretch;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 7px;
  }

  .nav-link {
    width: 100%;
    padding: 12px 0;
    text-align: left;
  }

  .nav-search {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
  }

  .submit-btn {
    width: 100%;
  }

  .category-menu {
    position: static;
    display: none;
    min-width: 0;
    margin-top: 4px;
    box-shadow: none;
    transform: none;
  }

  .category-menu.is-open {
    display: block;
  }

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

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

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

  .story-logo {
    height: 210px;
  }
}

@media (max-width: 680px) {
  .navbar,
  .hero,
  .section-heading,
  .failure-grid,
  .feature-strip,
  .results-status {
    width: min(100% - 28px, var(--container));
  }

  .brand span:last-child {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero {
    gap: 26px;
    padding-top: 30px;
  }

  .hero h1 {
    font-size: clamp(3rem, 14vw, 3.55rem);
  }

  .hero-search {
    height: 52px;
  }

  .search-btn {
    width: 58px;
    min-width: 58px;
    height: 52px;
  }

  .stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 10px;
  }

  .stats-row div {
    padding: 0;
    border-right: 0;
  }

  .featured-card {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: 0;
    padding: 16px;
  }

  .featured-visual {
    height: 202px;
  }

  .failure-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .failure-card {
    min-height: 0;
  }

  .card-visual {
    height: 132px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .feature-strip {
    padding: 16px;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-content {
    padding: 28px 20px;
  }

  .modal-content h2 {
    font-size: 1.55rem;
  }

  .story-page {
    width: min(100% - 28px, var(--container));
    padding-top: 24px;
  }

  .story-hero,
  .story-grid {
    padding: 20px;
  }

  .story-hero {
    gap: 20px;
  }

  .story-logo {
    height: 190px;
  }

  .story-summary {
    font-size: 1rem;
  }
}

@media (max-width: 390px) {
  .brand span:last-child {
    max-width: 168px;
  }

  .card-footer {
    gap: 9px;
  }

  .read-story-btn {
    order: 4;
    width: 100%;
  }
}
