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

/* Custom properties */
:root {
  --navy-50: #f8fafc;
  --navy-100: #f1f5f9;
  --navy-200: #e2e8f0;
  --navy-300: #cbd5e1;
  --navy-400: #94a3b8;
  --navy-500: #64748b;
  --navy-600: #475569;
  --navy-700: #334155;
  --navy-800: #1e293b;
  --navy-900: #0f172a;
  --accent: #f97316;
  --accent-light: #fb923c;
  --indigo: #6366f1;
  --bg-deep: #0a1525;
}

/* Base styles */
body {
  color: var(--navy-50);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-deep);
  min-height: 100vh;
  position: relative;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Azulejos-inspired geometric pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-deep);
  background-image:
    /* Main gradient overlay */
    linear-gradient(160deg, rgba(12, 25, 41, 0.85) 0%, rgba(15, 23, 42, 0.8) 50%, rgba(10, 21, 37, 0.85) 100%),
    /* Azulejos tile pattern - interlocking geometric shapes */
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.15'%3E%3Cpath d='M30 0L60 30L30 60L0 30L30 0zm0 10L10 30l20 20 20-20L30 10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    /* Secondary smaller pattern for depth */
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23f97316' fill-opacity='0.08'%3E%3Ccircle cx='20' cy='20' r='3'/%3E%3Ccircle cx='0' cy='20' r='3'/%3E%3Ccircle cx='40' cy='20' r='3'/%3E%3Ccircle cx='20' cy='0' r='3'/%3E%3Ccircle cx='20' cy='40' r='3'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-size: 100% 100%, 60px 60px, 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Subtle corner accents */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse 600px 500px at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 600px 500px at 100% 100%, rgba(249, 115, 22, 0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Main content wrapper */
.wrapper {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header / Site title */
.site-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.site-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy-50);
  text-decoration: none;
  display: inline-block;
}

.site-title:hover {
  color: var(--accent);
}

/* Post list (home page) */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-item {
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 0.5rem;
  border: 1px solid rgba(99, 102, 241, 0.1);
  transition: border-color 0.2s, background-color 0.2s;
}

.post-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(30, 41, 59, 0.7);
}

.post-item-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.post-item-title a {
  color: var(--navy-50);
  text-decoration: none;
}

.post-item-title a:hover {
  color: var(--accent);
}

.post-item-meta {
  font-size: 0.875rem;
  color: var(--navy-400);
  margin-bottom: 0.75rem;
}

.post-item-description {
  color: var(--navy-300);
  font-size: 0.95rem;
}

/* Single post page */
.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.post-meta {
  color: var(--navy-400);
  font-size: 0.9rem;
}

.post-content {
  color: var(--navy-200);
}

/* Typography for markdown content */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: var(--navy-50);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.post-content h1 { font-size: 1.75rem; }
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.1rem; }

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover {
  color: var(--accent-light);
}

.post-content strong {
  color: var(--navy-50);
  font-weight: 600;
}

.post-content em {
  font-style: italic;
}

/* Lists */
.post-content ul,
.post-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content ul {
  list-style-type: disc;
}

.post-content ol {
  list-style-type: decimal;
}

.post-content li > ul,
.post-content li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Blockquotes */
.post-content blockquote {
  border-left: 3px solid var(--indigo);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--navy-300);
  font-style: italic;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Code */
.post-content code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
  font-size: 0.875em;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  color: var(--accent-light);
}

.post-content pre {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--navy-200);
}

/* Horizontal rule */
.post-content hr {
  border: none;
  border-top: 1px solid rgba(99, 102, 241, 0.2);
  margin: 2rem 0;
}

/* Images */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.post-content th,
.post-content td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.post-content th {
  color: var(--navy-50);
  font-weight: 600;
  background: rgba(15, 23, 42, 0.5);
}

.post-content tr:hover {
  background: rgba(30, 41, 59, 0.3);
}

/* Back link */
.back-link {
  display: inline-block;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--navy-400);
  text-decoration: none;
  font-size: 0.9rem;
}

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

/* Mobile adjustments */
@media (max-width: 640px) {
  .wrapper {
    padding: 1.5rem 1rem;
  }

  .post-title {
    font-size: 1.5rem;
  }

  .site-title {
    font-size: 1.5rem;
  }
}
