/* =========================================================
   Detach Mode — notes.hrldm.info
   Visual language: Harold M. Martinez portfolio · 2026
   ========================================================= */

/* ─── Design Tokens (Night / Default) ─────────────────── */
:root {
  --ink: #f3ede1;
  --ink-dim: #b8b0a6;
  --ink-mute: #7a7268;
  --bg: #0a0a0a;
  --bg-1: #121110;
  --bg-2: #1a1916;
  --line: rgba(243, 237, 225, 0.08);
  --line-strong: rgba(243, 237, 225, 0.18);
  --accent: #e8b45a;
  --accent-warm: #f0c77b;

  --serif: "Fraunces", "Times New Roman", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --col: 680px;
  --col-wide: 900px;
  --gap: 24px;
}

/* ─── Day Theme ────────────────────────────────────────── */
[data-theme="day"] {
  --ink: #171512;
  --ink-dim: #56504a;
  --ink-mute: #8a827a;
  --bg: #f6f1e8;
  --bg-1: #efe8da;
  --bg-2: #e6dcc8;
  --line: rgba(23, 21, 18, 0.1);
  --line-strong: rgba(23, 21, 18, 0.22);
  --accent: #c87a1f;
  --accent-warm: #a86213;
}

/* ─── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 600ms var(--ease), color 600ms var(--ease);
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--bg); }

/* =========================================================
   NAVIGATION
   ========================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 20px 40px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 400ms var(--ease), padding 400ms var(--ease), background 600ms var(--ease);
}
.nav.is-scrolled {
  border-bottom-color: var(--line);
  padding: 14px 40px;
}

/* Brand — "NOTES" or site name */
.nav__brand {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  transition: color 200ms var(--ease);
}
.nav__brand:hover { color: var(--accent); }

/* Centered links */
.nav__links {
  justify-self: center;
  display: flex; gap: 32px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav__links a {
  position: relative;
  color: var(--ink-dim);
  padding: 6px 0;
  transition: color 200ms var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  height: 1px; width: 0;
  background: var(--accent);
  transition: width 400ms var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after, .nav__links a.active::after { width: 100%; }
.nav__links a.active { color: var(--ink); }

/* Theme toggle */
.nav__right {
  display: flex; align-items: center; gap: 14px;
}
.theme-toggle {
  display: inline-flex; align-items: center;
  width: 48px; height: 26px;
  border-radius: 100px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  position: relative;
  padding: 0 4px;
  cursor: pointer;
  transition: background 300ms var(--ease), border-color 300ms var(--ease);
}
.theme-toggle__thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 400ms var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
[data-theme="day"] .theme-toggle__thumb { transform: translateX(22px); }
.theme-toggle__icon {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  font-size: 10px;
  color: var(--ink-mute);
  pointer-events: none;
}
.theme-toggle__icon--sun { right: 7px; }
.theme-toggle__icon--moon { left: 7px; }

@media (max-width: 680px) {
  .nav { padding: 14px 20px; gap: 12px; grid-template-columns: auto 1fr auto; }
  .nav.is-scrolled { padding: 12px 20px; }
  .nav__links { gap: 20px; font-size: 10px; }
}
@media (max-width: 500px) {
  .nav__links { gap: 14px; }
}

/* =========================================================
   PAGE SHELL
   ========================================================= */
.page-wrap {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--gap);
  padding-top: 100px;
  padding-bottom: 80px;
}
.page-wrap--wide {
  max-width: var(--col-wide);
}

/* =========================================================
   HOME / INDEX HERO
   ========================================================= */
.site-hero {
  padding-top: 140px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--line);
}
.site-hero__kicker {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 20px;
}
.site-hero__title {
  font: 400 clamp(36px, 6vw, 72px)/1.05 var(--serif);
  font-variation-settings: "opsz" 144, "wght" 400;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 20px;
  animation: fadeUp 700ms var(--ease) 100ms both;
}
.site-hero__desc {
  font: 400 16px/1.6 var(--sans);
  color: var(--ink-dim);
  max-width: 44ch;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   FEED / POST CARDS
   ========================================================= */
.feed {
  padding-top: 48px;
}

.post-card {
  display: block;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  transition: none;
}
.post-card:first-child { padding-top: 0; }

.post-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 20px;
  border: 1px solid var(--line-strong);
}

