:root {
  --paper: #f7f2e9;
  --paper-deep: #efe6d6;
  --ink: #121212;
  --muted: #625d56;
  --line: rgba(18, 18, 18, 0.12);
  --line-strong: rgba(18, 18, 18, 0.2);
  --accent: #976330;
  --accent-soft: rgba(151, 99, 48, 0.12);
  --rose: #8f3d4c;
  --rose-soft: rgba(143, 61, 76, 0.08);
  --warm-ink: #2a201c;
  --shadow: 0 24px 70px rgba(17, 17, 17, 0.15);
  --radius: 28px;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(143, 61, 76, 0.14), transparent 30%),
    radial-gradient(circle at bottom right, rgba(151, 99, 48, 0.16), transparent 32%),
    linear-gradient(180deg, #fbf7f0 0%, var(--paper) 55%, #f3ebde 100%);
  font-family: "Manrope", sans-serif;
}

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

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
}

.site-header,
main,
.site-footer {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

.utility-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.65rem 0 0.15rem;
}

.header-logo img {
  width: clamp(124px, 11vw, 150px);
  height: auto;
  object-fit: contain;
}

.masthead-row {
  padding: 0 0 2rem;
  border-bottom: 2px solid var(--ink);
}

.masthead-row > div {
  max-width: 900px;
}

