/* ---------------------------------------------------------------
   Arastu Zakia — minimal dark blog
   Everything visual lives in this one file.
   The variables just below are the design: change a value here and
   it changes everywhere.
   --------------------------------------------------------------- */

@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap");

:root {
  --bg: #0f0f0e;
  --text: #e8e6e1; /* headings, links, emphasis */
  --text-body: #c4c1bb; /* article prose */
  --text-soft: #b5b2ac; /* intro, about */
  --text-dim: #8a8883; /* excerpts */
  --text-faint: #63615d; /* dates, captions, footer */
  --text-fainter: #54524f;
  --rule: #1f1f1e;
  --rule-soft: #33322f;
  --surface: #1a1a18;

  --measure: 36rem; /* 576px — the whole site's column width */

  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Charter, "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, "Courier New", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-soft);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: #2e2d2a;
  color: var(--text);
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
}

a {
  color: inherit;
}

/* Skip link for keyboard and screen-reader users */
.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  z-index: 10;
}

:focus-visible {
  outline: 2px solid var(--rule-soft);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Masthead ----------------------------------------------------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3.25rem;
}

.masthead .name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.014em;
  text-decoration: none;
}

.masthead nav {
  display: flex;
  gap: 1.15rem;
  font-size: 0.8125rem;
}

.masthead nav a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* --- Homepage intro ----------------------------------------------- */

.intro {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
  color: #9d9a94;
  letter-spacing: 0;
  margin: 0 0 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

/* --- Homepage feed ------------------------------------------------- */

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

.feed li + li {
  margin-top: 2.25rem;
}

.eyebrow {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin: 0 0 0.45rem;
  font-variant-numeric: tabular-nums;
}

.feed h2 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.feed h2 a {
  color: var(--text);
  text-decoration: none;
}

.feed h2 a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-soft);
}

.feed .dek {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.65;
}

.more {
  margin-top: 2.75rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
}

.more a {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-soft);
}

.more a:hover {
  color: var(--text-soft);
  text-decoration-color: var(--text-dim);
}

/* --- Search (Writings page) ----------------------------------------- */

.search {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 2.25rem;
}

.search-label {
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  flex: none;
}

.search input[type="search"] {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  border-bottom: 1px solid #262624;
  border-radius: 0;
  padding: 0 0 0.32rem;
  color: var(--text-body);
  font-family: inherit;
  font-size: 0.875rem;
  letter-spacing: -0.005em;
  -webkit-appearance: none;
  appearance: none;
}

.search input[type="search"]::placeholder {
  color: #3f3e3b;
}

.search input[type="search"]:focus {
  outline: none;
  border-bottom-color: var(--rule-soft);
}

.search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-status {
  font-size: 0.8125rem;
  color: var(--text-faint);
  margin: 0 0 2rem;
}

.entry-match {
  display: block;
  font-size: 0.75rem;
  color: var(--text-faint);
  line-height: 1.55;
  margin-top: 0.28rem;
}

.entry-match mark {
  background: #26251f;
  color: var(--text);
  padding: 0 2px;
  border-radius: 2px;
}

/* --- Archive ------------------------------------------------------- */

.year {
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  margin: 2.5rem 0 1rem;
}

.year:first-of-type {
  margin-top: 0;
}

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

.archive li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1rem;
}

.archive .day {
  font-size: 0.6875rem;
  color: var(--text-fainter);
  white-space: nowrap;
  width: 3.4rem;
  flex: none;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.archive .entry {
  min-width: 0;
}

.entry-caption {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.8125rem;
  color: var(--text-faint);
  line-height: 1.5;
  margin-top: 0.25rem;
  letter-spacing: 0;
}

.archive a {
  font-size: 0.9375rem;
  color: var(--text-body);
  text-decoration: none;
  line-height: 1.4;
}

.archive a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-soft);
}

/* --- Article header ------------------------------------------------ */

article h1 {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.028em;
  color: var(--text);
  margin: 0 0 0.6rem;
  text-wrap: balance;
}

.dek--article {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 0.9rem;
  letter-spacing: 0;
}

.byline {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin: 0 0 2.25rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--rule);
}

/* --- Prose ---------------------------------------------------------- */

.prose {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text-body);
  letter-spacing: 0;
}

.prose > * + * {
  margin-top: 1.35em;
}

.prose h2,
.prose h3 {
  font-family: var(--sans);
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.3;
  margin-top: 2.5em;
  margin-bottom: -0.35em;
}

.prose h2 {
  font-size: 1.125rem;
}

.prose h3 {
  font-size: 1rem;
}

