/* FONTS */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/Inter-VariableFont_slnt,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* OPEN PROPS TOKENS (inlined) */
:root {
  /* font sizes */
  --font-size-00: .625rem;
  --font-size-0: .75rem;
  --font-size-1: 1rem;
  --font-size-2: 1.125rem;
  --font-size-3: 1.25rem;
  --font-size-4: 1.5rem;
  --font-size-5: 2rem;
  --font-size-6: 2.5rem;
  /* font weights */
  --font-weight-5: 500;
  --font-weight-6: 600;
  --font-weight-7: 700;
  /* line heights */
  --font-lineheight-2: 1.375;
  --font-lineheight-3: 1.5;
  --font-lineheight-4: 1.75;
  /* spacing */
  --size-1: .25rem;
  --size-2: .5rem;
  --size-3: 1rem;
  --size-4: 1.25rem;
  --size-5: 1.5rem;
  --size-6: 1.75rem;
  --size-7: 2rem;
  --size-8: 3rem;
  --size-10: 5rem;
  --size-fluid-3: clamp(1.5rem, 3vw, 2rem);
  --size-fluid-4: clamp(2rem, 4vw, 3rem);
  --size-fluid-5: clamp(4rem, 5vw, 5rem);
  /* radius */
  --radius-1: 2px;
  --radius-2: 5px;
  /* shadows */
  --shadow-3: 0 -1px 3px 0 hsl(220 3% 15% / 12%), 0 4px 12px -5px hsl(220 3% 15% / 15%);
  --shadow-5: 0 -1px 5px 0 hsl(220 3% 15% / 14%), 0 12px 30px -5px hsl(220 3% 15% / 20%);
}

/* ZINC PALETTE */
:root {
  --zinc-50: #fafafa;
  --zinc-100: #f4f4f5;
  --zinc-200: #e4e4e7;
  --zinc-300: #d4d4d8;
  --zinc-400: #a1a1aa;
  --zinc-500: #71717a;
  --zinc-600: #52525b;
  --zinc-700: #3f3f46;
  --zinc-800: #27272a;
  --zinc-900: #18181b;
  --accent: #fc8c04;
  --amber-600: #d97706;
  --amber-800: #92400e;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
}

/* BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--zinc-800);
  color: var(--zinc-400);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: var(--font-size-1);
  line-height: var(--font-lineheight-3);
  -webkit-font-smoothing: antialiased;
}

h1, .title { color: var(--accent); }
h2 { color: var(--zinc-300); }
h3, h4 { color: var(--zinc-300); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* CONTAINER */
.container {
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.container--wide {
  max-width: 1024px;
}

/* NAV */
.nav {
  padding: var(--size-3) 0;
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 var(--size-fluid-4);
}

.nav-left,
.nav-right-links {
  display: none;
}

.nav-left a,
.nav-right-links a {
  padding: var(--size-2) var(--size-4);
  font-weight: var(--font-weight-5);
  color: var(--zinc-400);
  transition: color 0.15s;
}

.nav-left a:hover,
.nav-right-links a:hover {
  color: var(--blue-500);
}

.nav-brand {
  font-size: var(--font-size-4);
  font-weight: var(--font-weight-7);
  color: var(--amber-600);
  margin: var(--size-1) 0;
}

.nav-brand a { color: inherit; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--size-2);
}

@media (min-width: 768px) {
  .nav-left, .nav-right-links { display: flex; align-items: center; }
  .nav-toggle, .nav-mobile-menu { display: none !important; }
}

/* MOBILE NAV */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--size-2);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--zinc-400);
}

.nav-mobile-menu {
  display: none;
  width: 100%;
  padding: var(--size-3) 0;
  text-align: center;
}

.nav-mobile-menu--open { display: block; }

.nav-mobile-link {
  display: block;
  padding: var(--size-3) 0;
  font-weight: var(--font-weight-5);
  color: var(--zinc-400);
  border-bottom: 1px solid var(--zinc-700);
}

.nav-mobile-link:hover { color: var(--blue-500); }
.nav-mobile-link:last-child { border-bottom: none; }

/* SEARCH TRIGGER */
.search-trigger {
  display: flex;
  align-items: center;
  gap: var(--size-1);
  background: none;
  border: none;
  color: var(--zinc-400);
  cursor: pointer;
  padding: var(--size-2);
  transition: color 0.15s;
}

.search-trigger:hover { color: var(--blue-500); }

.rss-link {
  display: flex;
  align-items: center;
  padding: var(--size-2);
  color: var(--zinc-400);
  transition: color 0.15s;
}

