/* sanyatihy.com — minimal, architectural. */

:root {
  --bg: #f7f5f0;
  --fg: #1c1a16;
  --muted: #6b655c;
  --accent: #8a5a3b;
  --border: #e2dcd0;
  --measure: 38rem;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/SourceSerif4-Roman-VF.woff2") format("woff2-variations"),
       url("/assets/fonts/SourceSerif4-Roman-VF.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/SourceSerif4-Italic-VF.woff2") format("woff2-variations"),
       url("/assets/fonts/SourceSerif4-Italic-VF.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

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

html {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: clamp(16px, 0.95rem + 0.25vw, 19px);
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Header */
.site-header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.site-nav {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--fg);
}

/* Main */
main.container {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

/* Typography */
h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 1rem;
  font-weight: 600;
}

h1 { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem); }
h2 { font-size: 1.5rem; margin-top: 3rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p, ul, ol, blockquote, pre, figure, table { margin: 0 0 1.25rem; }

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

strong { font-weight: 600; }

blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
  color: var(--muted);
  font-style: italic;
  margin-inline: 0;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(28, 26, 22, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  background: #1c1a16;
  color: #f7f5f0;
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  border-radius: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem auto;
  width: 5rem;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
  margin-inline: auto;
}

iframe { border: 0; }

figure {
  margin-inline: 0;
}

figcaption {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* Post header */
.page-header {
  margin-bottom: 2.5rem;
}

.page-header h1 {
  margin: 0 0 0.5rem;
}

.post-meta {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.post-updated {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.25rem;
}

/* Post list */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list-item {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.post-list-item:first-child {
  border-top: 1px solid var(--border);
}

.post-list-date {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.post-list-title {
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--fg);
}

.post-list-title:hover,
.post-list-title:focus {
  color: var(--accent);
}

.post-list-empty {
  color: var(--muted);
  font-style: italic;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
}

.pagination a {
  color: var(--fg);
  text-decoration: none;
}

.pagination a:hover,
.pagination a:focus {
  color: var(--accent);
}

.pagination-current {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Footer */
.site-footer {
  margin-top: 5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

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

.site-footer a:hover,
.site-footer a:focus {
  color: var(--fg);
}

/* 404 */
.not-found {
  text-align: center;
  padding: 2rem 0;
}

.not-found-code {
  font-size: clamp(5rem, 14vw, 9rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0;
  color: var(--fg);
}

.not-found-message {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--muted);
  margin: 2rem 0 2.5rem;
}

.not-found-home {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  margin: 0;
}

/* Embeds (Spotify, YouTube, etc.) — let them breathe */
.embed {
  margin: 2rem 0;
}

.embed-16x9 {
  aspect-ratio: 16 / 9;
}

.embed-16x9 iframe {
  width: 100%;
  height: 100%;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .site-header { padding: 1.5rem 0; }
  main.container { padding-top: 2rem; padding-bottom: 3rem; }
  .site-nav { gap: 1.25rem; }
  .post-list-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 1rem 0;
  }
  .post-list-date { order: 2; }
  .site-footer { margin-top: 3rem; }
}
