/* =========================================================
   Atypical Tech — Design Tokens (HSL) + base utilities
   Spec: LAYOUT_GUIDE.md
   ========================================================= */

:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.5rem;
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --primary: 210 40% 98%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 212.7 26.8% 83.9%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* Container */
.container-x {
  width: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
  max-width: 1400px;
}
@media (min-width: 768px) { .container-x { padding-inline: 2rem; } }

/* Section */
.section { padding-block: 4rem; }
@media (min-width: 768px) { .section { padding-block: 6rem; } }
.section-muted { background: hsl(var(--muted) / 0.3); }
.section-title {
  font-size: 1.875rem; line-height: 1.2; font-weight: 700;
  text-align: center; margin: 0 0 3rem;
}
@media (min-width: 768px) { .section-title { font-size: 2.25rem; } }
.section-subtitle { color: hsl(var(--muted-foreground)); text-align: center; max-width: 42rem; margin: -2rem auto 3rem; }

/* Grid helpers */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.5rem 1rem; height: 2.25rem;
  border-radius: var(--radius); font-weight: 500; font-size: 0.875rem;
  transition: all 200ms;
  border: 1px solid transparent;
}
.btn:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { background: hsl(var(--primary) / 0.9); }
.btn-outline { background: transparent; border-color: hsl(var(--border)); color: hsl(var(--foreground)); }
.btn-outline:hover { background: hsl(var(--accent)); }
.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--accent)); }
.btn-lg { height: 3rem; padding: 0 2rem; font-size: 1.125rem; }
.btn-sm { height: 2rem; padding: 0 0.75rem; font-size: 0.8125rem; }
.btn-icon { width: 2.25rem; padding: 0; }
.btn-block { width: 100%; }

/* Cards */
.card-x {
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
}
.card-body { padding: 1.5rem; }
.card-hover { transition: all 300ms; }
.card-hover:hover {
  border-color: hsl(var(--primary) / 0.5);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  transform: translateY(-4px);
}

/* Inputs */
.input, .textarea, .select-x {
  display: block; width: 100%;
  background: transparent; color: hsl(var(--foreground));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem; font-size: 0.875rem;
  transition: border-color 150ms, box-shadow 150ms;
}
.input:focus, .textarea:focus, .select-x:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}
.textarea { min-height: 6rem; resize: vertical; }
.label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.125rem 0.625rem; border-radius: 9999px;
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  font-size: 0.75rem; font-weight: 500;
}

/* ============= Header ============= */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: hsl(var(--background) / 0.95);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--border));
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
@media (min-width: 768px) { .header-inner { height: 5rem; } }
.header-logo { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; color: hsl(var(--foreground)); display: inline-flex; align-items: center; }
.header-logo img { height: 40px; width: auto; display: block; }
.header-nav { display: none; gap: 0.25rem; align-items: center; }
@media (min-width: 1024px) { .header-nav { display: flex; } }
.header-nav button { color: hsl(var(--muted-foreground)); padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.875rem; }
.header-nav button:hover { color: hsl(var(--foreground)); background: hsl(var(--accent)); }
.header-right { display: none; align-items: center; gap: 0.75rem; }
@media (min-width: 768px) { .header-right { display: flex; } }
.lang-flags { display: flex; gap: 0.25rem; }
.lang-flags button { font-size: 1.25rem; opacity: 0.5; padding: 0.125rem 0.375rem; transition: opacity 150ms; }
.lang-flags button.active { opacity: 1; }
.theme-toggle { padding: 0.375rem; border-radius: var(--radius); color: hsl(var(--muted-foreground)); }
.theme-toggle:hover { color: hsl(var(--foreground)); background: hsl(var(--accent)); }
.menu-btn { display: inline-flex; padding: 0.5rem; border-radius: var(--radius); }
@media (min-width: 1024px) { .menu-btn { display: none; } }

.mobile-menu {
  display: flex; flex-direction: column;
  border-top: 1px solid hsl(var(--border));
  padding: 0.5rem 0;
}
.mobile-menu button { padding: 0.75rem 1rem; text-align: left; color: hsl(var(--foreground)); }
.mobile-menu button:hover { background: hsl(var(--accent)); }
.mobile-menu .lang-row { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid hsl(var(--border)); }

