:root {
  --text: #425744;
  --bg: #f1e9db;
  --secondary: #7a8c7c;
  --border: #425744;
  --link: #425744;
  --link-hover: #2e3c2f;
  --accent: #2e3c2f;
  --code-bg: #f8f8f8;
  --sidebar-width: 200px;
}

[data-theme="dark"] {
  --text: #f2f2f2;
  --bg: #2e3c2f;
  --secondary: #c0c0c0;
  --border: #4a5a4b;
  --link: #f2f2f2;
  --link-hover: #ffffff;
  --accent: #c0c0c0;
  --code-bg: #1f2820;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #f2f2f2;
    --bg: #2e3c2f;
    --secondary: #c0c0c0;
    --border: #4a5a4b;
    --link: #f2f2f2;
    --link-hover: #ffffff;
    --accent: #c0c0c0;
    --code-bg: #1f2820;
  }
}

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

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap');

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 19px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* Container to center everything */
.container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  min-height: 100vh;
  padding: 0 2rem;
}

/* Left Sidebar - Tom's minimal style */
.sidebar {
  width: var(--sidebar-width);
  padding: 3rem 3rem 3rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* Headshot */
.headshot-link {
  display: block;
  border-bottom: none !important;
  margin-top: auto;
}

.headshot {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(100%);
  margin: 0;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
  border-bottom: none !important;
}

.site-title a:hover {
  color: var(--link-hover);
  border-bottom: none !important;
}

nav ul {
  list-style: none;
}

nav li {
  margin-bottom: 0.5rem;
}

nav a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.15s;
  border-bottom: none !important;
}

nav a:hover {
  color: var(--text);
  border-bottom: none !important;
}

/* Main content area */
main {
  flex: 1;
  padding: 3rem 0;
  max-width: 680px;
}

.content-wrapper {
  border-left: 2px dotted var(--border);
  padding-left: 4rem;
}

/* Homepage - clean centered layout */
.home-intro {
  max-width: 680px;
}

.home-intro p {
  margin-bottom: 1.3rem;
}

h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.page-subtitle {
  color: var(--secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.5rem 0 1.5rem;
  line-height: 1.3;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

article header h2 {
  margin-top: 0;
  font-size: 1.6rem;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s;
  border-bottom: 1px solid var(--link);
}

a:hover {
  color: var(--link-hover);
  border-bottom: 1px solid var(--link-hover);
}

p {
  margin-bottom: 1.3rem;
}

/* Post list - Tom's style with dates on right */
.post-list {
  list-style: none;
  margin: 2rem 0;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  gap: 2rem;
}

.post-title {
  font-size: 1rem;
  font-weight: normal;
  flex: 1;
}

.post-title a {
  color: var(--text);
  text-decoration: none;
  border-bottom: none !important;
}

.post-title a:hover {
  color: var(--link-hover);
  border-bottom: 1px solid var(--link-hover) !important;
}

.post-date {
  color: var(--secondary);
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Code blocks */
code {
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: "SF Mono", Monaco, "Cascadia Code", "Courier New", monospace;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
}

pre code {
  padding: 0;
  background: none;
}

/* Blockquotes */
blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--secondary);
  font-style: italic;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem 0;
}

/* Lists in content */
article ul,
article ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

article li {
  margin-bottom: 0.5rem;
}

article ul {
  list-style-type: disc;
}

article ol {
  list-style-type: decimal;
}

/* Post content */
article p {
  margin-bottom: 1.3rem;
}

article .post-date {
  display: block;
  margin-bottom: 2rem;
}

/* Mobile responsive */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
    padding: 0 1.5rem;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
  }

  .site-title {
    margin-bottom: 1rem;
  }

  nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  nav li {
    margin-bottom: 0;
  }

  main {
    padding: 2rem 0;
    max-width: 100%;
  }

  .post-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .post-date {
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 18px;
  }

  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  main {
    padding: 1.5rem 0;
  }

  .sidebar {
    padding: 1.5rem 0;
  }
}

/* Tablet landscape */
@media (min-width: 768px) and (max-width: 1100px) {
  .container {
    padding: 0 2rem;
  }

  main {
    padding-left: 3rem;
  }
}

/* Email obfuscation */
.email::after {
  content: " [at] pm [dot] me";
}

/* Project cards */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.project-card {
  display: block;
  border: none;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s;
  border-bottom: none !important;
}

.project-card:hover {
  transform: translateY(-2px);
  border-bottom: none !important;
}

.project-thumbnail {
  width: 100%;
  height: 160px;
  object-fit: cover;
  margin: 0;
}

.project-info {
  padding: 1rem;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.project-description {
  font-size: 0.9rem;
  color: var(--secondary);
  margin: 0;
  line-height: 1.5;
}

/* 404 page */
.error-page {
  text-align: center;
  padding: 4rem 0;
}

.error-page h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: var(--secondary);
}

/* Icon links (RSS, LinkedIn) */
.icon-link a {
  display: inline-flex;
  align-items: center;
  color: var(--secondary);
  border-bottom: none !important;
  transition: color 0.15s;
}

.icon-link a:hover {
  color: var(--text);
  border-bottom: none !important;
}

.icon-link svg {
  display: block;
}

/* Footer */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 0.75rem 2rem;
  font-size: 0.85rem;
  z-index: 50;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  flex: 1;
}

.footer-right {
  flex: 1;
  text-align: right;
}

.site-footer a {
  color: var(--secondary);
  border-bottom: none !important;
}

.site-footer a:hover {
  color: var(--text);
  border-bottom: none !important;
}

/* Add padding to body for fixed footer */
body {
  padding-bottom: 60px;
}

/* Print styles */
@media print {
  .sidebar {
    display: none;
  }

  .container {
    max-width: 100%;
  }

  main {
    padding-left: 0;
    max-width: 100%;
  }

  .site-footer {
    display: none;
  }
}

/* Mobile adjustments for footer */
@media (max-width: 900px) {
  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-left,
  .footer-right {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .site-footer {
    padding: 0.5rem 1rem;
  }
}
