:root {
  color-scheme: dark;
  --background: #151311;
  --text: #f8ecda;
  --heading: #f0dcbd;
  --muted: #cfbc9f;
  --accent: #f4a231;
  --line: #6d5b44;
  --display: Georgia, "Times New Roman", serif;
  font-family: system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: var(--background) url("assets/grain.jpg");
}
.bio {
  width: min(100%, 49rem);
  margin-inline: auto;
  padding: 1.25rem clamp(0.85rem, 2.4vw, 1.5rem) 1.75rem;
}
.masthead {
  text-align: center;
  margin-block-end: 1.15rem;
}
.masthead h1, h2 {
  margin: 0;
  color: var(--heading);
  font-family: var(--display);
  line-height: 1.02;
}
.masthead h1 {
  font-size: clamp(2.9rem, 9vw, 4.8rem);
  letter-spacing: -0.06em;
}
.masthead p {
  margin: 0;
  color: var(--heading);
  font-size: clamp(0.67rem, 2.5vw, 0.98rem);
  font-weight: 600;
  letter-spacing: 0.18em;
}
.masthead p::before {
  content: "";
  display: block;
  width: 6.25rem;
  height: 2px;
  margin: 0.6rem auto 0.5rem;
  background: linear-gradient(to right, var(--line) 37%, transparent 37% 44%, var(--accent) 44% 56%, transparent 56% 63%, var(--line) 63%);
}
.cover {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.95rem;
}
.featured-title {
  margin: 0.65rem 0 0.95rem;
  text-align: center;
  font-size: clamp(1.75rem, 6vw, 3.6rem);
  letter-spacing: -0.045em;
}
.watch-actions { display: grid; gap: 0.55rem; }
.watch {
  min-height: clamp(3rem, 7vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 2px solid var(--text);
  border-radius: 0.7rem;
  color: inherit;
  font-size: clamp(1rem, 3.8vw, 1.45rem);
  font-weight: 750;
  text-decoration: none;
}
.watch:hover { background: #2c241a; }
.watch-primary {
  color: #1c1208;
  background: var(--accent);
  border-color: var(--accent);
}
.watch-primary:hover { background: #ffbd61; }
.watch svg { width: 1.15em; height: 1.15em; }
.stories { margin-block-start: 1.4rem; }
.stories h2 {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
}
.stories h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.stories details + details { border-top: 1px solid var(--line); }
.stories summary {
  display: grid;
  grid-template-columns: 34% minmax(0, 1fr) 1.1rem;
  align-items: center;
  gap: clamp(0.55rem, 2.6vw, 1.35rem);
  padding: 0.55rem 0;
  cursor: pointer;
  list-style: none;
  font-size: clamp(0.85rem, 3.5vw, 1.35rem);
  font-weight: 650;
}
.stories summary::-webkit-details-marker { display: none; }
.stories summary:hover { color: var(--accent); }
.stories summary img {
  width: 100%;
  height: auto;
  border-radius: 0.48rem;
}
.stories summary svg {
  width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stories details[open] summary svg { transform: rotate(90deg); }
.story-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0.75rem;
}
.story-actions .watch { min-height: 44px; font-size: 0.9rem; }
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 0.4rem;
  margin-top: 1rem;
}
.socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  font-size: clamp(0.68rem, 2.7vw, 1rem);
  font-weight: 650;
}
.socials a:hover { color: var(--accent); }
.socials svg { width: 1.35em; height: 1.35em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

[hidden] { display: none !important; }
.masthead a { color: inherit; text-decoration: none; }
.story-search {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.25rem;
  margin-block-end: 1rem;
  padding-inline: 0.8rem 0.25rem;
  border: 2px solid var(--heading);
  border-radius: 0.65rem;
  background: #211c17;
}
.story-search:focus-within { border-color: var(--accent); }
.story-search input {
  width: 100%;
  min-width: 0;
  align-self: stretch;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
}
.story-search input::placeholder { color: var(--muted); }
.story-search input::-webkit-search-cancel-button { appearance: none; }
.story-search svg, .browse-link svg {
  width: 1.4rem;
  height: 1.4rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.clear-search {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  color: var(--heading);
  background: transparent;
  cursor: pointer;
}
.clear-search:hover, .text-link:hover { color: var(--accent); }
.story-result {
  display: grid;
  grid-template-columns: 34% minmax(0, 1fr);
  gap: 0.45rem clamp(0.55rem, 2.6vw, 1.35rem);
  align-items: center;
  padding-block: 0.7rem;
}
.story-result + .story-result { border-top: 1px solid var(--line); }
.story-result img {
  grid-row: span 2;
  width: 100%;
  height: auto;
  border-radius: 0.48rem;
}
.story-result h3 {
  align-self: end;
  margin: 0;
  color: var(--heading);
  font-family: var(--display);
  font-size: clamp(1rem, 4vw, 1.55rem);
  line-height: 1.1;
}
.story-result .story-actions { align-self: start; margin: 0; gap: 0.35rem; }
.story-result .watch { font-size: clamp(0.72rem, 3.1vw, 0.95rem); }
.text-link { color: var(--heading); font-weight: 650; text-underline-offset: 0.2em; }
.browse-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 48px;
  margin-top: 0.2rem;
  border-top: 1px solid var(--line);
}
.load-more {
  width: 100%;
  margin-top: 0.75rem;
  background: transparent;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.empty-stories { color: var(--muted); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