/* ============= Hero ============= */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; padding-top: 4rem; padding-bottom: 4rem;
  background-image: url('img/hero-banner.png');
  background-size: cover; background-position: center;
}
@media (min-width: 768px) { .hero { padding-top: 5rem; } }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: hsl(var(--background) / 0.8);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.hero-content { position: relative; text-align: center; max-width: 64rem; padding: 0 1rem; }
.hero h1 {
  font-size: 2.25rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
}
@media (min-width: 768px) { .hero h1 { font-size: 3rem; } }
@media (min-width: 1024px) { .hero h1 { font-size: 3.75rem; } }
.hero p {
  font-size: 1.125rem; color: hsl(var(--muted-foreground));
  max-width: 40rem; margin: 0 auto 2rem;
}
@media (min-width: 768px) { .hero p { font-size: 1.25rem; } }

/* ============= Partners ============= */
.partners-block { margin-bottom: 3rem; }
.partners-block h3 { text-align: center; color: hsl(var(--muted-foreground)); font-size: 0.875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; margin: 0 0 1.5rem; }
.partners-single { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2rem; }
.partners-single img { width: 420px; height: auto; }
.partner-tile {
  display: flex; align-items: center; justify-content: center;
  height: 4rem; background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  font-weight: 500; font-size: 0.875rem; color: hsl(var(--muted-foreground));
  transition: border-color 200ms;
}
@media (min-width: 768px) { .partner-tile { height: 5rem; font-size: 1rem; } }
.partner-tile:hover { border-color: hsl(var(--primary) / 0.5); }

