/* hermit-regular */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Hermit';
  font-style: normal;
  font-weight: 400;
  src: url('/static/fonts/hermit-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* hermit-regular-italic */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Hermit';
  font-style: italic;
  font-weight: 400;
  src: url('/static/fonts/hermit-regular-italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* libre-caslon-condensed-regular */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Libre Caslon Condensed';
  font-style: normal;
  font-weight: 400;
  src: url('/static/fonts/libre-caslon-condensed-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* libre-caslon-condensed-italic */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Libre Caslon Condensed';
  font-style: italic;
  font-weight: 400;
  src: url('/static/fonts/libre-caslon-condensed-italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}


:root {
  --navy:       #1B3A6B;
  --teal:       #2E7D8C;
  --teal-mid:   #9BCDD6;
  --teal-light: #EFF6FA;
  --text:       #1a1a1a;
  --muted:      #555;
  --border:     #dde8ed;
  --bg:         #ffffff;
  --code-bg: #073642;
  --code-text: #EFF6FA;
  --serif:      'Libre Caslon Condensed', serif;
  --mono:       'Hermit', monospace;
  transition:   background 0.2s ease, color 0.2s ease;
}

[data-theme="dark"] {
  --navy:       #7BAFD4;
  --teal:       #4DB8CC;
  --teal-mid:   #2A5A66;
  --teal-light: #0D2A30;
  --text:       #E8E8E4;
  --muted:      #A0A09A;
  --border:     #1E3540;
  --bg:         #0F1A1F;
  --code-bg: #073642;
  --code-text: #EFF6FA;
}

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

html { font-size: 16px; }

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  padding: 0 1.5rem;
}

/* Layout */
.wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 0 5rem;
}

/* Nav */
nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--navy);
  padding-bottom: 1rem;
  margin-bottom: 3rem;
}

.nav-name {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 12px;
  color: var(--teal);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.nav-links a:hover { color: var(--navy); }
.nav-links a.active { color: var(--navy); border-bottom: 1px solid var(--navy); }

/* Dark mode toggle button */
#theme-toggle {
  background: none;
  border: 1px solid var(--teal-mid);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--teal);
  font-family: var(--mono);
}
#theme-toggle:hover { border-color: var(--teal); }

#theme-icon {
  font-size: 16px;
  vertical-align: middle;
  display: inline-block;
  width: 1em;
  text-align: center;
}

/* Section headers */
.section-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  font-weight: 500;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--teal);
}

.cursor {
  animation: blink 1.5s step-end infinite;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.5rem;
}

.post-tag {
  font-size: 10px;
  padding: 2px 8px;
  background: var(--teal-light);
  border: 1px solid var(--teal-mid);
  color: var(--teal);
  border-radius: 999px;
  letter-spacing: 0.04em;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

footer a { color: var(--teal); text-decoration: none; }
footer a:hover { color: var(--navy); }

/* Mobile */
@media (max-width: 600px) {
  .nav-name {
    word-break: break-word;
    max-width: 80px;
  }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Fade-in on load */
@keyframes fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wrapper { animation: fadein 0.35s ease both; }

/* HTMX transition */
.htmx-swapping { opacity: 0; transition: opacity 0.15s ease; }
.htmx-settling  { opacity: 1; transition: opacity 0.2s ease; }