.kicker,
.section-label,
.story-rank {
  margin: 0;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.masthead {
  margin: 0.35rem 0 0;
  font-family: "Bodoni Moda", serif;
  font-size: clamp(3.8rem, 9vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.masthead-subtitle {
  display: inline-block;
  margin: 0.6rem 0 0;
  padding-bottom: 0.7rem;
  color: var(--warm-ink);
  font-size: clamp(1.35rem, 3.6vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
}

.masthead-subtitle::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(140px, 100%);
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose) 0%, #d48d62 100%);
}

.header-copy {
  display: grid;
  gap: 0.9rem;
  justify-items: start;
  margin-top: 1.1rem;
  max-width: 760px;
}

.header-dek,
.header-note,
.intro-note,
.story-subtitle,
.story-life,
.site-footer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.header-dek {
  max-width: 42ch;
  color: var(--warm-ink);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  font-weight: 500;
  line-height: 1.55;
}

.header-note {
  max-width: 48ch;
  font-size: clamp(0.98rem, 1.5vw, 1.08rem);
  color: #5f5550;
}

.intro-note {
  max-width: 34ch;
  color: var(--warm-ink);
  font-size: clamp(1rem, 1.7vw, 1.12rem);
  font-weight: 500;
  line-height: 1.45;
}

.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.9rem 1.35rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.header-link:hover,
.header-link:focus-visible {
  transform: translateY(-1px);
  background: #252525;
  border-color: #252525;
}

.opening-title,
.list-intro h3,
.story-body h2 {
  margin: 0.5rem 0 0.75rem;
  font-family: "Bodoni Moda", serif;
  line-height: 1.05;
}

.opening-title {
  max-width: 10.5ch;
  color: var(--warm-ink);
  font-size: clamp(2.35rem, 5.6vw, 4.75rem);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.content-shell {
  padding-top: 1.8rem;
  padding-bottom: 4rem;
}

.list-intro {
  margin-bottom: 1.1rem;
}

.controls {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.search-field {
  flex: 1;
  display: grid;
  gap: 0.6rem;
}

.search-field span {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-height: 56px;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.search-field input:focus {
  outline: 2px solid rgba(151, 99, 48, 0.22);
  outline-offset: 2px;
}

.list-count {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  color: var(--muted);
}

.list-count strong {
  color: var(--ink);
  font-size: 1.35rem;
}

.table-head {
  display: grid;
  grid-template-columns: 90px minmax(0, 1.6fr) minmax(150px, 0.8fr) minmax(180px, 0.8fr) 130px;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.entry-list {
  border-bottom: 1px solid var(--line-strong);
}

.entry-card {
  width: 100%;
  display: grid;
  grid-template-columns: 90px minmax(0, 1.6fr) minmax(150px, 0.8fr) minmax(180px, 0.8fr) 130px;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.entry-card:hover,
.entry-card:focus-visible {
  background: rgba(255, 255, 255, 0.82);
  transform: translateX(4px);
  outline: none;
}

.entry-card.is-locked {
  background: rgba(255, 255, 255, 0.62);
}

.entry-rank {
  font-family: "Bodoni Moda", serif;
  font-size: 1.55rem;
  line-height: 1;
}

.entry-name {
  display: grid;
  gap: 0.22rem;
}

.entry-name strong {
  font-size: 1.06rem;
}

.entry-name span,
.entry-location,
.entry-worth {
  color: var(--muted);
}

.entry-industry span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.site-footer {
  padding: 1rem 0 2.5rem;
  display: flex;
  justify-content: flex-start;
}

.footer-logo {
  width: min(160px, 30vw);
  max-height: 40px;
  object-fit: contain;
}

.back-to-top {
  position: fixed;
  right: 1.3rem;
  bottom: 1.3rem;
  min-height: 50px;
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(18, 18, 18, 0.14);
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.92);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(17, 17, 17, 0.2);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    background-color 180ms ease;
  z-index: 18;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: #252525;
}

.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 11, 0.42);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.story-panel {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  padding: 0;
  transform: translateX(102%);
  transition: transform 240ms ease;
  z-index: 30;
  pointer-events: none;
}

.story-panel.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.story-panel.is-paywall:not(.is-locked-story) .story-frame {
  display: none;
}

.story-panel.is-locked-story .story-frame {
  background: #2f2f2f;
  filter: blur(8px) grayscale(1);
  pointer-events: none;
  user-select: none;
}

.panel-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: #171717;
  font-size: 0;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 10px 30px rgba(17, 17, 17, 0.18);
}

.panel-close::before {
  content: "\2190";
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.story-frame {
  position: relative;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 37, 37, 0.4) transparent;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.story-frame::-webkit-scrollbar {
  width: 8px;
}

.story-frame::-webkit-scrollbar-track {
  background: transparent;
}

.story-frame::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(37, 37, 37, 0.4);
}

.story-frame::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 37, 37, 0.58);
}

.paywall-screen {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: transparent;
  color: #ffffff;
}

.story-panel.is-locked-story .paywall-screen {
  position: absolute;
  inset: 0;
  z-index: 2;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(18, 18, 18, 0.82);
  backdrop-filter: blur(4px);
  color: #ffffff;
  pointer-events: auto;
}

.paywall-screen-inner {
  width: min(100%, 640px);
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
  padding: 2.4rem 2rem;
  border: 0;
  background: transparent;
}

.story-panel.is-locked-story .paywall-screen-inner {
  width: min(100%, 640px);
  padding: 2.5rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(46, 46, 46, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  pointer-events: auto;
}

.story-panel.is-locked-story .paywall-screen-logo {
  filter: invert(1);
  opacity: 0.94;
}

.story-panel.is-locked-story .paywall-screen-kicker {
  color: rgba(255, 255, 255, 0.78);
}

.story-panel.is-locked-story .paywall-screen h2 {
  color: #ffffff;
}

.story-panel.is-locked-story .paywall-screen-inner > p:not(.paywall-screen-kicker) {
  color: rgba(255, 255, 255, 0.78);
}

.story-panel.is-locked-story .paywall-screen-link {
  color: #ffffff;
}

.story-panel.is-locked-story .paywall-screen-link:hover,
.story-panel.is-locked-story .paywall-screen-link:focus-visible {
  color: rgba(255, 255, 255, 0.78);
}

.paywall-screen-logo {
  width: min(220px, 58vw);
  max-height: 52px;
  object-fit: contain;
}

.paywall-screen-kicker {
  margin: 0;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.paywall-screen h2,
.paywall-screen p {
  margin: 0;
}

.paywall-screen h2 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.paywall-screen p:last-child {
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.7;
}

.paywall-screen-link {
  color: #ffffff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.paywall-screen-link:hover,
.paywall-screen-link:focus-visible {
  color: rgba(255, 255, 255, 0.8);
}

.story-media {
  position: relative;
  height: 38%;
  background: #ddd;
  overflow: visible;
}

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

.story-media--portrait {
  height: min(54dvh, 620px);
  min-height: min(340px, 52dvh);
  background:
    linear-gradient(90deg, rgba(18, 18, 18, 0.05), transparent 18%, transparent 82%, rgba(18, 18, 18, 0.05)),
    #eee5d8;
  overflow: visible;
}

.story-media--portrait img {
  display: block;
  width: min(100%, 520px);
  margin: 0 auto;
  object-fit: contain;
  object-position: center center;
}

.story-media-snippets {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.story-media-snippet {
  position: absolute;
  width: clamp(98px, 16vw, 134px);
  aspect-ratio: 1 / 1;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.22);
  overflow: hidden;
}

.story-media-snippet img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0;
  object-fit: cover;
  image-rendering: auto;
}

.story-media-snippet--top {
  top: 1rem;
  right: 2.4rem;
  transform: rotate(6deg);
}

.story-media-snippet--bottom {
  left: 1rem;
  bottom: -1rem;
  transform: rotate(-7deg);
}

.story-body {
  display: grid;
  gap: 1rem;
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 1.85rem 2rem 3rem;
}

.story-panel.is-locked-story .story-body {
  background: #2f2f2f;
  padding-bottom: 14rem;
}

.story-panel.is-locked-story .story-rank,
.story-panel.is-locked-story .story-body h2,
.story-panel.is-locked-story .story-subtitle,
.story-panel.is-locked-story .story-meta dt,
.story-panel.is-locked-story .story-meta dd {
  color: #747474;
}

.story-panel.is-locked-story .story-subtitle {
  border-bottom-color: #444444;
}

.story-panel.is-locked-story .story-meta div {
  background: #383838;
}

.story-body h2 {
  font-size: clamp(2rem, 6vw, 3rem);
}

.story-subtitle {
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--line);
}

.story-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
  padding: 0;
}

.story-meta div {
  padding: 0.95rem;
  border-radius: 18px;
  background: #fbf7f0;
}

.story-meta dt {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-meta dd {
  margin: 0;
  font-weight: 700;
}

.story-life {
  display: grid;
  gap: 1rem;
  font-size: 1rem;
}

.story-life p {
  margin: 0;
}

.locked-story-copy {
  display: grid;
  gap: 0.55rem;
  width: min(100%, 68ch);
}

.locked-story-line {
  display: block;
  width: var(--line-width, 82%);
  height: 0.92rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #4a4a4a, #3d3d3d);
}

.locked-story-line:nth-child(2n) {
  background: linear-gradient(90deg, #555555, #404040);
}

.story-life-photo {
  margin: 0;
}

.story-life-photo img {
  display: block;
  width: min(100%, 540px);
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(18, 18, 18, 0.08);
  background: #ffffff;
}

.story-life-paragraph {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 380ms ease,
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.story-life-paragraph.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .story-life-paragraph,
  .story-life-paragraph.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 980px) {
  .table-head,
  .entry-card {
    grid-template-columns: 70px minmax(0, 1.25fr) minmax(120px, 0.9fr) minmax(140px, 0.95fr) 110px;
  }
}

@media (max-width: 760px) {
  .site-header,
  main,
  .site-footer {
    width: min(calc(100% - 1.2rem), var(--max-width));
  }

  .utility-bar {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }

  .header-logo {
    padding: 0.6rem 0 0.14rem;
  }

  .header-logo img {
    width: clamp(116px, 30vw, 132px);
  }

  .masthead-row {
    padding: 0 0 1.55rem;
  }

  .story-panel.is-locked-story .paywall-screen {
    padding: 1rem;
  }

  .story-panel.is-locked-story .paywall-screen-inner {
    padding: 1.6rem 1.25rem;
  }

  .story-panel.is-locked-story .story-body {
    padding-bottom: 15rem;
  }

  .header-copy {
    gap: 0.8rem;
    margin-top: 1rem;
  }

  .masthead-subtitle {
    margin-top: 0.5rem;
    padding-bottom: 0.55rem;
    font-size: clamp(1.2rem, 5.8vw, 1.6rem);
    letter-spacing: 0.07em;
  }

  .opening-title {
    max-width: none;
    font-size: clamp(2.05rem, 11vw, 3.05rem);
    line-height: 0.98;
  }

  .header-dek {
    font-size: 1rem;
    line-height: 1.55;
  }

  .header-note {
    font-size: 0.98rem;
    line-height: 1.62;
  }

  .header-link {
    min-height: 52px;
    padding: 0.95rem 1.25rem;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .list-count {
    justify-content: flex-start;
  }

  .table-head {
    display: none;
  }

  .entry-card {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    grid-template-areas:
      "rank name name"
      "rank industry industry"
      "rank location worth";
    gap: 0.7rem 1rem;
    padding: 1rem 0.8rem;
  }

  .entry-rank {
    grid-area: rank;
    align-self: start;
    font-size: 1.35rem;
  }

  .entry-name {
    grid-area: name;
  }

  .entry-industry {
    grid-area: industry;
  }

  .entry-location,
  .entry-worth {
    color: var(--muted);
  }

  .entry-location {
    grid-area: location;
  }

  .entry-worth {
    grid-area: worth;
    justify-self: end;
  }

  .story-panel {
    width: 100%;
    padding: 0;
  }

  .panel-close {
    top: max(0.75rem, env(safe-area-inset-top));
    left: max(0.75rem, env(safe-area-inset-left));
    width: 34px;
    height: 34px;
  }

  .back-to-top {
    right: 0.9rem;
    bottom: 0.9rem;
    min-height: 48px;
    padding: 0.82rem 1rem;
    font-size: 0.88rem;
  }

  .story-media {
    height: clamp(420px, 68dvh, 640px);
  }

  .story-media--portrait {
    height: clamp(520px, 76dvh, 760px);
    min-height: 0;
    overflow: hidden;
  }

  .story-media--portrait img {
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    object-position: center top;
  }

  .story-media-snippet {
    width: 100px;
  }

  .story-media-snippet--top {
    top: 0.8rem;
    right: 1.35rem;
  }

  .story-media-snippet--bottom {
    left: 0.8rem;
    bottom: -0.8rem;
  }

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

  .paywall-screen {
    padding: 1.2rem;
  }

  .paywall-screen-inner {
    padding: 2rem 1.25rem;
  }
}