/* ============= Features ============= */
.feature-icon {
  width: 3.5rem; height: 3.5rem; border-radius: 9999px;
  background: hsl(var(--primary) / 0.1); color: hsl(var(--primary));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.feature-icon svg { width: 1.75rem; height: 1.75rem; }
.feature-card { text-align: center; }
.feature-card h3 { font-size: 1.125rem; font-weight: 600; margin: 0 0 0.5rem; }
.feature-card p { font-size: 0.875rem; color: hsl(var(--muted-foreground)); margin: 0; }

/* ============= Features (alternating layout) ============= */
.features-mold .feature-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 4rem;
}
.features-mold .feature-item:last-child { margin-bottom: 0; }
@media (min-width: 768px) {
  .features-mold .feature-item {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
  .features-mold .feature-item:nth-child(even) .feature-content { order: 2; }
  .features-mold .feature-item:nth-child(even) .feature-images  { order: 1; }
}
.features-mold .feature-content h3 {
  font-size: 1.75rem; font-weight: 700; margin: 0 0 1rem;
  color: hsl(var(--primary));
}
.features-mold .feature-content p {
  font-size: 1.05rem; line-height: 1.8;
  color: hsl(var(--muted-foreground)); margin: 0;
}
.features-mold .feature-images {
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.features-mold .feature-images img {
  width: 100%;
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  display: block;
}
.features-mold .feature-images img:not(:only-child) {
  width: calc(50% - 0.5rem);
}

/* ============= Solutions carousel ============= */
.solutions-wrap { max-width: 56rem; margin: 0 auto; position: relative; }
.solutions-track { overflow: hidden; border-radius: 0.75rem; }
.solutions-strip { display: flex; transition: transform 500ms ease-in-out; }
.solutions-slide {
  flex: 0 0 100%;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: 0.75rem; padding: 2rem; min-height: 17.5rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
@media (min-width: 768px) { .solutions-slide { padding: 3rem; } }
.solutions-slide h3 { font-size: 1.5rem; font-weight: 600; margin: 0 0 1rem; }
.solutions-slide p { color: hsl(var(--muted-foreground)); margin: 0; max-width: 36rem; }
.solutions-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2.5rem; height: 2.5rem; border-radius: 9999px;
}
.solutions-arrow.left { left: -0.5rem; }
.solutions-arrow.right { right: -0.5rem; }
@media (min-width: 1024px) {
  .solutions-arrow.left { left: -3rem; }
  .solutions-arrow.right { right: -3rem; }
}
.solutions-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; }
.solutions-dots button {
  width: 0.75rem; height: 0.75rem; border-radius: 9999px;
  background: hsl(var(--muted-foreground) / 0.3);
  transition: background 200ms;
}
.solutions-dots button.active { background: hsl(var(--primary)); }

/* ============= FAQ ============= */
.faq-card h3 { font-size: 1.125rem; font-weight: 600; margin: 0 0 0.75rem; }
.faq-card p { color: hsl(var(--muted-foreground)); margin: 0; font-size: 0.9375rem; }

/* ============= Contact ============= */
.contact-grid { display: grid; gap: 2rem; max-width: 64rem; margin: 0 auto; }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-info-row { display: flex; gap: 1rem; align-items: flex-start; }
.contact-icon {
  flex-shrink: 0;
  width: 3rem; height: 3rem; border-radius: 9999px;
  background: hsl(var(--primary) / 0.1); color: hsl(var(--primary));
  display: flex; align-items: center; justify-content: center;
}
.contact-icon svg { width: 1.5rem; height: 1.5rem; }
.contact-info-row .label-sm { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: hsl(var(--muted-foreground)); margin: 0 0 0.125rem; }
.contact-info-row .value { font-weight: 500; margin: 0; }

/* ============= Footer ============= */
.footer { background: hsl(var(--card)); border-top: 1px solid hsl(var(--border)); padding-block: 3rem; margin-top: 0; }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.footer h4 { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 0.75rem; }
.footer p, .footer a, .footer button { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.footer button { display: block; padding: 0.25rem 0; }
.footer button:hover, .footer a:hover { color: hsl(var(--foreground)); }
.footer-socials { display: flex; gap: 0.75rem; }
.footer-socials a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 9999px;
  background: hsl(var(--muted)); color: hsl(var(--muted-foreground));
  transition: all 200ms;
}
.footer-socials a:hover { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.footer-bottom {
  border-top: 1px solid hsl(var(--border)); margin-top: 2rem; padding-top: 1.5rem;
  text-align: center; font-size: 0.875rem; color: hsl(var(--muted-foreground));
}

/* ============= Page (blog/post) ============= */
.page-with-fixed-header { padding-top: 5rem; }
@media (min-width: 768px) { .page-with-fixed-header { padding-top: 6rem; } }

.blog-card { overflow: hidden; }
.blog-card .img-wrap { aspect-ratio: 16/9; overflow: hidden; background: hsl(var(--muted)); }
.blog-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms; }
.blog-card:hover .img-wrap img { transform: scale(1.05); }
.blog-card h3 {
  font-size: 1.125rem; font-weight: 600; margin: 0.75rem 0 0.5rem;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card .excerpt {
  color: hsl(var(--muted-foreground)); font-size: 0.875rem; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.search-row { display: flex; flex-wrap: wrap; gap: 0.75rem; max-width: 42rem; margin: 0 auto 2rem; }
.search-row .with-icon { position: relative; flex: 1 1 auto; min-width: 200px; }
.search-row .with-icon svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); }
.search-row .with-icon input { padding-left: 2.5rem; }
.search-row select { width: 100%; max-width: 12rem; }

/* Markdown content */
.content-html { line-height: 1.7; }
.content-html h2 { margin-top: 2rem; }
.content-html h3 { margin-top: 1.5rem; }
.content-html pre { background: hsl(var(--muted)); padding: 1rem; border-radius: var(--radius); overflow-x: auto; }
.content-html code { background: hsl(var(--muted)); padding: 0.125rem 0.375rem; border-radius: 0.25rem; font-size: 0.875em; }
.content-html pre code { background: transparent; padding: 0; }
.content-html blockquote { border-left: 3px solid hsl(var(--border)); padding-left: 1rem; color: hsl(var(--muted-foreground)); margin-inline: 0; }
.content-html a { color: hsl(var(--primary)); text-decoration: underline; }
.content-html img { border-radius: var(--radius); margin: 1.5rem 0; }

/* Toast */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 100;
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  padding: 0.75rem 1rem; box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.2);
  max-width: 24rem;
}
.toast.error { border-color: hsl(var(--destructive)); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.25rem; margin-top: 2rem; }
.pagination button {
  min-width: 2.25rem; height: 2.25rem; padding: 0 0.75rem;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  background: hsl(var(--background));
}
.pagination button.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Utils */
.text-muted-fg { color: hsl(var(--muted-foreground)); }
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden { display: none; }
.block { display: block; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.blazor-error-boundary {
  background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground));
  padding: 1rem; border-radius: var(--radius);
}
.blazor-error-boundary::after { content: "An error has occurred."; }
