/* ==========================================================================
   Custom Styles - Built on top of oat.ink
   ========================================================================== */

:root {
  /* Font Override */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Explicit light theme colors for high contrast */
  --background: #fafafa;
  --foreground: #09090b;
  --card: #ffffff;
  --card-foreground: #09090b;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --ring: #3b82f6;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --background: #09090b;
  --foreground: #fafafa;
  --card: #18181b;
  --card-foreground: #fafafa;
  --primary: #fafafa;
  --primary-foreground: #18181b;
  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
  --border: #27272a;
  --input: #27272a;
  --ring: #3b82f6;
}

/* Base resets & typography applied to body element handled by oat */
body {
  font-family: var(--font-sans);
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
}

/* Layout */
.site-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content {
  flex-grow: 1;
  padding: 3rem 0;
}

/* Header & Nav */
.site-header {
  padding: 2rem 0;
}

.brand-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  transition: transform 0.2s ease;
}

.brand-avatar:hover {
  transform: scale(1.05);
}

.unstyled-link {
  text-decoration: none;
  color: inherit;
}

.desktop-nav a {
  text-decoration: none;
  color: var(--muted-foreground);
  font-weight: 500;
  transition: color 0.2s ease;
  padding: 0.5rem 0;
  position: relative;
}

.desktop-nav a:hover,
.desktop-nav a.active {
  color: var(--foreground);
}

/* Active Indicator */
.desktop-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary);
  border-radius: 2px;
}

/* Mobile Nav */
.mobile-menu-toggle {
  display: none;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 1rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.mobile-nav a {
  padding: 0.75rem 0;
  text-decoration: none;
  color: var(--foreground);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.mobile-nav a:last-child {
  border-bottom: none;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background: var(--card);
  border-color: var(--border);
  z-index: 100;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block !important; }

/* Page Transitions */
.view-enter {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Helper Classes */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 2rem; }
.mt-4 { margin-top: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.p-8 { padding: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Flex Utilities (Complementing oat) */
.hstack { display: flex; align-items: center; }
.vstack { display: flex; flex-direction: column; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Typography Helpers */
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.muted { color: var(--muted-foreground); }
.border-t { border-top: 1px solid var(--border); }

/* Responsive Overrides */
@media (max-width: 768px) {
  .desktop-nav { display: none; }
  .mobile-menu-toggle { display: inline-flex; }
  .theme-toggle {
    bottom: 1rem;
    right: 1rem;
  }
}
