:root {
  color-scheme: dark;
  --bg: #171717;
  --bg-soft: #1e1e1e;
  --surface: #222;
  --surface-hover: #282828;
  --text: #e9e4dc;
  --text-strong: #fff7ec;
  --muted: #a89f95;
  --quiet: #766f68;
  --line: rgba(251, 228, 197, 0.14);
  --accent: #ff691f;
  --blue: #58b8e8;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  --font: "Segoe UI", Aptos, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(88, 184, 232, 0.08), transparent 28rem),
    linear-gradient(180deg, #171717 0%, #191919 55%, #141414 100%);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.8;
}

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  transform: translateY(-160%);
  background: var(--accent);
  color: #171717;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 72px;
  padding: 0 4rem;
  background: rgba(23, 23, 23, 0.96);
  border-bottom: 1px solid rgba(255, 105, 31, 0.62);
  backdrop-filter: blur(10px);
}

.brand {
  color: var(--text-strong);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}

.brand::before {
  color: var(--accent);
  content: "● ";
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.25rem;
  font-size: 0.9rem;
  font-weight: 650;
}

.site-nav a,
.story-pager a {
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a[aria-current="page"] {
  color: var(--text-strong);
}

.home,
.reader {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.intro {
  max-width: 760px;
  padding: 5rem 0 3rem;
}

.intro--compact {
  padding-bottom: 1.5rem;
}

.kicker {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.4;
}

h1,
h2 {
  margin: 0;
  color: var(--text-strong);
  font-weight: 760;
  line-height: 1.12;
}

h1 {
  max-width: 760px;
  font-size: 3.4rem;
}

h2 {
  font-size: 2rem;
}

.intro > p:not(.kicker) {
  max-width: 660px;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  align-items: center;
  gap: 2.5rem;
  padding: 4.5rem 0 3rem;
}

.hub-hero-content {
  max-width: 620px;
}

.hub-hero-content > p:not(.kicker) {
  margin: 1.25rem 0 1.75rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.hub-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  background: var(--accent);
  color: #171717;
  font-weight: 760;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.hub-cta:hover,
.hub-cta:focus {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(255, 105, 31, 0.35);
}

.hub-hero-figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hub-hero-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.archive-section {
  padding: 2rem 0 5rem;
  scroll-margin-top: 96px;
}

.archive-heading {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.3rem;
}

.archive-heading--act {
  position: relative;
  gap: 0.65rem;
  margin: 0 auto 1.65rem;
  padding: 1.35rem 0 1.45rem;
  text-align: center;
}

.archive-heading--act::before,
.archive-heading--act::after {
  content: "";
  width: min(28rem, 100%);
  height: 1px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, rgba(229, 197, 136, 0.72), transparent);
}

.act-eyebrow {
  margin: 0;
  color: var(--quiet);
  font-size: 0.88rem;
  font-weight: 720;
  line-height: 1.4;
}

.archive-heading .act-title {
  color: var(--text-strong);
  font-size: 3.15rem;
  line-height: 1;
  text-transform: uppercase;
}

.archive-heading p:last-child {
  margin: 0;
  color: var(--muted);
}

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.4rem 0 1.2rem;
}

.filter-chip {
  min-height: 2.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.filter-chip:hover,
.filter-chip:focus {
  border-color: rgba(255, 105, 31, 0.62);
  color: var(--text-strong);
}

.filter-chip.is-active {
  border-color: rgba(255, 105, 31, 0.72);
  background: rgba(255, 105, 31, 0.12);
  color: var(--text-strong);
}

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

.story-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.story-card:hover,
.story-card:focus {
  background: var(--surface-hover);
  border-color: rgba(255, 105, 31, 0.7);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.38);
  transform: translateY(-4px);
}

.story-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: filter 180ms ease, transform 220ms ease;
}

.story-card-visual {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(201, 73, 73, 0.34), rgba(88, 184, 232, 0.16)),
    var(--bg-soft);
  color: var(--text-strong);
}