.prose a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-soft);
}

.prose a:hover {
  text-decoration-color: var(--text-dim);
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding-left: 1.15rem;
  border-left: 1px solid var(--rule-soft);
  color: var(--text-dim);
  font-style: italic;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.75em auto;
  width: 100%;
}

.prose ul,
.prose ol {
  padding-left: 1.15rem;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface);
  padding: 0.12em 0.36em;
  border-radius: 3px;
}

.prose pre {
  background: var(--surface);
  padding: 1rem 1.1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.875rem;
}

.prose pre code {
  background: none;
  padding: 0;
}

/* --- Figures and images --------------------------------------------- */

.prose figure {
  margin: 2em 0;
}

.prose figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  background: var(--surface);
}

.prose figcaption {
  font-family: var(--sans);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-faint);
  margin-top: 0.6rem;
  letter-spacing: -0.005em;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
}

/* --- YouTube embed --------------------------------------------------- */

.embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a09;
  border-radius: 4px;
  overflow: hidden;
  margin: 2em 0;
}

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

/* --- Fountain (screenplay) -------------------------------------------- */

.fountain {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-body);
  background: #171716;
  border-left: 2px solid var(--rule-soft);
  padding: 1.5rem 1.4rem;
  border-radius: 0 4px 4px 0;
  overflow-x: auto;
  margin: 2em 0;
  letter-spacing: -0.01em;
}

.fountain p {
  margin: 0 0 1em;
}

.fountain p:last-child {
  margin-bottom: 0;
}

.fountain-scene {
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fountain-transition {
  text-align: right;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fountain-center {
  text-align: center;
}

.fountain-character {
  color: var(--text);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0 !important;
}

.fountain-paren,
.fountain-dialogue {
  text-align: center;
  padding: 0 2.5rem;
  margin-bottom: 0 !important;
}

.fountain-paren {
  color: var(--text-faint);
}

.fountain-dialogue:last-child,
.fountain-dialogue {
  margin-bottom: 1em !important;
}

.fountain-character + .fountain-dialogue,
.fountain-paren + .fountain-dialogue,
.fountain-dialogue + .fountain-dialogue {
  margin-bottom: 0 !important;
}

/* --- Subscribe ------------------------------------------------------- */

.endnote {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--text-faint);
  font-family: var(--sans);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.25rem;
}

.endnote a {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-soft);
}

.endnote a:hover {
  color: var(--text-soft);
}

.endnote .totop {
  white-space: nowrap;
  color: var(--text-faint);
  text-decoration: none;
}

.endnote .totop:hover {
  color: var(--text-dim);
}

.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 2rem 0 0.9rem;
  font-family: var(--sans);
}

.subscribe-form input[type="email"] {
  flex: 1 1 14rem;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.65rem 0.8rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
}

.subscribe-form input[type="email"]::placeholder {
  color: var(--text-faint);
}

.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: var(--rule-soft);
}

.subscribe-form button {
  background: var(--text);
  color: var(--bg);
  border: 0;
  border-radius: 4px;
  padding: 0.65rem 1.15rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.subscribe-form button:hover {
  background: #fff;
}

.fineprint {
  font-family: var(--sans);
  font-size: 0.78125rem;
  color: var(--text-faint);
  margin: 0;
}

/* --- About links ------------------------------------------------------ */

.links {
  font-family: var(--sans);
  margin-top: 2.5rem !important;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--text-faint);
  letter-spacing: -0.005em;
}

.links a {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-soft);
}

.links a:hover {
  color: var(--text-soft);
  text-decoration-color: var(--text-dim);
}

/* --- Footer ----------------------------------------------------------- */

.footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.78125rem;
  color: var(--text-faint);
  font-family: var(--sans);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.footer a {
  color: var(--text-faint);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text-dim);
}

/* --- Mobile ------------------------------------------------------------ */

@media (max-width: 540px) {
  body {
    font-size: 16px;
  }
  .wrap {
    padding: 2.5rem 1.25rem 3.5rem;
  }
  .masthead {
    margin-bottom: 2.5rem;
  }
  .masthead nav {
    gap: 1rem;
  }
  article h1 {
    font-size: 1.375rem;
  }
  .dek--article {
    font-size: 0.9375rem;
  }
  .prose {
    font-size: 1.0625rem;
  }
  .fountain {
    font-size: 0.75rem;
    padding: 1.1rem 1rem;
  }
  .fountain-paren,
  .fountain-dialogue {
    padding: 0 0.75rem;
  }
  .archive li {
    gap: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