.rss-link:hover { color: var(--accent); }

/* HERO */
.hero {
  padding-bottom: 2.5rem;
}

.hero-inner {
  position: relative;
  padding-top: 2.5rem;
}

.hero-image {
  width: 100%;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.hero-bio {
  background: var(--zinc-700);
  padding: 1.25rem;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-3);
}

.hero-bio-title {
  font-size: 1.5rem;
  color: white;
  font-weight: var(--font-weight-7);
  line-height: var(--font-lineheight-3);
}

.hero-bio a { color: inherit; }
.hero-bio a:hover { color: var(--accent); background: white; }

.hero-bio-text { margin: 0; }

@media (min-width: 768px) {
  .hero { padding-top: 2rem; padding-bottom: 0; }
  .hero-inner { position: relative; height: 512px; }
  .hero-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 512px;
    height: 512px;
    object-fit: cover;
    margin-bottom: 0;
  }
  .hero-bio { position: relative; width: 400px; }
}

/* SECTION */
.section-header {
  margin-top: var(--size-fluid-4);
  margin-bottom: var(--size-fluid-4);
}

.section-header h1,
.section-header h2 {
  font-size: var(--font-size-6);
  font-weight: var(--font-weight-7);
  margin-bottom: var(--size-fluid-4);
}

.section-header hr {
  border: none;
  border-top: 1px solid var(--zinc-700);
}

.section-intro {
  font-size: var(--font-size-3);
  color: var(--zinc-500);
  margin-bottom: var(--size-fluid-4);
}

/* POST LIST */
.post-list {
  list-style: none;
}

.post-list li {
  padding: var(--size-6) 0;
}

.post-list li + li {
  border-top: 1px solid var(--zinc-700);
}

.post-list-title {
  font-size: var(--font-size-6);
  font-weight: var(--font-weight-7);
  line-height: var(--font-lineheight-2);
  color: var(--zinc-300);
  margin: 0;
}

.post-list-title a { color: inherit; transition: color 0.15s; }
.post-list-title a:hover { color: var(--zinc-100); }

.post-list-meta {
  padding: var(--size-2) 0;
}

.post-list-date {
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
}

.post-list-tags a { color: var(--zinc-500); }
.post-list-tags .hash { color: var(--amber-800); }

.post-list-desc { margin: 0; }

/* IMAGE GRID (AI, Music) */
.image-grid-top {
  display: grid;
  gap: var(--size-fluid-4);
}

@media (min-width: 768px) {
  .image-grid-top { grid-template-columns: repeat(2, 1fr); }
}

.image-grid-rest {
  display: grid;
  gap: var(--size-fluid-4);
  margin-top: var(--size-fluid-4);
}

@media (min-width: 768px) {
  .image-grid-rest { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .image-grid-rest { grid-template-columns: repeat(3, 1fr); }
}

.image-card { cursor: pointer; }

.image-card-thumb {
  overflow: hidden;
  border-radius: var(--radius-2);
  background: var(--zinc-800);
  transition: transform 0.3s;
}

.image-card-thumb:hover { transform: scale(1.05); }

.image-card-thumb a { display: block; }

.image-card-thumb--video a { aspect-ratio: 16 / 9; }

.image-card-thumb--square a {
  position: relative;
  aspect-ratio: 1;
}

.image-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-card-thumb--square img {
  position: absolute;
  inset: 0;
}

.image-card-tags {
  display: flex;
  gap: var(--size-2);
  margin-top: var(--size-4);
}

.image-card-tags span {
  font-size: 0.75rem;
  font-weight: var(--font-weight-5);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue-600);
}

.image-card-title {
  font-size: var(--font-size-2);
  font-weight: var(--font-weight-6);
  line-height: var(--font-lineheight-2);
  margin-top: var(--size-2);
  color: white;
}

.image-card-title a {
  color: inherit;
  background-image: linear-gradient(to right, var(--amber-800), var(--zinc-900));
  background-size: 0px 10px;
  background-position: left bottom;
  background-repeat: no-repeat;
  transition: background-size 0.5s;
}

.image-card:hover .image-card-title a {
  background-size: 100% 10px;
}

.image-card-meta {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  margin-top: var(--size-2);
  color: var(--zinc-400);
  font-size: 0.875rem;
}

.image-card-meta .sep {
  color: var(--zinc-600);
  font-size: 0.75rem;
}

/* PROJECT LIST */
.project-list {
  display: flex;
  flex-direction: column;
  gap: var(--size-fluid-5);
}

