:root {
  --white: #fff;
  --black: #000;
  --link: #0000e7;
  --yellow: #ffef00;
  --green: #00d16f;
  font-family: "Times New Roman", Times, serif;
  color: var(--black);
  background: var(--white);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 300px;
  /* Reserve the scrollbar so opening a record never shifts the page under it. */
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

body {
  min-width: 300px;
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, transparent calc(100% - 22px), var(--yellow) calc(100% - 22px) calc(100% - 16px), transparent calc(100% - 16px)),
    var(--white);
  color: var(--black);
  text-rendering: optimizeLegibility;
}

body.dialog-open {
  overflow: hidden;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  background: var(--yellow);
  color: var(--black);
}

.hyper-page .copy-email {
  color: var(--link);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 4px;
}

::selection {
  background: var(--yellow);
  color: var(--black);
}

.visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 10px;
  padding: 8px;
  transform: translateY(-180%);
  background: var(--black);
  color: var(--white);
  font: 12px/1 "Courier New", monospace;
}

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

/* The intro (js/intro.js). Until its script arrives, paint the reel's first
   frame — white and the stripe — so the page never flashes beneath it. */
html.intro {
  overflow: hidden;
}

html.intro body::after {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, transparent calc(100% - 22px), var(--yellow) calc(100% - 22px) calc(100% - 16px), transparent calc(100% - 16px)),
    var(--white);
}

html.intro-live body::after {
  content: none;
}

.landing-loading,
.landing-error,
.landing-noscript {
  display: grid;
  width: min(100% - 52px, 1080px);
  min-height: 100svh;
  margin: 0 auto;
  align-content: center;
  font: 14px/1.5 "Courier New", monospace;
}

.landing-noscript nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hyper-page {
  width: min(100% - 52px, 1080px);
  margin: 0 auto;
  padding: 20px 0 70px;
  font-size: 18px;
  line-height: 1.35;
}

.hyper-entry-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin-bottom: 72px;
  font: 12px/1.45 "Courier New", monospace;
}

.hyper-intro h1 {
  max-width: 9ch;
  margin: 0;
  font: 900 clamp(4.5rem, 6vw, 11rem)/0.68 Arial, Helvetica, sans-serif;
  letter-spacing: -0.09em;
}

.hyper-subtitle {
  display: inline-block;
  margin: 26px 0 8px;
  padding: 3px 6px;
  background: var(--yellow);
  font: 700 15px/1.2 "Courier New", monospace;
}

.hyper-intro > p:last-child {
  max-width: 56ch;
  margin: 10px 0 54px;
  font-size: clamp(1.35rem, 2.6vw, 2.3rem);
  line-height: 1.12;
}

.hyper-page hr {
  height: 4px;
  margin: 34px 0;
  border: 0;
  background: var(--black);
}

.hyper-page section {
  margin: 78px 0;
}

.hyper-page section h2 {
  display: inline-block;
  margin: 0 0 20px;
  padding: 2px 7px 4px;
  background: var(--black);
  color: var(--white);
  font: 800 clamp(1.2rem, 3vw, 4.7rem)/0.9 Arial, Helvetica, sans-serif;
  letter-spacing: -0.055em;
}

.section-note {
  max-width: 65ch;
  margin: 0 0 26px;
  font: 13px/1.45 "Courier New", monospace;
}

.hyper-page ul {
  max-width: 780px;
}

.hyper-page li {
  margin: 6px 0;
}

.hyper-now strong {
  background: var(--yellow);
}

/* ------------------------------------------------------------------ */
/* Work: a generous lead tier, then the rest as one line each          */
/* ------------------------------------------------------------------ */

.work-lead-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.work-lead {
  margin: 0;
  border-top: 1px solid var(--black);
}

.work-lead:last-child {
  border-bottom: 1px solid var(--black);
}

.work-lead__link {
  display: grid;
  grid-template-columns: 22px minmax(150px, 0.5fr) 1fr;
  gap: 18px;
  padding: 13px 4px 14px 0;
  color: inherit;
  text-decoration: none;
}

