/* ------------------------------------------------------------------
   jasonduffett.net — dark zine
   tech = burnt orange · music = riso blue · misc = riso chartreuse
   ------------------------------------------------------------------ */

@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&family=Fraunces:ital,opsz,wght@1,9..144,800;1,9..144,900&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap");

:root {
  --ink: #0f0d0c;
  --ink-2: #1a1612;
  --paper: #ece4d3;
  --paper-dim: #c9c1b0;
  --muted: #8a8275;
  --rule: #2a2520;
  --tech: #ff7a3d;
  --music: #5dadff;
  --misc: #c4d65a;
  --code-bg: #1a1612;
  --measure: 38rem;
  --accent: var(--tech);
  --serif: "Source Serif 4", Georgia, serif;
  --display: "Fraunces", "Source Serif 4", Georgia, serif;
  --hand: "Caveat", "Source Serif 4", cursive;
  --ui: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

[data-category="tech"] {
  --accent: var(--tech);
}
[data-category="music"] {
  --accent: var(--music);
}
[data-category="misc"] {
  --accent: var(--misc);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-optical-sizing: auto;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* paper grain — fixed-position noise overlay, very subtle */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.92  0 0 0 0 0.89  0 0 0 0 0.83  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

/* ------------------------------ Layout --------------------------- */
.wrap {
  position: relative;
  z-index: 2;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

@media (min-width: 900px) {
  .wrap {
    max-width: 60rem;
    padding: 3rem 2.5rem 5rem;
  }
}

article {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ------------------------------ Header --------------------------- */
header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px dashed var(--rule);
}

header.site a.brand {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--paper);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
}

header.site a.brand .brand-dot {
  color: var(--accent);
  font-size: 1.4em;
  line-height: 0;
}

header.site nav {
  font-family: var(--ui);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

header.site nav a {
  color: var(--paper-dim);
  text-decoration: none;
  position: relative;
  padding: 0.15rem 0;
  transition: color 0.15s ease;
}

header.site nav a:hover,
header.site nav a[aria-current="page"] {
  color: var(--paper);
}

header.site nav .nav-tech:hover,
header.site nav .nav-tech[aria-current="page"] {
  color: var(--tech);
}
header.site nav .nav-music:hover,
header.site nav .nav-music[aria-current="page"] {
  color: var(--music);
}
header.site nav .nav-misc:hover,
header.site nav .nav-misc[aria-current="page"] {
  color: var(--misc);
}

/* ------------------------------ Hero (home) ---------------------- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 1rem 0 3.5rem;
  align-items: center;
}

@media (min-width: 720px) {
  .hero {
    grid-template-columns: 1fr auto;
    gap: 3rem;
    margin: 1.5rem 0 4.5rem;
  }
}

.hero-headline {
  font-family: var(--display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(3.5rem, 12vw, 7.5rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin: 0;
  color: var(--paper);
}

.hero-headline .line {
  display: block;
}

.hero-headline .accent-1 {
  color: var(--tech);
}
.hero-headline .accent-2 {
  color: var(--music);
}

.hero-squiggle {
  display: block;
  width: min(16rem, 60%);
  height: 0.7rem;
  color: var(--paper-dim);
  margin: 0.6rem 0 0.9rem;
}

.hero-tagline {
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(1.2rem, 4vw, 1.55rem);
  line-height: 1.3;
  color: var(--paper-dim);
  margin: 0;
  max-width: 22rem;
  overflow-wrap: break-word;
}

@media (min-width: 720px) {
  .hero-tagline {
    transform: rotate(-1.2deg);
    transform-origin: left center;
  }
}

.hero-tagline em {
  color: var(--tech);
  font-style: normal;
}

.hero-tagline strong {
  color: var(--music);
  font-weight: 500;
}

/* sketch with a slight collage feel */
.hero-sketch {
  position: relative;
  width: 100%;
  max-width: 280px;
  justify-self: start;
  transform: rotate(-3deg);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
}

@media (min-width: 720px) {
  .hero-sketch {
    max-width: 320px;
    justify-self: end;
  }
}

.hero-sketch img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper);
  padding: 0.75rem 0.75rem 1.75rem;
  border-radius: 1px;
}

.hero-sketch::before,
.hero-sketch::after {
  content: "";
  position: absolute;
  width: 4.5rem;
  height: 1.4rem;
  background: rgba(236, 228, 211, 0.35);
  border: 1px solid rgba(236, 228, 211, 0.18);
  pointer-events: none;
}

.hero-sketch::before {
  top: -0.6rem;
  left: 1.2rem;
  transform: rotate(-8deg);
}

.hero-sketch::after {
  bottom: -0.5rem;
  right: 1.5rem;
  transform: rotate(6deg);
}

/* ------------------------------ Currently (home) ----------------- */
.currently {
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  line-height: 1.3;
  color: var(--paper-dim);
  margin: 0 0 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  max-width: 34rem;
}

@media (min-width: 720px) {
  .currently {
    transform: rotate(0.6deg);
    transform-origin: left center;
    margin: -1.5rem 0 3rem;
  }
}

.currently .currently-label {
  color: var(--muted);
  letter-spacing: 0.01em;
}

.currently .currently-arrow {
  color: var(--accent);
  font-size: 1.15em;
  line-height: 1;
}

.currently a {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.15s ease;
}

.currently a:hover {
  color: var(--accent);
}

/* ------------------------------ Section heading ------------------ */
.section-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 3rem 0 1.5rem;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.85rem;
  color: var(--paper);
  line-height: 1;
}

