/* Web1Forever — Stylesheet */

:root {
  --bg: #fafaf7;
  --bg-elevated: #ffffff;
  --bg-subtle: #f3f2ee;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --text-light: #8a8a8a;
  --primary: #2d5f3f;
  --primary-light: #3e7a52;
  --primary-dark: #1f4530;
  --accent: #c8742a;
  --accent-light: #d4884a;
  --border: #e0ddd5;
  --border-strong: #c8c4ba;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --radius-lg: 14px;
  --max-width: 760px;
  --max-width-wide: 1080px;
  --font-body: Georgia, "Times New Roman", serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.header-nav {
  display: flex;
  gap: 28px;
}

.header-nav a {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.header-nav a:hover {
  color: var(--primary);
}

/* ---- Hero ---- */

.hero {
  text-align: center;
  padding: 80px 24px 56px;
  max-width: var(--max-width-wide);
  margin: 0 auto;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  line-height: 1.1;
}

.hero-subtitle {
  font-size: clamp(17px, 2.5vw, 22px);
  color: var(--text-muted);
  margin-top: 12px;
  font-style: italic;
}

/* ---- Home sections ---- */

.home-section {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 48px 24px;
  border-top: 1px solid var(--border);
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.section-description {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 4px;
}

.archive-cta {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  transition: color 0.2s ease;
}

.archive-cta:hover {
  color: var(--accent);
}

.archive-link-section {
  text-align: center;
  padding: 56px 24px;
}

/* ---- Article grid ---- */

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.article-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.article-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-thumbnail {
  margin: -24px -24px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-subtle);
}

.card-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.badge {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
}

.badge-video {
  background: #fde68a;
  color: #92400e;
}

.badge-link {
  background: #d1fae5;
  color: #065f46;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card-preview {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 8px;
  line-height: 1.5;
}

.card-arrow {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  margin-top: 16px;
  transition: color 0.2s ease;
}

.article-card:hover .card-arrow {
  color: var(--accent);
}

/* ---- Article page ---- */

.article-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.back-link {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.2s ease;
}

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

.article-title {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 32px;
}

.article-page article > p {
  margin-bottom: 1.2em;
}

.article-page article > p:first-of-type {
  font-size: 18px;
  color: var(--text);
}

/* ---- Featured image ---- */

.featured-image {
  margin: 0 0 32px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  aspect-ratio: 16 / 9;
  background: var(--bg-subtle);
}

.featured-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- YouTube embed ---- */

.youtube-embed {
  margin: 0 0 32px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.youtube-embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

/* ---- Related URL ---- */

.related-url {
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  margin-bottom: 32px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.related-url p {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
}

.related-url a {
  color: var(--accent);
  word-break: break-all;
}

/* ---- Sign-off ---- */

.signoff {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.signoff-name {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 12px;
}

.signoff-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-block {
  margin-top: 20px;
}

.social-block:first-of-type {
  margin-top: 0;
}

.social-block-heading {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.social-link {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.social-link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---- Archive page ---- */

.archive-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.archive-header {
  margin-bottom: 40px;
}

.archive-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.archive-subtitle {
  color: var(--text-muted);
  font-size: 17px;
  margin-top: 8px;
}

.archive-section h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}

.archive-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.archive-list li a {
  display: block;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.archive-list li a:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateX(4px);
}

/* ---- Footer ---- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}

.site-footer p {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--text-light);
}

/* ---- Empty state ---- */

.empty-state {
  color: var(--text-light);
  font-style: italic;
  font-size: 15px;
  padding: 24px;
  text-align: center;
}

.empty-state code {
  font-family: monospace;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
  .header-inner {
    padding: 12px 16px;
  }

  .header-nav {
    gap: 16px;
  }

  .header-nav a {
    font-size: 13px;
  }

  .hero {
    padding: 48px 16px 40px;
  }

  .home-section {
    padding: 36px 16px;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-page,
  .archive-page {
    padding: 24px 16px 60px;
  }

  .article-card {
    padding: 20px;
  }

  .card-thumbnail {
    margin: -20px -20px 16px;
  }
}