.work-lead__mark {
  font: 11px/2.1 "Courier New", monospace;
}

.work-lead__title {
  margin: 0;
  color: var(--link);
  font: 700 clamp(1.2rem, 1.9vw, 1.75rem)/1.1 Arial, Helvetica, sans-serif;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.work-lead__body {
  margin: 0;
  font-size: 16px;
}

.work-lead__body small {
  font: 11px/1.5 "Courier New", monospace;
}

.work-lead__link:hover {
  background: var(--yellow);
}

.work-lead__link:hover .work-lead__title {
  color: var(--black);
}

.work-rest {
  margin-top: 52px;
}

.work-rest__heading {
  margin: 0 0 6px;
  font: 700 13px/1.45 "Courier New", monospace;
  text-transform: lowercase;
}

.work-rest__heading small {
  font-weight: 400;
}

.hyper-page .work-rest__list {
  max-width: none;
  padding: 0;
  border-top: 3px solid var(--black);
  margin: 0;
  list-style: none;
}

.work-rest__item {
  margin: 0;
  border-bottom: 1px dotted var(--black);
}

.work-rest__link {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  padding: 8px 4px 9px 0;
  color: inherit;
  text-decoration: none;
}

.work-rest__mark {
  color: var(--green);
  font: 12px/1.7 "Courier New", monospace;
}

.work-rest__title {
  color: var(--link);
  font: 700 17px/1.3 Arial, Helvetica, sans-serif;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.work-rest__meta {
  font: 10px/1.9 "Courier New", monospace;
  text-align: right;
  white-space: nowrap;
}

.work-rest__link:hover {
  background: var(--yellow);
}

.work-rest__link:hover .work-rest__title,
.work-rest__link:hover .work-rest__mark {
  color: var(--black);
}

/* ------------------------------------------------------------------ */
/* Writing and film writing                                            */
/* ------------------------------------------------------------------ */

.hyper-writing ul {
  padding-left: 1.2em;
}

.review-index {
  padding: 0;
  border-top: 3px solid var(--black);
  margin: 0;
  list-style: none;
}

.review-index__entry {
  margin: 0;
  border-bottom: 1px dotted var(--black);
}

.review-index__link {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1px 14px;
  padding: 10px 5px 11px 0;
  color: inherit;
  text-decoration: none;
}

.review-index__date {
  font: 11px/1.9 "Courier New", monospace;
}

.review-index__film {
  color: var(--link);
  font: 700 18px/1.25 Arial, Helvetica, sans-serif;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.review-index__meta {
  font: 700 10px/1.9 "Courier New", monospace;
  text-align: right;
  white-space: nowrap;
}

.review-index__excerpt {
  display: -webkit-box;
  overflow: hidden;
  grid-column: 2 / -1;
  font-size: 13.5px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.review-index__link:hover {
  background: var(--yellow);
}

.review-index__link:hover .review-index__film {
  color: var(--black);
}

.review-index__link:hover .review-rating {
  background: var(--black);
  color: var(--white);
}

.review-dialog .review-rating {
  font: 700 11px/1.3 "Courier New", monospace;
}

.review-rating {
  padding: 1px 4px;
  background: var(--yellow);
  color: var(--black);
  white-space: nowrap;
}

.review-index__empty {
  padding: 18px 0;
  border-bottom: 1px dotted var(--black);
}

.review-index__load-more {
  padding: 8px 10px;
  border: 1px solid var(--black);
  margin-top: 14px;
  background: var(--yellow);
  color: var(--black);
  cursor: pointer;
  font: 700 11px/1.2 "Courier New", monospace;
  text-transform: lowercase;
}

.review-index__load-more:hover {
  background: var(--green);
}

.hyper-more > div {
  border-top: 3px solid var(--black);
}

.hyper-more article {
  display: grid;
  grid-template-columns: minmax(190px, 0.65fr) 1fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--black);
}

.hyper-more h3,
.hyper-more p {
  margin: 0;
}

.hyper-more h3 {
  font: 800 clamp(1.5rem, 3vw, 2.8rem)/1 Arial, Helvetica, sans-serif;
  letter-spacing: -0.045em;
}

.hyper-more p {
  max-width: 55ch;
}

.hyper-page footer {
  padding: 20px 0;
  border-top: 8px double var(--black);
  margin-top: 100px;
}

.hyper-page footer > p:first-child {
  max-width: 43ch;
  font: 700 clamp(1.8rem, 4vw, 3.7rem)/1 Arial, Helvetica, sans-serif;
  letter-spacing: -0.05em;
}

.hyper-page footer > p:last-child {
  font: 13px/1.7 "Courier New", monospace;
}

/* ------------------------------------------------------------------ */
/* Record dialogs                                                      */
/* ------------------------------------------------------------------ */

.record-dialog {
  overflow: hidden;
  width: min(960px, calc(100% - 38px));
  max-width: none;
  height: min(88svh, 900px);
  max-height: none;
  padding: 0;
  border: 3px solid var(--black);
  background: var(--white);
  color: var(--black);
  box-shadow: none;
  opacity: 0;
  transform: translateY(8px) scale(0.995);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    overlay 0.16s allow-discrete,
    display 0.16s allow-discrete;
}

.record-dialog[open] {
  opacity: 1;
  transform: none;
}

@starting-style {
  .record-dialog[open] {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
}

.record-dialog::backdrop {
  background: rgba(0, 0, 0, 0);
  transition:
    background 0.16s ease,
    overlay 0.16s allow-discrete,
    display 0.16s allow-discrete;
}

.record-dialog[open]::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

@starting-style {
  .record-dialog[open]::backdrop {
    background: rgba(0, 0, 0, 0);
  }
}

.record-dialog__shell {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.record-dialog__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
  padding: 10px 12px;
  background: var(--black);
  color: var(--white);
  font: 11px/1 "Courier New", monospace;
  text-transform: lowercase;
}

.record-dialog__bar button {
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.record-dialog__bar :focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.record-dialog__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-dialog__nav button {
  font-size: 15px;
  line-height: 1;
}

.record-dialog__nav button:hover:not(:disabled) {
  background: var(--yellow);
  color: var(--black);
}

.record-dialog__nav button:disabled {
  cursor: default;
  opacity: 0.28;
}

.record-dialog__position {
  min-width: 7ch;
  text-align: center;
}

.record-dialog__close {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.record-dialog__close:hover {
  background: var(--yellow);
  color: var(--black);
}

/* The body scrolls, not the dialog, so the bar stays put and each record
   starts from the top when you step to it. */
.record-dialog__body {
  overflow-y: auto;
  flex: 1 1 auto;
  overscroll-behavior: contain;
}

.record-dialog__record {
  animation: record-in 0.18s ease-out both;
}

@keyframes record-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.project-dialog__body {
  padding: clamp(22px, 5vw, 64px);
}

.project-dialog__meta {
  display: inline-block;
  margin: 0 0 16px;
  padding: 3px 6px;
  background: var(--yellow);
  font: 700 11px/1.2 "Courier New", monospace;
  text-transform: lowercase;
}

.project-dialog h2 {
  max-width: 11ch;
  margin: 0;
  font: 900 clamp(3.6rem, 10vw, 8.5rem)/0.72 Arial, Helvetica, sans-serif;
  letter-spacing: -0.085em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.project-dialog__summary {
  max-width: 48ch;
  margin: 34px 0 0;
  font: 700 clamp(1.2rem, 2.7vw, 2rem)/1.15 Arial, Helvetica, sans-serif;
}

.project-dialog__text {
  max-width: 68ch;
  margin-top: 34px;
  font-size: 18px;
  line-height: 1.45;
}

.project-dialog__text p {
  margin: 0 0 1em;
}

.project-dialog__links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 14px;
  padding: 14px 0;
  border-top: 3px solid var(--black);
  border-bottom: 3px solid var(--black);
  margin: 34px 0;
  font: 700 13px/1.35 "Courier New", monospace;
}

.project-dialog__images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 9px;
  margin-top: 42px;
}

.project-dialog__images figure {
  margin: 0;
}

.project-dialog__images figure:first-child:nth-last-child(1) {
  grid-column: 1 / -1;
}

.project-dialog__images img {
  display: block;
  width: 100%;
  max-height: 580px;
  /* Reserve the box before the image loads so opening a record never reflows.
     object-fit: contain letterboxes onto the plate colour below. */
  aspect-ratio: 4 / 3;
  border: 1px solid var(--black);
  object-fit: contain;
  background: #f2f2f2;
}

.project-dialog__images figcaption {
  margin-top: 4px;
  font: 10px/1 "Courier New", monospace;
}

.review-dialog .project-dialog__meta {
  background: var(--green);
}

.review-dialog__lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 260px);
  gap: clamp(24px, 5vw, 58px);
  align-items: start;
}

.review-dialog h2 {
  max-width: 13ch;
  font-size: clamp(3.2rem, 8vw, 7rem);
  line-height: 0.78;
}

.review-dialog__poster {
  margin: 0;
  transform: rotate(1.5deg);
}

.review-dialog__poster img {
  display: block;
  width: 100%;
  max-height: 430px;
  /* Letterboxd posters are always 2:3, so this reserves the exact final box. */
  aspect-ratio: 2 / 3;
  border: 1px solid var(--black);
  object-fit: cover;
}

.review-dialog__text {
  max-width: 62ch;
  margin-top: clamp(38px, 7vw, 76px);
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  line-height: 1.5;
}

@media (min-width: 1000px) {
  .hyper-page::before {
    position: fixed;
    top: 44%;
    left: 8px;
    content: "मेरे डिजिटल स्पेस में आपका स्वागत है! میری ڈیجیٹل دنیا میں خوش آمدید! ";
    font: 11px/1 "Courier New", monospace;
    writing-mode: vertical-rl;
  }
}

@media (max-width: 700px) {
  body,
  html.intro body::after {
    background:
      linear-gradient(90deg, transparent calc(100% - 13px), var(--yellow) calc(100% - 13px) calc(100% - 8px), transparent calc(100% - 8px)),
      var(--white);
  }

  .hyper-page,
  .landing-loading,
  .landing-error,
  .landing-noscript {
    width: calc(100% - 34px);
  }

  .hyper-page {
    padding-top: 14px;
    font-size: 16px;
  }

  .hyper-entry-nav {
    margin-bottom: 50px;
  }

  .hyper-intro h1 {
    font-size: 21vw;
  }

  .hyper-page section {
    margin: 58px 0;
  }

  /* The lead tier stacks: there is no room for a title column beside a body. */
  .work-lead__link {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 5px 9px;
    padding: 12px 4px 13px 0;
  }

  .work-lead__body {
    grid-column: 2;
    font-size: 14px;
  }

  .work-rest__link {
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 2px 9px;
  }

  .work-rest__meta {
    grid-column: 2;
    text-align: left;
  }

  .review-index__link {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
  }

  .review-index__date {
    grid-column: 1 / -1;
  }

  .review-index__excerpt {
    grid-column: 1 / -1;
    -webkit-line-clamp: 2;
  }

  .hyper-more article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .record-dialog {
    width: calc(100% - 18px);
    height: calc(100svh - 18px);
  }

  .record-dialog__label {
    display: none;
  }

  .project-dialog__body {
    padding: 24px 14px 38px;
  }

  .project-dialog h2 {
    font-size: 15vw;
  }

  .project-dialog__images {
    grid-template-columns: 1fr;
  }

  .review-dialog__lead {
    grid-template-columns: 1fr;
  }

  .review-dialog__poster {
    width: min(70%, 260px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .record-dialog,
  .record-dialog::backdrop,
  .record-dialog__record {
    transition: none;
    animation: none;
  }

  .record-dialog {
    opacity: 1;
    transform: none;
  }

  .record-dialog::backdrop {
    background: rgba(0, 0, 0, 0.78);
  }
}
