@font-face {
  font-family: "header";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Oswald-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 420;
  font-display: swap;
  src: url("../fonts/Inter-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 420;
  font-display: swap;
  src: url("../fonts/Inter-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Inter-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Inter-BoldItalic.woff2") format("woff2");
}

@font-face {
  font-family: "mono";
  font-weight: 420;
  font-display: swap;
  src: url("../fonts/intelone-mono-font-family-regular.otf") format("opentype");
}

:root {
  --color-logo: #8f7250;
  --color-bg: #191919;
  --color-surface-1: #222222;
  --color-surface-2: #282828;

  --color-text-primary: #a0a0a2;
  --color-text-secondary: #8e949d;
  --color-text-muted: #868b93;

  --color-accent: #957a65;
  --color-accent-hover: #a88973;

  --color-border: #2e2e2e;

  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-heading: "header", system-ui, sans-serif;
  --font-mono: "mono", monospace;

  --text-xs: 0.85rem;
  --text-sm: 1rem;
  --text-md: 1.1rem;
  --text-lg: 1.3rem;
  --text-xl: 1.6rem;
  --text-2xl: 1.9rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;

  --focus-ring: 0 0 0 2px rgba(149, 122, 101, 0.45);
}

[data-theme="light"] {
  --color-logo: #6b5a3e;
  --color-bg: #c8c3ba;
  --color-surface-1: #f5f2ed;
  --color-surface-2: #ebe7e0;

  --color-text-primary: #111010;
  --color-text-secondary: #383530;
  --color-text-muted: #555250;

  --color-accent: #6b5a3e;
  --color-accent-hover: #7e6a4a;

  --color-border: #d0ccc4;
}

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

[hidden] { display: none !important; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--color-text-muted); }

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.75;
  background: var(--color-bg);
  color: var(--color-text-primary);
}

main {
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-text-secondary);
  text-decoration: none;
  border: none;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-surface-2);
  color: var(--color-accent);
  padding: 0.15em 0.35em;
  border-radius: var(--radius-sm);
}

h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 65ch;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 65ch;
  margin: var(--space-5) auto var(--space-6) auto;
  padding: 0 var(--space-4);
}

header img,
.site-logo {
  height: 84px;
  width: auto;
  max-width: 100%;
  cursor: pointer;
  color: var(--color-logo);
}

nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  text-transform: lowercase;
}

nav a {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
}

nav a:hover,
nav a.active {
  color: var(--color-text-primary);
}

/* ── shared buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: var(--font-body);
  line-height: 1.4;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  text-decoration: none;
  vertical-align: middle;
  transition: border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn-sm { padding: 3px var(--space-3); font-size: 0.82rem; }
.btn-primary { background: var(--color-accent); color: #1a1a1a; border-color: var(--color-accent); font-weight: 600; }
.btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: #1a1a1a; }

#btn-theme { appearance: none; -webkit-appearance: none; background: none; border: none; outline: none; color: var(--color-text-muted); font-size: var(--text-md); cursor: pointer; padding: 2px 4px; line-height: 1; }
#btn-theme:hover { color: var(--color-text-primary); }

/* ── focus rings ─────────────────────────────────────────────────────────────── */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

h2,
h3,
h4,
h5,
h6,
.post-title {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--color-text-secondary);
}

h2 {
  font-size: var(--text-2xl);
  text-align: left;
  margin-bottom: var(--space-3);
}

h3 {
  font-size: var(--text-xl);
  margin-top: var(--space-7);
  margin-bottom: var(--space-4);
}

h4 {
  font-size: var(--text-lg);
  margin-top: var(--space-5);
}

.post {
  padding-bottom: var(--space-7);
}

.date {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
}

blockquote {
  margin: var(--space-4) 0;
  padding-left: var(--space-4);
  border-left: 4px solid var(--color-border);
  color: var(--color-text-secondary);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
}

th,
td {
  border: 1px solid var(--color-border);
  padding: var(--space-1) var(--space-2);
}

th {
  background: var(--color-surface-1);
}

ul,
ol {
  margin-bottom: var(--space-6);
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: 4px;
  text-decoration: none;
}

a.feed-source-name:hover {
  color: var(--color-accent);
}

.feed-source-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.btn-source-follow {
  margin-left: var(--space-2);
  flex-shrink: 0;
}

.feed-meta .date {
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

.feed-avatar {
  width: 14px;
  height: 14px;
}

.feed-content {
  margin-top: var(--space-2);
  line-height: 1.6;
}


.feed-body {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  cursor: pointer;
  margin-top: var(--space-2);
}

.feed-body:hover .post-title {
  color: var(--color-accent);
}

.feed-body-text .post-title {
  margin-top: 0;
  line-height: 1.2;
  font-size: var(--text-sm);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.feed-thumb {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.feed-body-text {
  flex: 1;
  min-width: 0;
}

.feed-blurb {
  margin: var(--space-1) 0 0;
  line-height: 1.5;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ── feed modal ──────────────────────────────────────────────────────────────── */

.feed-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.feed-modal-overlay.hidden {
  display: none;
}

.feed-modal {
  background: var(--color-surface-1);
  border-radius: 6px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.feed-modal-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.feed-modal-title {
  flex: 1;
  font-weight: 600;
  font-size: var(--text-md);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-modal-close,
.feed-modal-prev,
.feed-modal-next {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: var(--text-md);
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.feed-modal-close:hover,
.feed-modal-prev:hover,
.feed-modal-next:hover {
  color: var(--color-text-primary);
}

.feed-modal-prev:disabled,
.feed-modal-next:disabled {
  opacity: 0.2;
  cursor: default;
}

.feed-modal-body {
  padding: var(--space-4);
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  line-height: 1.7;
  font-size: var(--text-md);
}

.feed-modal-body img {
  max-width: 100%;
  height: auto;
}


.feed-modal-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feed-modal-original {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}

.feed-modal-original:hover {
  color: var(--color-accent);
}

.feed-modal-subscribe {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}

.feed-modal-subscribe:hover {
  color: var(--color-accent);
}

/* ── video embed ─────────────────────────────────────────────────────────────── */

.video-embed {
  position: relative;
  display: inline-block;
  cursor: pointer;
  max-width: 100%;
}

.video-embed img {
  display: block;
  max-width: 100%;
}

.video-embed-placeholder {
  width: 480px;
  max-width: 100%;
  aspect-ratio: 16/9;
  background: var(--color-surface-2);
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-play-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

.video-embed iframe {
  width: 480px;
  max-width: 100%;
  aspect-ratio: 16/9;
  border: none;
  display: block;
}

@media (max-width: 600px) {
  header {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  header .site-logo {
    height: 52px;
    max-width: 100%;
  }

  nav {
    flex-wrap: wrap;
    gap: var(--space-2);
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
