:root{
  --ink:#111;
  --muted:#555;
  --paper:#fbfaf6;
  --rule:#d8d4c8;
  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--serif);
  line-height:1.25;
}

.page{
  max-width: 1040px;
  margin: 0 auto;
  padding: calc(30px + env(safe-area-inset-top)) 20px 60px;
}

/* ====== KEYSTRIPS ====== */
.keywrap{
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: none;
  padding-top: 6px;
}

.keystrip{
  display:flex;
  flex-wrap:nowrap;          /* one row */
  justify-content:center;
  gap:4px;
  overflow-x:auto;           /* scroll on small screens */
  -webkit-overflow-scrolling: touch;
  padding: 10px 0 6px;
  scrollbar-width: thin;
}

.keystrip::-webkit-scrollbar{ height: 6px; }
.keystrip::-webkit-scrollbar-thumb{ background: rgba(0,0,0,.20); }
.keystrip::-webkit-scrollbar-track{ background: transparent; }

.keystrip a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  color:var(--ink);
  border: 1px solid var(--ink);
  background:#fff;
  font-family: var(--mono);
  letter-spacing: .08em;
  line-height: 1;
  white-space:nowrap;
  user-select:none;
}

.keystrip a:hover{ background:#f2f2f2; }

.keystrip a.current{
  background: var(--ink);
  color:#fff;
}

/* A–Z default: MOBILE = two rows */
.keystrip.az{
  display:flex;
  flex-direction: column;   /* stack rows */
  align-items: center;
  gap: 6px;
  padding-top: 12px;

  /* prevent weird scrolling/column behavior */
  overflow: visible;
}

.keystrip.az .keyrow{
  display:flex;
  flex-wrap: nowrap;
  justify-content:center;
  gap:4px;
}

.keystrip.az .keyrow a{
  font-size: 11px;
  padding: 3px 6px;
  min-width: 20px;
}

/* DESKTOP: collapse to ONE row by placing the two keyrows side-by-side */
@media (min-width: 920px){
  .keystrip.az{
    flex-direction: row;     /* keyrow1 + keyrow2 on same line */
    gap: 4px;
  }

  .keystrip.az .keyrow{
    gap:4px;
  }
}

/* hide all sub-strips by default */
.keystrip.sub { display: none; }

@media (min-width: 920px){
  .keystrip.az{ overflow-x: hidden; }
}


.keyrow{
  display:flex;
  justify-content:center;
  gap:4px;
}

.keyrow a{
  font-size: 11px;
  padding: 3px 6px;
  min-width: 20px;
}

/* Subrange keys */
.keystrip.sub{ padding-top: 6px; padding-bottom: 2px; gap:6px; }
.keystrip.sub a{
  font-size: 11.5px;
  padding: 3px 10px;
}

/* ====== HEADER ====== */
header{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 16px;
}

.title{
  margin:0;
  font-family: var(--sans);
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size: 18px;
}

.range{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space:nowrap;
}

/* ====== ENTRIES ====== */
.entries{
  column-count: 1;
  column-gap: 38px;
  margin-top: 6px;
}

@media (min-width: 920px){
  .entries{ column-count: 2; }
}

.entry{
  break-inside: avoid;
  padding: 5px 0 7px;
  border-bottom: none;
  margin-bottom: 5px;
}

.entry-head{ margin-bottom: 2px; }

.film{
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.year{
  font-size: 12px;
  color: var(--muted);
  margin-left: 6px;
  font-family: var(--sans);
  font-weight: 600;
  text-transform:none;
}

.rating{
  font-family: var(--sans);
  font-size: 14px;      /* your preferred size */
  font-weight: 700;
  margin-left: 6px;
  position: relative;
  top: -1px;            /* optical alignment */
  letter-spacing: 0;
}

.credit{
  margin: 4px 0 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.capsule{
  margin:0;
  font-size: 13.25px;
  text-align: justify;
  text-justify: inter-word;

  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

.specs{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* ====== FOOTER ====== */
.footer{
  margin-top: 26px;
  padding-top: 14px;
  border-top: 2px solid var(--rule);
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 14px;
  flex-wrap:wrap;
}

.footer .copyright{
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.footer .next{
  font-family: var(--sans);
  font-size: 12px;
}

.footer .next a{
  text-decoration:none;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}

/* Optional: hide keystrips when printing */
@media print{
  body{ background:#fff; }
  .page{ max-width:none; padding: 0.5in; }
  .keywrap{ display:none; }
  .entries{ column-count:2; column-gap:0.35in; }
  .entry{ border-bottom:0; padding: 6px 0; margin-bottom: 0; }
}

body, .page, .keywrap{
  overflow: visible;
}

/* Prevent sub-strip flash before JS decides which one to show */
html:not(.nav-ready) .keystrip.sub {
  display: none !important;
}
