/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Smoother font rendering */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  text-rendering: optimizeLegibility;
}

/* Theme Variables */
:root {
  --background-color: #fafafa;
  --text-color: #1e1e1e;
  --heading-color: #1b1f3b;
  --paragraph-color: #555555;
  --header-bg: #ffffffcc;
  --section-alt-bg: #f1f3f5;
  --btn-bg: #3142c7;
  --btn-hover-bg: #1b1f3b;
  --footer-bg: #1b1f3b;
  --accent-color: #5865f2;
  --card-bg: #ffffff;
  --card-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  --radius: 16px;
  --transition: all 0.3s ease;

  /* Card Pattern */
  --card-pattern: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'>\
<g fill='none' stroke='rgba(88,101,242,0.08)' stroke-width='2'>\
<circle cx='100' cy='100' r='60' />\
<rect x='220' y='80' width='80' height='80' rx='10' />\
<path d='M50 300 C150 250, 250 350, 350 300' stroke='rgba(27,31,59,0.05)' />\
</g>\
<g fill='rgba(88,101,242,0.05)'>\
<circle cx='300' cy='300' r='40' />\
<rect x='40' y='240' width='60' height='60' rx='8' />\
</g>\
</svg>");
}

[data-theme="dark"] {
  --background-color: #1b1f3b;
  --text-color: #f0f0f0;
  --heading-color: #ffffff;
  --paragraph-color: #dddddd;
  --header-bg: rgba(44, 47, 66, 0.8);
  --section-alt-bg: #2b2d42;
  --btn-bg: #5865f2;
  --btn-hover-bg: #7c8aff;
  --footer-bg: #121830;
  --card-bg: #2b2d42;
  --card-shadow: 0 4px 14px rgba(88, 101, 242, 0.1);

  /* Disable pattern in dark mode for better readability */
  --card-pattern: none;
}

/* Global Link/Button Transition */
a, button {
  transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

/* Body */
body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: var(--transition);
}

/* Background image for light mode */
[data-theme="light"] body {
  background: url('assets/Background.png') no-repeat center center fixed;
  background-size: cover;
}

/* Main Containers */
main, footer {
  background-color: var(--background-color);
  border-radius: var(--radius);
  max-width: 1200px;
  margin: 2rem auto;
  padding: 3rem 4rem;
  box-shadow: var(--card-shadow);
}

/* Header */
header {
  background-color: var(--header-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 10000;
  padding: 1.5rem 3rem;
  backdrop-filter: blur(12px);
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
}

.navbar a.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  position: relative;
}

.navbar a.nav-link:hover,
.navbar a.nav-link.active {
  color: var(--accent-color);
}

.navbar a.nav-link::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  left: 50%;
  bottom: -4px;
  background-color: var(--accent-color);
  transition: width 0.3s ease, left 0.3s ease;
}

.navbar a.nav-link:hover::after,
.navbar a.nav-link.active::after {
  width: 100%;
  left: 0;
}

/* Logo */
.logo-link {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.logo-img:hover {
  transform: scale(1.08);
}

/* Sections */
.section {
  padding: 6rem 2rem;
}

.section.alt {
  background-color: var(--section-alt-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

/* Containers */
.container {
  max-width: 1000px;
  margin: 0 auto;
}

/* Headings */
h1, h2, h3 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--heading-color);
  font-family: 'Merriweather', serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.3s;
}

h1 {
  font-size: clamp(2.5rem, 2.8rem + 0.5vw, 3.5rem);
}

h2 {
  font-size: clamp(2rem, 2.3rem + 0.3vw, 2.8rem);
  margin-top: 2rem;
}

/* Paragraphs and Lists */
p, ul, li {
  font-size: clamp(1rem, 1.15rem + 0.2vw, 1.3rem);
  color: var(--paragraph-color);
  line-height: 1.8;
}

p {
  margin-bottom: 1.8rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

ul {
  list-style: disc inside;
  max-width: 720px;
  margin: 0 auto 2rem;
}

ul li {
  margin-bottom: 1.1rem;
}

/* Founder Section */
.founder-section {
  text-align: center;
  max-width: 600px;
  margin: 3rem auto;
}

.founder-photo {
  max-width: 320px;
  border-radius: var(--radius);
  margin: 0 auto 2rem;
  display: block;
  box-shadow: var(--card-shadow);
  border: 4px solid var(--btn-bg);
}

/* Buttons */
.btn {
  display: inline-block;
  background-color: var(--btn-bg);
  color: #fff;
  padding: 1rem 2.5rem;
  border-radius: 100px;
  margin-top: 2rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.15rem;
  box-shadow: 0 6px 15px rgba(49, 66, 199, 0.4);
  cursor: pointer;
  letter-spacing: 0.05em;
}

.btn:hover,
.btn:focus {
  background-color: var(--btn-hover-bg);
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(49, 66, 199, 0.5);
}

.container .btn {
  display: block;
  margin: 3rem auto 0 auto;
}

/* Skip to Content Link */
.skip-link {
  position: absolute;
  top: -50px;
  left: 16px;
  background-color: var(--btn-bg);
  color: #ffffff;
  padding: 0.8rem 1.6rem;
  z-index: 10000;
  border: 2px solid #ffffff;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
}

.skip-link:focus {
  top: 12px;
  opacity: 1;
  pointer-events: auto;
  background-color: var(--btn-hover-bg);
  box-shadow: 0 6px 20px rgba(49, 66, 199, 0.5);
}

/* Footer */
footer {
  padding: 4rem 2rem;
  text-align: center;
  background: var(--footer-bg);
  color: white;
  font-size: 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
  margin-top: 3rem;
}

/* Cards with background pattern */
.blog-card,
.service-card,
.contact-section .card {
  background: var(--card-bg);
  background-image: var(--card-pattern);
  background-size: 500px 500px;
  background-repeat: repeat;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.blog-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 3px solid var(--btn-bg);
}

.blog-card h3 {
  font-size: 1.5rem;
  margin: 1.2rem 1.5rem 0.8rem 1.5rem;
  color: var(--heading-color);
}

.blog-card p {
  padding: 0 1.5rem 1.8rem 1.5rem;
  flex-grow: 1;
  font-size: 1.1rem;
  color: var(--paragraph-color);
}

/* Blog Article */
.blog-article {
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
  padding: 1rem 0 3rem 0;
}

.blog-article h1 {
  text-align: left;
  color: var(--heading-color);
  margin-bottom: 1rem;
}

.article-meta {
  font-size: 0.95rem;
  color: #6a6f85;
  margin-bottom: 2rem;
  font-style: italic;
}

/* Animations */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.section,
.founder-section,
.blog-grid,
.blog-article {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.2s;
}

/* Accessibility Focus */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 4px;
  border-radius: 8px;
  box-shadow: 0 0 0 6px rgba(88, 101, 242, 0.3);
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