.story-card-visual span {
  border: 1px solid rgba(255, 247, 236, 0.28);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: rgba(23, 23, 23, 0.42);
  font-size: 0.82rem;
  font-weight: 760;
}

.story-card:hover img,
.story-card:focus img {
  filter: brightness(1.08);
  transform: scale(1.025);
}

.story-card:hover .story-card-visual,
.story-card:focus .story-card-visual {
  filter: brightness(1.08);
}

.story-card[hidden] {
  display: none;
}

.story-card-content {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
}

.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  border: 1px solid rgba(88, 184, 232, 0.32);
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 720;
  line-height: 1;
}

.story-card strong {
  color: var(--text-strong);
  font-size: 1.12rem;
  line-height: 1.25;
}

.story-card em {
  color: var(--muted);
  font-size: 0.92rem;
  font-style: normal;
}

.reader {
  padding: 4.5rem 0 5rem;
}

.story {
  max-width: 760px;
  margin: 0 auto;
}

.story-heading {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.story-subtitle {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.archive-note {
  margin: 0 0 2rem;
  border: 1px solid rgba(255, 105, 31, 0.36);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background: rgba(255, 105, 31, 0.08);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.archive-note strong {
  color: var(--text-strong);
}

.story hr {
  margin: 3rem 0 0;
  border: none;
  border-top: 1px solid var(--line);
}

hr + .archive-note {
    margin: 3rem 0 1rem;
}

.story p {
  margin: 1.25rem 0 0;
  color: var(--text);
}

.story blockquote {
  margin: 1.8rem 0;
  border-left: 3px solid rgba(255, 105, 31, 0.72);
  padding: 0.2rem 0 0.2rem 1rem;
  color: var(--text-strong);
}

.story blockquote p {
  margin-top: 0;
}

.story cite {
  display: block;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-style: normal;
}

.story-rules {
  margin: 1rem 0 0;
  padding-left: 1.4rem;
  color: var(--text);
}

.story-rules li + li {
  margin-top: 0.35rem;
}

.story h2 {
  margin-top: 3.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.story--chapters {
  max-width: 860px;
}

.chapter-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 2rem;
}

.chapter-jump a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.chapter-jump a:hover,
.chapter-jump a:focus {
  border-color: rgba(255, 105, 31, 0.7);
  background: rgba(255, 105, 31, 0.1);
  color: var(--text-strong);
}

.chapter-list {
  display: grid;
  gap: 1.35rem;
  width: 100%;
  margin-top: 2rem;
}

.chapter-block {
  width: 100%;
  max-width: none;
  border: 1px solid var(--line);
  border-left: 4px solid rgba(201, 73, 73, 0.82);
  border-radius: 8px;
  padding: 1.2rem 1.3rem 1.35rem;
  background: rgba(34, 34, 34, 0.72);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.chapter-block--empty {
  border-style: dashed;
  background: rgba(34, 34, 34, 0.42);
}

.chapter-heading {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.chapter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.chapter-read-button {
  min-height: 2rem;
  border: 1px solid rgba(255, 105, 31, 0.48);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 105, 31, 0.1);
  color: var(--text-strong);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.chapter-read-button:hover,
.chapter-read-button:focus {
  border-color: rgba(255, 105, 31, 0.76);
  background: rgba(255, 105, 31, 0.16);
}

.chapter-read-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.chapter-kicker {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

.story .chapter-block h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1.55rem;
}

.story .chapter-block p {
  max-width: none;
  margin-top: 1.05rem;
}

.story .chapter-block p:first-of-type {
  margin-top: 0;
}

.story-afterword {
  margin-top: 2rem;
}

.identity-card {
  display: grid;
  grid-template-columns: minmax(140px, 190px) 1fr;
  gap: 1.1rem;
  max-width: 68ch;
  margin: 0 0 2rem;
  overflow: hidden;
  border: 1px solid rgba(88, 184, 232, 0.34);
  border-radius: 8px;
  background: rgba(34, 34, 34, 0.82);
  box-shadow: var(--shadow);
}

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

.identity-content {
  padding: 1rem 1rem 1rem 0;
}

.story .identity-card h2 {
  margin: 0 0 0.85rem;
  padding: 0;
  border: 0;
  font-size: 1.25rem;
}

.identity-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
}

.identity-card dl > div {
  min-width: 0;
}

.identity-card dt {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.identity-card dd {
  margin: 0.18rem 0 0;
  color: var(--text-strong);
  font-size: 0.96rem;
  font-weight: 620;
  line-height: 1.35;
}

.story figure {
  margin: 2rem 0;
}

.chapter-list > .chapter-illustration {
  margin: clamp(2.5rem, 7vw, 4.5rem) 0;
}

.chapter-list > .chapter-separator {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: min(34rem, calc(100% - 2rem));
  margin: clamp(2.2rem, 6vw, 4rem) auto;
  opacity: 0.82;
}

.chapter-list > .chapter-separator::before,
.chapter-list > .chapter-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(199, 156, 91, 0.72));
}

.chapter-list > .chapter-separator::after {
  background: linear-gradient(90deg, rgba(199, 156, 91, 0.72), transparent);
}

.chapter-list > .chapter-separator span {
  width: 0.48rem;
  height: 0.48rem;
  border: 1px solid rgba(229, 197, 136, 0.72);
  background: rgba(229, 197, 136, 0.12);
  box-shadow: 0 0 18px rgba(229, 197, 136, 0.2);
  transform: rotate(45deg);
}

.story figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.chapter-list > .chapter-illustration img {
  box-shadow: var(--shadow);
  filter: saturate(0.95) brightness(0.96);
}

.story .chapter-ending {
  margin: 2.4rem auto 0;
}

.story .chapter-ending img {
  aspect-ratio: 21 / 10;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  filter: saturate(0.92) brightness(0.94);
}

.story .chapter-hero img {
  aspect-ratio: 16 / 10;
}

.story figcaption {
  margin-top: 0.55rem;
  color: var(--quiet);
  font-size: 0.86rem;
}

.story i {
  color: var(--text-strong);
}

.fin {
  color: var(--accent) !important;
  font-weight: 750;
}

.sources {
  margin-top: 3.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.sources h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 1.25rem;
}

.sources ul {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.sources a {
  color: var(--text);
}

.sources a:hover,
.sources a:focus {
  color: var(--text-strong);
}

.story-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 650;
}

.story-pager a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
}

.story-pager a:hover,
.story-pager a:focus {
  background: var(--surface);
  border-color: rgba(255, 105, 31, 0.7);
  color: var(--text-strong);
}

.site-footer {
  border-top: 1px solid rgba(255, 105, 31, 0.45);
  padding: 1.25rem 4rem;
  color: var(--quiet);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 860px) {
  body {
    font-size: 17px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 0.9rem;
  }

  .intro {
    padding: 3.5rem 0 2rem;
  }

  .hub-hero {
    grid-template-columns: 1fr;
    padding: 3.5rem 0 2rem;
  }

  .hub-hero-figure {
    order: -1;
  }

  h1 {
    font-size: 2.35rem;
  }

  h2 {
    font-size: 1.55rem;
  }

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

  .reader {
    padding: 3rem 0 4rem;
  }

  .identity-card {
    grid-template-columns: 1fr;
  }

  .identity-card img {
    aspect-ratio: 16 / 9;
  }

  .identity-content {
    padding: 0 1rem 1rem;
  }
}

@media (max-width: 520px) {
  .home,
  .reader {
    width: min(100% - 1rem, 1120px);
  }

  h1 {
    font-size: 2rem;
  }

  .archive-heading .act-title {
    font-size: 2.1rem;
    line-height: 1.08;
  }

  .story-card-content {
    padding: 0.9rem;
  }

  .identity-card dl {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding: 1rem;
  }
}