.post-card-title {
  font: 400 clamp(20px, 2.4vw, 26px)/1.2 var(--serif);
  font-variation-settings: "opsz" 144, "wght" 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 10px;
  transition: color 200ms var(--ease);
}
.post-card-link:hover .post-card-title { color: var(--accent); }

.post-card-link {
  text-decoration: none; color: inherit; display: block;
}

.post-card-excerpt {
  font: 400 15px/1.6 var(--sans);
  color: var(--ink-dim);
  margin-bottom: 12px;
}

.post-card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.post-card-meta time {}
.post-card-meta .sep { opacity: 0.4; }

/* Tags inline in card meta */
.post-card-meta .tag {
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink-mute);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.post-card-meta .tag:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Thought cards (minimal: serif body + date, no chrome) ─── */
.thought-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 32px 0 28px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  transition: opacity 200ms var(--ease);
}
.thought-card:hover { opacity: 0.7; }
.thought-card:hover .thought-card-body { color: var(--accent); }
.thought-card-quote { display: none; }
.thought-card-body {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 18px;
  transition: color 200ms var(--ease);
}
.thought-card-meta {
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* =========================================================
   POST HERO
   ========================================================= */
.post-hero {
  padding-top: 120px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.post-hero__kicker {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 24px;
}
.post-hero__kicker .sep { opacity: 0.4; }
.post-hero__kicker .tag {
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink-mute);
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.post-hero__kicker .tag:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.post-hero__title {
  font: 400 clamp(36px, 5.5vw, 64px)/1.05 var(--serif);
  font-variation-settings: "opsz" 144, "wght" 400;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 20px;
  max-width: 18ch;
}
.post-hero__subtitle {
  font: 400 clamp(17px, 1.5vw, 20px)/1.5 var(--sans);
  color: var(--ink-dim);
  margin-bottom: 20px;
  max-width: 52ch;
}

/* =========================================================
   COVER IMAGE
   ========================================================= */
.cover {
  margin: 40px 0;
}
.cover.img--wide {
  margin-left: calc(-1 * (var(--col-wide) - var(--col)) / 2);
  margin-right: calc(-1 * (var(--col-wide) - var(--col)) / 2);
  width: var(--col-wide);
  max-width: calc(100vw - 32px);
}
.cover.img--full {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  max-width: 100vw;
}
.cover img {
  width: 100%;
  max-width: 100%;
  display: block;
  border-radius: 2px;
  border: 1px solid var(--line-strong);
}
.cover.img--full img { border-radius: 0; border-left: 0; border-right: 0; }
.cover figcaption {
  font: 500 10px/1.5 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 10px;
  text-align: center;
}

@media (max-width: 920px) {
  .cover.img--wide {
    margin-left: calc(-1 * var(--gap));
    margin-right: calc(-1 * var(--gap));
    width: calc(100% + 2 * var(--gap));
    max-width: none;
  }
}

/* =========================================================
   PROSE
   ========================================================= */
.article-body {
  padding: 48px 0 64px;
}

/* Prose — paragraphs + body */
.prose {
  font: 400 18px/1.7 var(--sans);
  color: var(--ink);
}
.prose p { margin-bottom: 1.35em; }

/* Headings use Fraunces */
.prose h1, .prose h2, .prose h3 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144, "wght" 400;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 2.2em;
  margin-bottom: 0.7em;
}
.prose h1 { font-size: clamp(28px, 3.5vw, 38px); }
.prose h2 { font-size: clamp(22px, 2.5vw, 28px); }
.prose h3 { font-size: clamp(18px, 2vw, 22px); }
.prose h4 {
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 2em;
  margin-bottom: 0.7em;
}

.prose hr {
  border: none;
  text-align: center;
  margin: 2.5em 0;
  opacity: 0;
  height: 1px;
  background: var(--line);
}
.prose hr::after {
  content: "· · ·";
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.5em;
  color: var(--ink-mute);
  opacity: 1;
}

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 24px;
  color: var(--ink-dim);
  font-style: italic;
  margin: 1.8em 0;
  font-family: var(--serif);
  font-size: 1.05em;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--ink);
}
.prose pre {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 18px 20px;
  overflow-x: auto;
  font: 400 13px/1.6 var(--mono);
  margin: 1.8em 0;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.prose ul, .prose ol {
  padding-left: 1.5em;
  margin-bottom: 1.35em;
}
.prose li { margin-bottom: 0.4em; }

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

.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }

/* ─── Images inside prose ─── */
.prose .img {
  margin: 2em 0;
}
.prose .img img {
  width: 100%;
  max-width: 720px;
  border-radius: 2px;
  border: 1px solid var(--line-strong);
}
.prose .img figcaption {
  font: 500 10px/1.5 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 10px;
}
.prose .img--wide {
  margin-left: calc(-1 * (var(--col-wide) - var(--col)) / 2);
  margin-right: calc(-1 * (var(--col-wide) - var(--col)) / 2);
  width: var(--col-wide);
  max-width: calc(100vw - 32px);
}
.prose .img--full {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  max-width: 100vw;
}
.prose .img--full img { border-radius: 0; border-left: 0; border-right: 0; }
@media (max-width: 920px) {
  .prose .img--wide {
    margin-left: calc(-1 * var(--gap));
    margin-right: calc(-1 * var(--gap));
    width: calc(100% + 2 * var(--gap));
    max-width: none;
  }
}

/* =========================================================
   AUDIO & VIDEO
   ========================================================= */
.prose audio,
.prose video {
  display: block;
  width: 100%;
  margin: 1.6em 0;
  border-radius: 2px;
  outline: none;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color-scheme: dark;
}
.prose video {
  aspect-ratio: 16/9;
  max-width: 100%;
}

/* Audio block cards (when paired with title/duration) */
.audio-block {
  margin: 2em 0;
  padding: 24px 28px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color 200ms var(--ease);
}
.audio-block:hover { border-color: var(--line-strong); }

.audio-block .audio-title {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 10px;
}
.audio-block .audio-title::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  opacity: 0.7;
}
.audio-block .audio-duration {
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.audio-block audio {
  display: block;
  width: 100%;
  border-radius: 2px;
  outline: none;
  color-scheme: dark;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

/* Video block */
.video-block {
  margin: 2em 0;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.video-block video {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
}

/* =========================================================
   TAGS
   ========================================================= */
.tag {
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.tag:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* =========================================================
   POST FOOTER
   ========================================================= */
.post-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  margin-top: 48px;
}

.back-link {
  margin-top: 24px;
}
.back-link a {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  transition: color 200ms var(--ease);
}
.back-link a:hover { color: var(--accent); }

/* =========================================================
   ARCHIVE PAGE
   ========================================================= */
.page-hero {
  padding-top: 120px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.page-hero__title {
  font: 400 clamp(32px, 5vw, 56px)/1 var(--serif);
  font-variation-settings: "opsz" 144, "wght" 400;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.archive-section {
  margin-top: 48px;
  margin-bottom: 36px;
}
.archive-section__month {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.archive-list {
  list-style: none; padding: 0;
}
.archive-list li {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.archive-date {
  font: 500 10px/1.4 var(--mono);
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  padding-top: 2px;
}
.archive-list a {
  font: 400 16px/1.3 var(--serif);
  letter-spacing: -0.005em;
  color: var(--ink);
  transition: color 200ms var(--ease);
}
.archive-list a:hover { color: var(--accent); }
.archive-thought-label {
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 5px;
  margin-right: 6px;
  vertical-align: 1px;
}

/* =========================================================
   TAG PAGE
   ========================================================= */
.tag-page-title {
  font: 400 clamp(32px, 5vw, 56px)/1 var(--serif);
  font-variation-settings: "opsz" 144, "wght" 400;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* =========================================================
   THOUGHT PAGE
   ========================================================= */
.thought-page {
  text-align: left;
  padding: 120px 0 40px;
  max-width: 640px;
  margin: 0 auto;
}
.thought-page-quote { display: none; }
.thought-prose {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
}
.thought-prose p { margin: 0 0 0.8em; }

/* =========================================================
   FOOTER — Harold's exact treatment
   ========================================================= */
.foot {
  padding: 36px 40px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  transition: background 600ms var(--ease);
}
@media (max-width: 820px) { .foot { padding: 28px 20px; } }

.foot__inner {
  max-width: var(--col-wide);
  margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.foot__m { text-align: center; }
@media (max-width: 700px) {
  .foot__inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .foot__m { text-align: left; }
}

/* =========================================================
   A11Y / MOTION
   ========================================================= */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .site-hero__title { animation: none; opacity: 1; transform: none; }
}

/* =========================================================
   EMPTY STATE
   ========================================================= */
.empty-state {
  margin-top: 48px;
  text-align: center;
  color: var(--ink-mute);
  font: 400 15px/1.6 var(--sans);
  padding: 24px 0;
}