.project-card {
  position: relative;
  min-height: 20rem;
  padding-top: var(--size-fluid-4);
}

.project-card-image {
  width: 100%;
  height: 16rem;
  object-fit: cover;
  border-radius: var(--radius-2);
  margin-bottom: var(--size-3);
}

.project-card-body {
  background: var(--zinc-700);
  padding: var(--size-4);
  border-radius: var(--radius-2);
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
  box-shadow: var(--shadow-3);
}

.project-card-title {
  font-size: var(--font-size-5);
  font-weight: var(--font-weight-7);
  color: var(--zinc-300);
}

.project-card-title a { color: inherit; }
.project-card-title a:hover { color: var(--zinc-100); }

.project-card-desc {
  font-size: var(--font-size-2);
  margin: 0;
}

.project-card-tags a { color: var(--zinc-500); }
.project-card-tags .hash { color: var(--amber-800); }

@media (min-width: 768px) {
  .project-card-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 450px;
    height: 320px;
    z-index: -1;
  }
  .project-card-body { max-width: 450px; }
}

/* POST SINGLE */
.post-header {
  margin-top: var(--size-fluid-4);
}

.post-header h1 {
  font-size: var(--font-size-6);
  font-weight: var(--font-weight-7);
  line-height: var(--font-lineheight-2);
}

.post-header-meta {
  padding: var(--size-2) 0;
}

.post-header-date {
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
}

.post-header-tags a { color: var(--zinc-500); }
.post-header-tags .hash { color: var(--amber-800); }

/* TOC */
.toc-title {
  font-size: var(--font-size-4);
  padding: var(--size-3) 0;
}

.toc {
  padding-bottom: var(--size-4);
}

.toc ul { list-style: none; padding-left: var(--size-4); }
.toc > ul { padding-left: 0; }

.toc li {
  position: relative;
  counter-increment: section;
}

.toc li::before {
  content: counters(section, ".") ". ";
  font-weight: bold;
}

.toc a { color: var(--zinc-400); }
.toc a:hover { color: var(--accent); }

/* PROSE (article content) */
.prose {
  color: var(--zinc-400);
  line-height: var(--font-lineheight-4);
}

.prose > h1:first-of-type { display: none; }

.prose h2 {
  color: var(--zinc-200);
  font-size: var(--font-size-4);
  font-weight: var(--font-weight-6);
  margin-top: var(--size-8);
  margin-bottom: var(--size-3);
}

.prose h3 {
  color: var(--zinc-200);
  font-size: var(--font-size-3);
  font-weight: var(--font-weight-6);
  margin-top: var(--size-6);
  margin-bottom: var(--size-3);
}

.prose h4 {
  color: var(--zinc-200);
  margin-top: var(--size-4);
  margin-bottom: var(--size-2);
}

.prose p { margin-bottom: var(--size-4); }

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s;
}

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

.prose ul, .prose ol {
  margin-bottom: var(--size-4);
  padding-left: var(--size-6);
}

.prose li { margin-bottom: var(--size-2); }

.prose code {
  font-family: ui-monospace, monospace;
  font-size: 0.875em;
  background: var(--zinc-700);
  padding: 0.1em 0.3em;
  border-radius: var(--radius-1);
}

.prose pre {
  background: var(--zinc-900);
  padding: var(--size-4);
  overflow-x: auto;
  margin-bottom: var(--size-4);
  border-radius: var(--radius-2);
}

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

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--size-4);
  margin: var(--size-4) 0;
  font-style: italic;
  color: var(--zinc-500);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--size-6) auto;
}

.prose table {
  width: 100%;
  margin: var(--size-4) 0;
  border-collapse: collapse;
}

.prose thead { border-bottom: 2px solid var(--zinc-700); }

.prose th {
  font-weight: var(--font-weight-6);
  text-align: left;
  padding: var(--size-2) var(--size-3);
  color: var(--zinc-300);
}

.prose td {
  padding: var(--size-2) var(--size-3);
  border-bottom: 1px solid var(--zinc-700);
}

.prose figure { margin: var(--size-6) 0; text-align: center; }
.prose figcaption { font-size: 0.875rem; color: var(--zinc-500); margin-top: var(--size-2); font-style: italic; }

/* COVER IMAGE */
.cover-image {
  margin: var(--size-4) 0;
}

.cover-image img {
  object-fit: cover;
  border-radius: var(--radius-2);
}

/* AUTHOR BIO */
.author-bio {
  margin-top: var(--size-6);
  padding-top: var(--size-4);
  border-top: 1px solid var(--zinc-700);
  text-align: center;
  color: var(--zinc-500);
}

