/* =============================================
   CodeHive — Variant A Stylesheet
   ============================================= */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== THEME VARIABLES ===== */

/* Dark mode (default) */
:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-dim: rgba(245, 158, 11, 0.15);
  --accent-gradient: linear-gradient(135deg, #f59e0b, #f97316);
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --text-dim: #525252;
  --border: #262626;
  --nav-bg: rgba(10, 10, 10, 0.85);
  --logo-filter: none;
}

/* Light mode — explicit toggle */
[data-theme="light"] {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5f5;
  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-dim: rgba(217, 119, 6, 0.1);
  --accent-gradient: linear-gradient(135deg, #d97706, #ea580c);
  --text: #171717;
  --text-muted: #525252;
  --text-dim: #a3a3a3;
  --border: #e5e7eb;
  --nav-bg: rgba(250, 250, 250, 0.85);
  --logo-filter: brightness(0) saturate(100%);
}

/* Light mode — system preference (no explicit choice) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fafafa;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f5f5;
    --accent: #d97706;
    --accent-hover: #b45309;
    --accent-dim: rgba(217, 119, 6, 0.1);
    --accent-gradient: linear-gradient(135deg, #d97706, #ea580c);
    --text: #171717;
    --text-muted: #525252;
    --text-dim: #a3a3a3;
    --border: #e5e7eb;
    --nav-bg: rgba(250, 250, 250, 0.85);
    --logo-filter: brightness(0) saturate(100%);
  }
}

/* ===== BASE ===== */

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

/* ===== SHARED PATTERNS ===== */

/* Card surface — reused by stat, service, tech, contact, social, toggle */
.card,
.stat-card,
.service-card,
.tech-tag,
.contact-block,
.social-link,
.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.25s;
}

.stat-card:hover,
.service-card:hover,
.tech-tag:hover,
.social-link:hover,
.theme-toggle:hover {
  border-color: var(--accent);
}

/* Uppercase label style — reused by section-label and hero label */
.label-uppercase,
.section-label,
.hero .label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Centered container — reused by section, divider, footer */
section,
.divider,
footer {
  max-width: 900px;
  margin: 0 auto;
}

/* ===== NAV ===== */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

nav .logo {
  height: 32px;
  opacity: 0.9;
  filter: var(--logo-filter);
  transition: filter 0.3s;
}

nav .nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav .nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav .nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

nav .nav-links a:hover { color: var(--accent); }

/* ===== THEME TOGGLE ===== */

.theme-toggle {
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}

.theme-toggle:hover { color: var(--accent); }

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Three-state icon display: dark/light/auto */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-auto { display: none; }

/* Dark mode - show moon */
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Light mode - show sun */
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

/* Auto mode (no data-theme attribute) - show auto icon */
:root:not([data-theme]) .theme-toggle .icon-auto { display: block; }

/* ===== HERO ===== */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 2rem 4rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero .label {
  display: inline-block;
  background: var(--accent-dim);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  width: fit-content;
  transition: background 0.3s, color 0.3s;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero h1 .highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero .cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== BUTTONS ===== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--text-muted);
  background: var(--bg-card);
}

/* ===== SECTIONS ===== */

section { padding: 6rem 2rem; }

.section-label { margin-bottom: 0.75rem; }

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 3rem;
  line-height: 1.7;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  transition: border-color 0.3s;
}

/* ===== STATS ===== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  border-radius: 12px;
  padding: 1.75rem;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ===== ABOUT ===== */

.about-text {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1.05rem;
  max-width: 680px;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

/* ===== SERVICES ===== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.service-card {
  border-radius: 12px;
  padding: 2rem;
}

.service-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.service-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.service-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== TECH STACK ===== */

.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tech-tag {
  padding: 0.6rem 1.25rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.tech-tag:hover { color: var(--accent); }

/* ===== WORK / APP CARDS ===== */

.app-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s;
}

.app-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.app-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  flex-shrink: 0;
}

.app-card-icon--contain {
  object-fit: contain;
  background: var(--bg-card-hover);
  padding: 10px;
}

.app-card-info {
  flex: 1;
  min-width: 0;
}

.app-card-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.app-card-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
}

.app-card-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.app-card-arrow {
  width: 20px;
  height: 20px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color 0.25s;
}

.app-card:hover .app-card-arrow {
  color: var(--accent);
}

@media (max-width: 640px) {
  .app-card { gap: 1rem; padding: 1.25rem; }
  .app-card-icon { width: 52px; height: 52px; border-radius: 12px; }
  .app-card-arrow { display: none; }
}

/* ===== CONTACT ===== */

.contact-block {
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
}

.contact-block h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.contact-block p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.social-link:hover { color: var(--accent); }

.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ===== FOOTER ===== */

footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  transition: border-color 0.3s, color 0.3s;
}

/* ===== ANIMATIONS ===== */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 768px) {
  .section-title { font-size: 1.6rem; }
  .contact-block h2 { font-size: 1.6rem; }
  .services-grid { grid-template-columns: 1fr 1fr; }
}

/* Mobile */
@media (max-width: 640px) {
  nav { padding: 1rem 1.25rem; }
  nav .nav-right { gap: 1rem; }
  nav .nav-links { gap: 1rem; }
  nav .nav-links a { font-size: 0.8rem; }
  nav .nav-links li { display: none; }
  nav .nav-links li:last-child { display: list-item; }

  .hero { padding: 7rem 1.25rem 3rem; min-height: auto; }
  .hero p { font-size: 1.05rem; }

  section { padding: 3.5rem 1.25rem; }
  .section-title { font-size: 1.5rem; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .stat-number { font-size: 2rem; }
  .stat-card { padding: 1.25rem; }

  .services-grid { grid-template-columns: 1fr; }
  .service-card { padding: 1.5rem; }

  .contact-block { padding: 2rem 1.25rem; }
  .contact-block h2 { font-size: 1.4rem; }
}

/* Very small screens */
@media (max-width: 380px) {
  nav .nav-links a { font-size: 0.75rem; }
  .hero { padding: 6rem 1rem 2.5rem; }
  section { padding: 3rem 1rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .hero .cta-row { flex-direction: column; }
  .hero .cta-row .btn { text-align: center; justify-content: center; }
}
