/* Core theme for Jude website services */
/* Fonts loaded via preconnect in HTML for better performance */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #0b1021;
  --bg-soft: #101733;
  --card: rgba(255, 255, 255, 0.04);
  --stroke: rgba(255, 255, 255, 0.08);
  --text: #eaf0ff;
  --muted: #c5cee4;
  --accent: #5de0e6;
  --accent-2: #f7c266;
  --danger: #ff6b6b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --max-width: 1180px;
  
  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 48px;
  --space-2xl: 80px;
  
  /* Typography scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(93, 224, 230, 0.12), transparent 25%),
              radial-gradient(circle at 80% 0%, rgba(247, 194, 102, 0.14), transparent 30%),
              var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Page transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

main {
  animation: fadeIn 0.4s ease-out;
}

body.page-transition main {
  animation: fadeOut 0.2s ease-in forwards;
}

/* View Transitions API (Chrome/Edge) */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: fadeOut 0.2s ease-in;
}

::view-transition-new(root) {
  animation: fadeIn 0.3s ease-out;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: calc(var(--radius) - 6px);
}

/* Lazy loading placeholder */
img[loading="lazy"] {
  background: var(--card);
}

.container {
  width: min(95%, var(--max-width));
  margin: 0 auto;
  padding-inline: var(--space-md);
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(11, 16, 33, 0.85);
  border-bottom: 1px solid var(--stroke);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: 32px;
  width: auto;
  display: block;
}

.logo .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(93, 224, 230, 0.12);
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 0;
}

nav a {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.2s ease;
}

nav a:focus-visible,
nav a:hover {
  color: var(--text);
  background: var(--card);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1021;
  font-weight: 700;
  letter-spacing: -0.15px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 12px 26px rgba(93, 224, 230, 0.3);
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text);
  box-shadow: none;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(93, 224, 230, 0.35);
}

.hero {
  padding: 80px 0 60px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 42px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: -0.1px;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'DM Sans', sans-serif;
  letter-spacing: -0.35px;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(2.5rem, 4vw, 3.4rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

h3 {
  font-size: 1.2rem;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(93, 224, 230, 0.12), transparent 32%);
  pointer-events: none;
}

.card h3 {
  margin-top: 6px;
  margin-bottom: 10px;
}

.pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(93, 224, 230, 0.14);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.stat {
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
}

.stat strong {
  display: block;
  font-size: 1.3rem;
}

.section {
  padding: 56px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 20px;
}

.section-header p {
  max-width: 520px;
  color: var(--muted);
}

.list {
  padding: 0;
  margin: 14px 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.list li::before {
  content: '•';
  color: var(--accent-2);
  font-weight: 900;
  margin-top: 1px;
}

.highlight {
  color: var(--accent);
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  align-items: start;
}

.form-card form {
  display: grid;
  gap: 12px;
}

label {
  font-weight: 600;
}

input, textarea, select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  margin-bottom: 12px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

textarea {
  min-height: 120px;
}

.footer {
  padding: 40px 0 24px;
  border-top: 1px solid var(--stroke);
  background: #090d1d;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.footer a {
  color: var(--muted);
}

.small { font-size: 0.95rem; color: var(--muted); }

.table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

.table th, .table td {
  border: 1px solid var(--stroke);
  padding: 10px 12px;
  text-align: left;
}

.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-visual {
  background: linear-gradient(135deg, rgba(93,224,230,0.12), rgba(247,194,102,0.12)),
              linear-gradient(160deg, rgba(255,255,255,0.08), rgba(9,13,29,0.6));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.hero-visual .timeline {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.hero-visual .step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.hero-visual .step .bullet {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(93,224,230,0.18);
  border: 1px solid var(--stroke);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent);
}

.tagline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--accent);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (min-width: 900px) {
  .portfolio-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.portfolio-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: block;
  color: var(--text);
  text-decoration: none;
}

.portfolio-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  border-color: var(--accent);
  color: var(--text);
}

.portfolio-card img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.portfolio-card:hover img {
  transform: scale(1.05);
}

.portfolio-card .body {
  padding: 18px;
}

.quote-box {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  color: var(--muted);
  margin: 10px 0;
}

.tablet-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.banner {
  padding: 16px;
  border: 1px dashed var(--stroke);
  border-radius: 14px;
  background: rgba(93, 224, 230, 0.08);
}

.cookie-banner {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 92%);
  background: #0b1021;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 20;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: -999px;
  background: var(--accent);
  color: #0b1021;
  padding: 10px 12px;
  border-radius: 10px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 30;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  nav ul {
    position: fixed;
    inset: 70px 0 auto 0;
    background: #090d1d;
    padding: 18px;
    flex-direction: column;
    transform: translateY(-130%);
    transition: transform 0.25s ease;
  }
  nav ul.open {
    transform: translateY(0);
  }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: var(--card);
    color: var(--text);
  }
}

@media (min-width: 901px) {
  .menu-toggle { display: none; }
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.callout {
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(93, 224, 230, 0.18), rgba(93, 224, 230, 0.06));
  border: 1px solid var(--stroke);
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.blog-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  display: block;
  transition: transform var(--transition-base), border-color var(--transition-base);
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.blog-card .read-more {
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-top: 12px;
  display: inline-block;
}

/* Blog post styles */
.blog-post {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 48px;
}

.post-header {
  margin-bottom: 32px;
}

.post-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-3xl);
  line-height: 1.2;
  margin-top: 16px;
  margin-bottom: 12px;
}

.back-link {
  color: var(--muted);
  font-size: var(--text-sm);
  display: inline-block;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--accent);
}

.prose {
  margin-top: 48px;
  line-height: 1.8;
}

.prose h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-2xl);
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--text);
}

.prose h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xl);
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text);
}

.prose p {
  margin-bottom: 16px;
  color: var(--muted);
}

.prose .lead {
  font-size: var(--text-lg);
  color: var(--text);
  margin-bottom: 32px;
}

.prose ul, .prose ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--muted);
}

.prose li {
  margin-bottom: 8px;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 24px 0;
  font-style: italic;
  color: var(--text);
}

.prose pre {
  background: var(--bg-soft);
  border: 1px solid var(--stroke);
  border-radius: calc(var(--radius) - 6px);
  padding: 16px;
  overflow-x: auto;
  margin: 24px 0;
}

.prose code {
  font-family: 'SF Mono', Monaco, 'Consolas', monospace;
  font-size: 0.875em;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.prose a:hover {
  text-decoration-thickness: 2px;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose em {
  font-style: italic;
}

.post-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--stroke);
}

.post-footer .card {
  text-align: center;
  padding: 32px;
}

.post-footer h3 {
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 12px;
}

.post-footer p {
  color: var(--muted);
  margin-bottom: 20px;
}

.badge-positive {
  color: #1abc9c;
  background: rgba(26,188,156,0.12);
}

.accessible-hide {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Form status messages */
[role="status"].success {
  color: var(--accent);
}

[role="status"].error {
  color: var(--danger);
}

/* 404 Error Page */
.error-page {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.error-code {
  font-size: clamp(6rem, 20vw, 12rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0;
}

.error-page h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 20px 0 10px;
}

.error-page p {
  color: var(--muted);
  max-width: 400px;
  margin-bottom: 30px;
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Utility classes */
.text-center {
  text-align: center;
}