.section-heading .orn-sparkle {
  width: 1rem;
  height: 1rem;
  color: var(--accent);
  flex: none;
}

.section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--rule), transparent);
}

/* ------------------------------ Intro (category pages) ----------- */
.intro {
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(1.3rem, 4.2vw, 1.6rem);
  line-height: 1.3;
  color: var(--paper-dim);
  max-width: 28rem;
  margin: 1rem 0 3rem;
  overflow-wrap: break-word;
}

@media (min-width: 720px) {
  .intro {
    transform: rotate(-0.8deg);
    transform-origin: left center;
  }
}

.intro strong {
  color: var(--accent);
  font-weight: 500;
}

/* ------------------------------ Post list ------------------------ */
.year {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--accent);
  margin: 2.25rem 0 0.5rem;
  display: inline-block;
  transform: rotate(-2deg);
  transform-origin: left center;
}

ul.posts {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  border-top: 1px dashed var(--rule);
}

ul.posts li {
  border-bottom: 1px dashed var(--rule);
  padding: 0.95rem 0;
  display: grid;
  grid-template-columns: auto 6.5rem 1fr auto;
  gap: 0.9rem;
  align-items: baseline;
  --accent: var(--paper-dim);
}

ul.posts .post-meta {
  white-space: nowrap;
}

ul.posts li .orn-sparkle {
  width: 0.8rem;
  height: 0.8rem;
  color: var(--accent);
  opacity: 0.55;
  transition:
    opacity 0.15s ease,
    transform 0.2s ease;
}

ul.posts li:hover .orn-sparkle {
  opacity: 1;
  transform: rotate(45deg) scale(1.15);
}

ul.posts time,
ul.posts .reading-time {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

ul.posts .reading-time::before {
  content: " · ";
}

ul.posts a.title {
  color: var(--paper);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.4;
  transition: color 0.15s ease;
}

ul.posts li:hover a.title,
ul.posts a.title:focus-visible {
  color: var(--accent);
}

ul.posts .tag {
  justify-self: end;
}

@media (max-width: 560px) {
  ul.posts li {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    row-gap: 0.25rem;
    column-gap: 0.7rem;
  }
  ul.posts li .orn-sparkle {
    grid-row: 1;
  }
  ul.posts li .post-meta {
    grid-row: 1;
  }
  ul.posts li a.title {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  ul.posts li .tag {
    display: none;
  }
}

/* ------------------------------ Threads (home) ------------------- */
.threads {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 720px) {
  .threads {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

.thread {
  --accent: var(--paper-dim);
  border: 1px dashed var(--rule);
  border-left: 3px solid var(--accent);
  padding: 1.1rem 1.25rem 1.25rem;
  background: var(--ink-2);
}

.thread-title {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.1;
  color: var(--accent);
  margin: 0 0 0.85rem;
}

.thread-parts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.thread-parts li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.6rem;
  align-items: baseline;
}

.thread-part-num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.thread-parts a {
  color: var(--paper);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.35;
  transition: color 0.15s ease;
}

.thread-parts a:hover,
.thread-parts a:focus-visible {
  color: var(--accent);
}

/* ------------------------------ Tags ----------------------------- */
.tag {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0;
  text-transform: lowercase;
  color: var(--paper-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1;
}

.tag::before {
  content: "[";
  color: var(--muted);
}
.tag::after {
  content: "]";
  color: var(--muted);
}

.tag.tech {
  color: var(--tech);
}
.tag.music {
  color: var(--music);
}
.tag.misc {
  color: var(--misc);
}

/* ------------------------------ Article -------------------------- */
article header.post-head {
  margin: 1rem 0 2.5rem;
}

article h1 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 0.85rem;
  color: var(--paper);
}

article .meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  gap: 1rem;
  align-items: center;
  letter-spacing: 0.02em;
}

article .meta time {
  font-variant-numeric: tabular-nums;
}

article .post-divider {
  display: block;
  width: 100%;
  max-width: 14rem;
  height: 0.7rem;
  margin: 1.5rem 0 2.5rem;
  color: var(--accent);
  opacity: 0.7;
}

article p {
  margin: 0 0 1.25rem;
}

article h2 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.55rem;
  line-height: 1.15;
  margin: 2.75rem 0 0.75rem;
  color: var(--paper);
}

article h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
  color: var(--paper);
}

