/* Base Styles */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2933;
  background: #f5f7fa;
}

/* Light/dark considerate: soft contrast, no harsh white/black */

body.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease;
}

body.fade-in.loaded {
  opacity: 1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  color: #111827;
  margin-top: 0;
}

p {
  line-height: 1.6;
}

ul, ol {
  padding-left: 1.4rem;
}

/* Layout */

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container.narrow {
  max-width: 720px;
}

/* Header & Navigation */

.site-header {
  background: #111827;
  color: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.brand-tagline {
  font-size: 0.75rem;
  color: #d1d5db;
}

/* Nav */

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: #e5e7eb;
  font-size: 0.9rem;
}

.site-nav a.active {
  font-weight: 600;
  border-bottom: 2px solid #2563eb;
}

/* Mobile nav toggle */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #e5e7eb;
  margin: 3px 0;
}

/* Sections */

.section {
  padding: 3rem 0;
}

.section-alt {
  padding: 3rem 0;
  background: #e5e7eb33;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

/* Hero */

.hero {
  padding: 3.5rem 0 2.5rem;
  background: radial-gradient(circle at top left, #2563eb20, transparent),
              radial-gradient(circle at bottom right, #10b98120, transparent);
}

.hero-inner {
  display: flex;
  flex-direction: column;
}

.hero-text h1 {
  font-size: 2.1rem;
  margin-bottom: 0.25rem;
}

.hero-text h2 {
  font-size: 1.1rem;
  font-weight: 500;
  color: #4b5563;
  margin-top: 0;
}

.hero-text p {
  margin-top: 1rem;
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-links {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.btn.primary {
  background: #2563eb;
  color: #f9fafb;
}

.btn.primary:hover {
  background: #1d4ed8;
}

.btn.secondary {
  background: #f3f4f6;
  color: #111827;
  border-color: #d1d5db;
}

.btn.secondary:hover {
  background: #e5e7eb;
}

/* Cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #f9fafb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.card h4 {
  margin-bottom: 0.5rem;
}

.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

/* Monospace helper */

.monospace {
  font-family: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Footer */

.site-footer {
  border-top: 1px solid #e5e7eb;
  padding: 1.5rem 0;
  background: #f9fafb;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
}

/* Page-Specific Styles */

.lead-text {
  font-size: 1.2rem;
  line-height: 1.7;
  color: #4b5563;
  margin-top: 1rem;
}

.bg-light {
  background: #f9fafb;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.75rem;
}

.section-intro {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2rem;
  color: #4b5563;
  font-size: 1.05rem;
}

/* Technical Page */

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.tech-column h2 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.tech-column p {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.skill-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.skill-list li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.skill-list li:last-child {
  border-bottom: none;
}

.skill-detail {
  display: block;
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: normal;
  margin-top: 0.25rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card-grid .card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.text-small {
  font-size: 0.9rem;
  color: #6b7280;
}

.bullet-list {
  padding-left: 1.5rem;
}

.bullet-list li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.feature-list {
  list-style: none;
  padding-left: 0;
}

.feature-list li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.feature-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #2563eb;
  font-weight: bold;
}

/* Projects Page */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

.project-card:hover {
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.1);
}

.project-content h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
}

.project-status {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.status-live {
  color: #059669;
  font-weight: 600;
}

.status-dev {
  color: #d97706;
  font-weight: 600;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.project-tags span {
  background: #e5e7eb;
  color: #4b5563;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.project-links {
  margin-top: 1rem;
}

.project-links a {
  color: #2563eb;
  font-weight: 500;
  font-size: 0.95rem;
}

/* Journal Styles */

.journal-intro {
  font-size: 1.1rem;
  color: #4b5563;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.journal-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.journal-item {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 2rem;
}

.journal-item:last-child {
  border-bottom: none;
}

.journal-item-title {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.journal-item-title a {
  color: #111827;
  text-decoration: none;
}

.journal-item-title a:hover {
  color: #2563eb;
  text-decoration: none;
}

.journal-item-meta {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.journal-item-summary {
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

/* Journal Entry Page */

.journal-entry {
  margin-top: 1.5rem;
}

.entry-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.entry-header h1 {
  margin-bottom: 0.75rem;
  font-size: 2rem;
  line-height: 1.3;
}

.entry-meta {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.entry-tags li {
  background: #e5e7eb;
  color: #4b5563;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.entry-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #1f2933;
}

.entry-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: #111827;
}

.entry-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.entry-content p {
  margin-bottom: 1.25rem;
}

.entry-content ul,
.entry-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.75rem;
}

.entry-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.entry-content blockquote {
  border-left: 4px solid #2563eb;
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: #4b5563;
  font-style: italic;
}

.entry-content blockquote.highlight {
  background: #f0f9ff;
  padding: 1.25rem 1.5rem;
  border-radius: 0.5rem;
  font-style: normal;
  color: #1f2933;
}

.entry-content blockquote.highlight p {
  margin-bottom: 0.75rem;
}

.entry-content blockquote.highlight p:last-child {
  margin-bottom: 0;
}

.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: #2563eb;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Responsive */

@media (max-width: 768px) {
  .header-inner {
    align-items: center;
  }

  .site-nav {
    position: absolute;
    top: 56px;
    right: 0;
    background: #111827;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .site-nav.open {
    max-height: 260px;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 1rem 1rem;
  }

  .nav-toggle {
    display: block;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 3rem;
  }
}