.author-bio a { color: var(--accent); }
.author-bio a:hover { text-decoration: underline; }

/* FOOTER */
footer {
  margin-top: auto;
  padding: var(--size-6) 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--size-5);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: var(--size-6);
}

.footer-social a {
  color: var(--zinc-400);
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
}

.footer-social a:hover { color: var(--zinc-100); }

.footer-copy { color: var(--zinc-400); }

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--size-3);
  font-size: 0.875rem;
}

.footer-links a { color: var(--zinc-500); transition: color 0.15s; }
.footer-links a:hover { color: var(--zinc-100); }

/* SEARCH MODAL */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--size-6) var(--size-3);
}

.search-modal[aria-hidden="true"] { pointer-events: none; }

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.6);
  opacity: 1;
  transition: opacity 0.25s;
}

.search-modal[aria-hidden="true"] .search-modal-backdrop { opacity: 0; }

.search-modal-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 100px);
  background: var(--zinc-800);
  border: 1px solid var(--zinc-700);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-5);
  overflow: hidden;
  margin-top: var(--size-6);
  transform: translateY(0) scale(1);
  opacity: 1;
  transition: transform 0.25s, opacity 0.25s;
}

.search-modal[aria-hidden="true"] .search-modal-container {
  transform: translateY(-20px) scale(0.95);
  opacity: 0;
}

.search-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--size-2) var(--size-3);
  border-bottom: 1px solid var(--zinc-700);
}

.search-modal-actions {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  font-size: 0.75rem;
  color: var(--zinc-500);
}

.search-modal-clear {
  background: none;
  border: none;
  color: var(--zinc-500);
  cursor: pointer;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
}

.search-modal-clear:hover { color: var(--accent); }

.search-modal-hint {
  display: flex;
  align-items: center;
  gap: var(--size-1);
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--zinc-500);
}

.search-modal-hint kbd {
  padding: 1px 5px;
  background: var(--zinc-700);
  border: 1px solid var(--zinc-600);
  border-radius: var(--radius-1);
  font-size: 0.7rem;
}

.search-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  color: var(--zinc-500);
  cursor: pointer;
}

.search-modal-close:hover { color: var(--accent); }

/* PAGEFIND UI OVERRIDES */
.pagefind-ui {
  --pagefind-ui-scale: 0.7;
  --pagefind-ui-primary: var(--accent);
  --pagefind-ui-text: var(--zinc-400);
  --pagefind-ui-background: var(--zinc-800);
  --pagefind-ui-border: var(--zinc-700);
  --pagefind-ui-tag: var(--zinc-700);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 4px;
  --pagefind-ui-font: "Inter", system-ui, sans-serif;
}

.pagefind-ui__search-input {
  color: var(--zinc-300) !important;
  background: var(--zinc-900) !important;
}

.pagefind-ui__search-input::placeholder { color: var(--zinc-500) !important; }
.pagefind-ui__search-input:focus { outline: none !important; box-shadow: none !important; }
.pagefind-ui__search-clear { display: none !important; }
.pagefind-ui__drawer { margin-top: 0 !important; }

.pagefind-ui__results-area {
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  padding: 0;
}

.pagefind-ui__results { padding: 0 var(--size-3) var(--size-3); }

.pagefind-ui__result {
  background: var(--zinc-900) !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-2) !important;
  padding: var(--size-3) !important;
  margin: var(--size-2) 0 !important;
  transition: border-color 0.15s !important;
}

.pagefind-ui__result:hover { border-color: var(--zinc-700) !important; }

.pagefind-ui__result-link {
  color: var(--zinc-300) !important;
  text-decoration: none !important;
  font-weight: var(--font-weight-6) !important;
}

.pagefind-ui__result-link:hover { color: var(--accent) !important; }

.pagefind-ui__result-excerpt { color: var(--zinc-500) !important; }

.pagefind-ui__result-excerpt mark {
  background: none !important;
  color: var(--zinc-300) !important;
  text-decoration: underline !important;
  text-decoration-color: var(--accent) !important;
}

.pagefind-ui__message { color: var(--zinc-500) !important; padding: 2px var(--size-3) !important; }

.pagefind-ui__button {
  background: var(--accent) !important;
  color: var(--zinc-900) !important;
  border-radius: var(--radius-2) !important;
}

.pagefind-ui__result-thumb,
.pagefind-ui__result-image { display: none !important; }

/* NO CONTENT */
.no-content {
  text-align: center;
  color: var(--zinc-500);
  padding: var(--size-6) 0;
}