article a {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

article a:hover {
  color: var(--accent);
}

article strong {
  color: var(--paper);
  font-weight: 600;
}

article em {
  color: var(--paper);
}

article ul,
article ol {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
}

article ul li::marker {
  color: var(--accent);
}

article blockquote {
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--paper-dim);
  font-style: italic;
}

article hr {
  border: none;
  height: 0.7rem;
  width: min(12rem, 60%);
  margin: 3rem auto;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 14' preserveAspectRatio='none'><path d='M2 7 C 12 1, 22 13, 32 7 S 52 1, 62 7 S 82 13, 92 7 S 112 1, 122 7 S 142 13, 152 7 S 172 1, 182 7 S 202 13, 212 7 S 232 1, 238 7' fill='none' stroke='%238a8275' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

article img {
  max-width: 100%;
  height: auto;
  border-radius: 2px;
  background: var(--paper);
  padding: 0.5rem;
}

/* ------------------------------ Code ----------------------------- */
article pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--paper);
  margin: 1.5rem 0;
}

article code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--ink-2);
  color: var(--paper);
  padding: 0.1em 0.38em;
  border-radius: 3px;
  border: 1px solid var(--rule);
}

article pre code {
  background: none;
  padding: 0;
  border: 0;
}

/* Prism — riso/dark palette */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--muted);
  font-style: italic;
}
.token.punctuation {
  color: var(--paper-dim);
}
.token.keyword,
.token.builtin {
  color: var(--music);
}
.token.class-name {
  color: var(--misc);
}
.token.string,
.token.char,
.token.attr-value {
  color: var(--tech);
}
.token.number,
.token.boolean,
.token.constant {
  color: var(--misc);
}
.token.function {
  color: var(--music);
}
.token.tag,
.token.selector {
  color: var(--tech);
}
.token.operator,
.token.entity,
.token.url,
.token.variable,
.token.parameter {
  color: var(--paper-dim);
}

/* ------------------------------ About ---------------------------- */
.about-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  margin: 1.5rem 0 3rem;
}

@media (min-width: 720px) {
  .about-layout {
    grid-template-columns: 1fr 280px;
    gap: 3.5rem;
  }
}

.about-prose h1 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1;
  margin: 0 0 1.25rem;
  color: var(--paper);
}

.about-prose > p:first-of-type {
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(1.25rem, 4.4vw, 1.55rem);
  line-height: 1.35;
  color: var(--paper-dim);
  margin: 0 0 1.75rem;
  overflow-wrap: break-word;
}

.about-prose > p:first-of-type strong {
  color: var(--tech);
  font-weight: 500;
}

.about-prose p {
  margin: 0 0 1.1rem;
  max-width: 38rem;
}

.about-prose a {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.about-prose a:hover {
  color: var(--accent);
}

.about-sketch {
  max-width: 240px;
}

@media (min-width: 720px) {
  .about-sketch {
    max-width: 280px;
    justify-self: center;
    margin-top: 1rem;
  }
}

/* ------------------------------ Footer --------------------------- */
footer.site {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--ui);
  font-size: 0.78rem;
  color: var(--muted);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

footer.site .footer-sign {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
  line-height: 1;
}

footer.site .footer-squiggle {
  display: block;
  height: 0.6rem;
  color: var(--rule);
}

footer.site .footer-squiggle svg {
  width: 100%;
  height: 100%;
  display: block;
}

footer.site .footer-meta {
  text-align: right;
  white-space: nowrap;
}

footer.site a {
  color: var(--paper-dim);
  text-decoration: none;
}

footer.site a:hover {
  color: var(--accent);
}

@media (max-width: 560px) {
  footer.site {
    grid-template-columns: 1fr;
    text-align: left;
  }
  footer.site .footer-meta {
    text-align: left;
  }
  footer.site .footer-squiggle {
    display: none;
  }
}

/* ------------------------------ Ornaments ------------------------ */
.orn-squiggle,
.orn-sparkle {
  display: inline-block;
  vertical-align: middle;
}

.orn-squiggle {
  width: 100%;
  height: 100%;
}

.orn-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* selection */
::selection {
  background: var(--accent);
  color: var(--ink);
}

/* ------------------------------ Consent banner ------------------- */
.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--paper);
  color: var(--ink);
  border-top: 4px solid var(--accent);
  box-shadow: 0 -8px 24px -10px rgba(0, 0, 0, 0.5);
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.consent[hidden] {
  display: none;
}

@media (min-width: 720px) {
  .consent {
    padding: 1.1rem 2.5rem;
  }
}

.consent-msg {
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(1.1rem, 2.6vw, 1.3rem);
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
  max-width: 42rem;
  flex: 1 1 20rem;
}

.consent-msg .consent-cta {
  white-space: nowrap;
}

.consent-msg a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.15s ease;
}

.consent-msg a:hover {
  color: var(--accent);
}

.consent-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.consent-btn {
  font-family: var(--ui);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.55rem 1.1rem;
  border-radius: 2px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.consent-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.consent-btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.consent-btn--ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.consent-btn--primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}

.consent-btn--primary:hover {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}
