/* os.css - Premium Vanilla CSS for Operating Systems section */

:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --bg-color: #F8FAFC;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: #E2E8F0;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0B0F19; /* Deep modern dark background */
    --text-main: #F1F5F9;
    --text-muted: #94A3B8;
    --card-bg: rgba(30, 41, 59, 0.6); /* Glassmorphism base */
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 0 20px rgba(79, 70, 229, 0.3);
  }
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  transition: background-color 0.4s ease, color 0.4s ease;
}

.os-section {
  padding: 6rem 0;
  margin-bottom: 6rem;
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.02) 100%);
  position: relative;
  overflow: hidden;
}

/* Subtle background glow effect for depth */
.os-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 70%;
  height: 200%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.12) 0%, transparent 60%);
  transform: rotate(-45deg);
  pointer-events: none;
  z-index: 0;
}

.os-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 640px) {
  .os-container {
    padding: 0 2rem;
  }
}

.os-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .os-layout {
    grid-template-columns: 2fr 3fr; /* Balanced proportions, less stretched than 1fr 2fr */
    gap: 4rem;
  }
}

.os-header {
  text-align: center;
}

@media (min-width: 1024px) {
  .os-header {
    text-align: left;
  }
}

.os-header h2 {
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 900;
  margin: 0 0 1.25rem 0;
  letter-spacing: -0.02em;
}

@media (min-width: 1024px) {
  .os-header h2 {
    font-size: 3rem;
  }
}

.os-header h2 .highlight {
  color: var(--primary);
  background: linear-gradient(135deg, #4F46E5, #06B6D4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.os-header p {
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.75;
  margin: 0;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 1024px) {
  .os-header p {
    margin-left: 0;
    margin-right: 0;
  }
}

.os-grid-wrapper {
  perspective: 1000px; /* Optional for potential 3D transforms */
}

.os-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

@media (min-width: 640px) {
  .os-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem; /* Increased gap for better breathing room */
  }
}

/* Theme-matched card styling */
.os-card {
  border-radius: 0.5rem; /* Sharper corners like the theme */
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1 / 1;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02); /* Very subtle shadow */
  transition: all 0.3s ease;
  cursor: pointer;
  
  /* Gradient Border Setup */
  border: 1.5px solid transparent;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(135deg, #0060fe 0%, #06b6d4 100%); /* Blue Theme Gradient */
  position: relative;
  overflow: hidden;
}

/* Card hover glow and lift */
.os-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  .os-card {
    background-image: linear-gradient(#1E293B, #1E293B), linear-gradient(135deg, #0060fe 0%, #06b6d4 100%);
    box-shadow: none;
  }
  .os-card:hover {
    box-shadow: 0 10px 30px rgba(0, 96, 254, 0.15); /* Blue glow */
  }
}

.os-card-icon {
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  position: relative;
}

/* Add a subtle glow behind icons in dark mode */
@media (prefers-color-scheme: dark) {
  .os-card-icon::before {
    content: '';
    position: absolute;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    z-index: 0;
  }
}

.os-card-icon img {
  max-width: 4.5rem;
  max-height: 4.5rem;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.08));
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy transition */
  position: relative;
  z-index: 1;
}

/* Icon micro-animation on hover */
.os-card:hover .os-card-icon img {
  transform: scale(1.15) rotate(2deg) translateY(-2px);
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.15));
}

.os-card p {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  margin: 0;
  color: var(--text-main);
  letter-spacing: 0.025em;
  transition: color 0.3s ease;
}

.os-card:hover p {
  color: var(--primary);
}
