/* adanime — black and white only. Every colour below is black, white or a
   grey between them; nothing else is allowed in. */

:root {
  --ink: #000;
  --paper: #fff;
  --line: #e4e4e4;
  --soft: #f4f4f4;
  --muted: #6b6b6b;
  --radius: 14px;
  --wrap: 1240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
  --ink: #fff;
  --paper: #000;
  --line: #242424;
  --soft: #101010;
  --muted: #9a9a9a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }

::selection { background: var(--ink); color: var(--paper); }

/* ---------- top bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.bar-in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.mark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.06em;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.mark span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: 6px;
}

.nav a {
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  transition: color .18s var(--ease), background .18s var(--ease);
}

.nav a:hover { color: var(--ink); background: var(--soft); }
.nav a.on { color: var(--ink); background: var(--soft); font-weight: 600; }

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  min-width: 0;
  transition: border-color .18s var(--ease);
}

.search:focus-within { border-color: var(--ink); }

.search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 180px;
  min-width: 0;
  font-size: 14px;
}

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

.icon-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}

.icon-btn:hover { border-color: var(--ink); }
.icon-btn:active { transform: scale(.94); }

.search .icon-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
}

/* ---------- page ---------- */

main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 26px 20px 60px;
  width: 100%;
  flex: 1;
}

h1, h2, h3 { letter-spacing: -.02em; margin: 0; }

.lede { color: var(--muted); margin: 6px 0 0; font-size: 14px; }

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

.head h2 { font-size: 18px; font-weight: 700; }
.head .more { font-size: 13px; color: var(--muted); }

/* ---------- hero ---------- */

.hero {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 0;
  margin-bottom: 34px;
  background: var(--paper);
}

.hero-txt {
  padding: 34px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.hero h1 {
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -.035em;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.hero-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}

.btn:hover { opacity: .85; }
.btn:active { transform: scale(.98); }

.hero-art {
  background: var(--soft);
  border-left: 1px solid var(--line);
  min-height: 260px;
  position: relative;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

/* ---------- chips ---------- */

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

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  color: var(--muted);
  background: var(--paper);
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s var(--ease);
}

.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- rows ---------- */

.row-block { margin-bottom: 34px; }

.row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 152px;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.row::-webkit-scrollbar { display: none; }

/* ---------- cards ---------- */

.card { scroll-snap-align: start; min-width: 0; }

.card .art {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--soft);
  border: 1px solid var(--line);
}

.card .art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s var(--ease);
}

.card:hover .art img { transform: scale(1.04); }

.card .score {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: .01em;
}

.card .name {
  margin-top: 9px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.64em;   /* two lines always, so the meta row lines up */
}

.card .sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 22px 14px;
}

/* ---------- anime page ---------- */

.detail {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 26px;
  margin-bottom: 32px;
}

.detail .art {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft);
  aspect-ratio: 2 / 3;
}

.detail .art img { width: 100%; height: 100%; object-fit: cover; }

.detail h1 { font-size: clamp(22px, 3vw, 34px); font-weight: 800; line-height: 1.1; margin-bottom: 10px; }

.synopsis {
  color: var(--muted);
  font-size: 14px;
  max-width: 70ch;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.synopsis.open { -webkit-line-clamp: unset; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- player ---------- */

.player-wrap {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  background: #000;
  margin-bottom: 18px;
}

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player .empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.sources { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

/* ---------- episodes ---------- */

.eps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}

.ep {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  padding: 11px 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .16s var(--ease);
}

.ep:hover { border-color: var(--ink); }
.ep.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- states ---------- */

.empty-box {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.sk { background: var(--soft); border-radius: var(--radius); animation: pulse 1.4s infinite; }
.sk.art { aspect-ratio: 2 / 3; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 20px;
}

.foot-in {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  margin-right: 6px;
  vertical-align: middle;
}

.dot.off { background: var(--muted); opacity: .5; }

/* ---------- small screens ---------- */

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { border-left: 0; border-top: 1px solid var(--line); min-height: 200px; order: -1; }
  .hero-txt { padding: 22px 20px; }
  .detail { grid-template-columns: 130px 1fr; gap: 16px; }
  .nav { display: none; }
  .search input { width: 100%; }
  .row { grid-auto-columns: 132px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 18px 12px; }
}

@media (max-width: 420px) {
  main { padding: 18px 14px 50px; }
  .bar-in { padding: 12px 14px; gap: 10px; }
}
