/* ─────────────────────────────────────────────
   Mike A Development — Shared Stylesheet
   Minimalist, monochrome, whitespace-driven
   ───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* ── Reset & Tokens ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Light mode (default) */
:root {
  --bg:          #fafaf9;
  --bg-card:     #ffffff;
  --bg-subtle:   #f4f4f3;
  --text:        #18181b;
  --text-2:      #52525b;
  --text-3:      #a1a1aa;
  --border:      #e4e4e7;
  --border-2:    #d4d4d8;
  --accent:      #18181b;
  --accent-inv:  #ffffff;
  --nav-bg:      rgba(250,250,249,.9);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:      0 4px 12px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --radius:      6px;
  --radius-lg:   12px;
  --transition:  200ms ease;
  --font-head:   'Archivo', system-ui, sans-serif;
  --font-body:   'Space Grotesk', system-ui, sans-serif;
  --max-w:       1100px;
  --max-w-text:  680px;
}

/* Dark mode — desaturated tonal variants, never just inverted */
[data-theme="dark"] {
  --bg:          #111110;
  --bg-card:     #1c1c1b;
  --bg-subtle:   #252523;
  --text:        #f0efe9;
  --text-2:      #a09e97;
  --text-3:      #5c5a55;
  --border:      #2c2c2a;
  --border-2:    #3d3d3a;
  --accent:      #f0efe9;
  --accent-inv:  #111110;
  --nav-bg:      rgba(17,17,16,.92);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow:      0 4px 16px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.25);
}

/* Respect system preference when user hasn't made an explicit choice */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:          #111110;
    --bg-card:     #1c1c1b;
    --bg-subtle:   #252523;
    --text:        #f0efe9;
    --text-2:      #a09e97;
    --text-3:      #5c5a55;
    --border:      #2c2c2a;
    --border-2:    #3d3d3a;
    --accent:      #f0efe9;
    --accent-inv:  #111110;
    --nav-bg:      rgba(17,17,16,.92);
    --shadow-sm:   0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
    --shadow:      0 4px 16px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.25);
  }
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

img { display: block; max-width: 100%; }
a  { color: inherit; text-decoration: none; }

/* ── Typography Scale ── */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.3rem); }
h4 { font-size: 1rem; font-weight: 500; }

p  { color: var(--text-2); max-width: var(--max-w-text); }

/* ── Layout Utilities ── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section--sm { padding-block: clamp(2rem, 5vw, 3.5rem); }

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1.5rem;
}

.nav__brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}
.nav__brand:hover { opacity: .7; transition: opacity var(--transition); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav__links a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  touch-action: manipulation;
  transition: color var(--transition);
  padding-block: .25rem; /* extra vertical tap area */
}
.nav__links a:hover,
.nav__links a.active { color: var(--text); }

.nav__cta {
  font-size: .8rem;
  font-weight: 600;
  padding: .4rem 1rem;
  background: var(--accent);
  color: var(--accent-inv);
  border-radius: var(--radius);
  transition: opacity var(--transition);
  white-space: nowrap;
}
.nav__cta:hover { opacity: .8; }

/* ── Theme Toggle ── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;  /* meets 44×44 touch target */
  height: 44px;
  background: transparent;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
  color: var(--text-2);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--text-3);
  color: var(--text);
  background: var(--bg-subtle);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.theme-toggle svg { width: 16px; height: 16px; stroke: currentColor; }

/* Show correct icon based on current theme */
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }

/* Also handle system dark when no explicit theme set */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme]) .theme-toggle .icon-sun  { display: block; }
}

/* ── Hero ── */
.hero { padding-block: clamp(4rem, 10vw, 8rem); }

.hero__eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.5rem;
}

.hero__title { margin-bottom: 1.25rem; }

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-2);
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 600;
  padding: .65rem 1.4rem;
  min-height: 44px; /* touch target */
  border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
  transition: all var(--transition);
  border: 1.5px solid transparent;
  line-height: 1;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-inv);
  border-color: var(--accent);
}
.btn--primary:hover { opacity: .8; }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-2);
}
.btn--ghost:hover { border-color: var(--text); background: var(--bg-subtle); }

/* ── Skills ── */
.skills__list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.5rem;
}

.skill-tag {
  font-size: .8rem;
  font-weight: 500;
  padding: .3rem .75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
}

/* ── Section Headers ── */
.section-header { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: .75rem;
}
.section-header h2 { margin-bottom: .6rem; }
.section-header p { color: var(--text-2); }

/* ── Project Cards ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
  color: inherit;
}
.project-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-2);
  transform: translateY(-2px);
}

.project-card__icon {
  width: 44px;
  height: 44px;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.project-card__icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-2);
}

/* Image icon variant: no background, let the image fill the container */
.project-card__icon--img {
  background: none;
  border: none;
}
.project-card__icon--img img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.project-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.project-card__badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 999px;
  letter-spacing: .04em;
}
.badge--live  { background: #dcfce7; color: #166534; }
.badge--wip   { background: #fef9c3; color: #854d0e; }
.badge--concept { background: var(--bg-subtle); color: var(--text-3); }

.project-card__name {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: .25rem;
  color: var(--text);
}

.project-card__desc {
  font-size: .875rem;
  color: var(--text-2);
  line-height: 1.55;
  flex: 1;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.project-card__tag {
  font-size: .7rem;
  font-weight: 500;
  padding: .2rem .55rem;
  background: var(--bg-subtle);
  border-radius: 999px;
  color: var(--text-3);
  border: 1px solid var(--border);
}

.project-card__arrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  color: var(--text-3);
  font-size: .8rem;
  font-weight: 500;
  transition: color var(--transition);
}
.project-card:hover .project-card__arrow { color: var(--text); }

.project-card__arrow svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  transition: transform var(--transition);
}
.project-card:hover .project-card__arrow svg { transform: translateX(3px); }

/* ── About Section ── */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}
.stat-card__number {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: .25rem;
}
.stat-card__label {
  font-size: .8rem;
  color: var(--text-3);
  font-weight: 500;
}

.about__text p + p { margin-top: 1rem; }

.experience-list { margin-top: 1.5rem; }
.experience-item {
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.experience-item:last-child { border-bottom: none; }
.experience-item__role {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
}
.experience-item__company {
  font-size: .85rem;
  color: var(--text-2);
}
.experience-item__period {
  font-size: .75rem;
  color: var(--text-3);
  margin-top: .2rem;
}

/* ── Contact Section ── */
.contact-box {
  background: var(--accent);
  color: var(--accent-inv);
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 6vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.contact-box h2 { color: var(--accent-inv); margin-bottom: .5rem; }
.contact-box p  { color: var(--accent-inv); opacity: .65; max-width: 420px; }

.btn--inv {
  background: var(--accent-inv);
  color: var(--accent);
  border-color: var(--accent-inv);
}
.btn--inv:hover { opacity: .9; }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer__brand {
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
}
.footer__copy {
  font-size: .8rem;
  color: var(--text-3);
}
.footer__links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}
.footer__links a {
  font-size: .8rem;
  color: var(--text-3);
  transition: color var(--transition);
}
.footer__links a:hover { color: var(--text); }

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
}

/* ── Product Page Specific ── */
.product-hero {
  padding-block: clamp(4rem, 10vw, 7rem);
  border-bottom: 1px solid var(--border);
}

.product-hero__app-icon {
  width: 72px;
  height: 72px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.product-hero__app-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--text-2);
}

/* Image icon variant */
.product-hero__app-icon--img {
  background: none;
  border: none;
}
.product-hero__app-icon--img img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 20px;
  display: block;
}

.product-hero__title { margin-bottom: .75rem; }
.product-hero__tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-2);
  margin-bottom: 2rem;
  max-width: 520px;
}

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}
.product-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 600;
  padding: .3rem .75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
}
.product-badge svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* ── Feature Grid ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.feature-card__icon {
  width: 40px;
  height: 40px;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.feature-card__icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-2);
}

.feature-card h3 { font-size: 1rem; margin-bottom: .4rem; }
.feature-card p  { font-size: .875rem; max-width: none; }

/* ── Tech Section ── */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

/* ── Privacy Policy ── */
.prose {
  max-width: var(--max-w-text);
}
.prose h1 { margin-bottom: 1rem; }
.prose h2 { font-size: 1.2rem; margin-top: 2.5rem; margin-bottom: .75rem; color: var(--text); }
.prose p  { margin-bottom: 1rem; font-size: .9375rem; max-width: none; }
.prose ul { margin-bottom: 1rem; padding-left: 1.5rem; }
.prose li { font-size: .9375rem; color: var(--text-2); margin-bottom: .4rem; }
.prose .meta { font-size: .8rem; color: var(--text-3); margin-bottom: 2.5rem; }

/* ── Back Link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-3);
  transition: color var(--transition);
  margin-bottom: 2rem;
  min-height: 44px; /* touch target */
  touch-action: manipulation;
}
.back-link:hover { color: var(--text); }
.back-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* ── Responsive ── */

/* Prevent horizontal overflow on all screens */
body { overflow-x: hidden; }

@media (max-width: 768px) {
  /* Navigation */
  .nav__links   { display: none; }
  .nav__cta     { display: none; } /* removes the "Get in touch" CTA on mobile to prevent nav overflow */

  /* Nav brand: truncate if viewport is very narrow */
  .nav__brand {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
  }

  /* Layout */
  .about__grid  { grid-template-columns: 1fr; }
  .about__stats { grid-template-columns: 1fr 1fr; }

  /* Sections: tighten vertical padding on mobile */
  .section    { padding-block: clamp(2.5rem, 6vw, 3.5rem); }
  .section--sm { padding-block: 1.5rem; }

  /* Hero */
  .hero { padding-block: clamp(2.5rem, 8vw, 4rem); }
  .hero__actions { flex-direction: column; align-items: flex-start; }

  /* Contact box */
  .contact-box { flex-direction: column; align-items: flex-start; }

  /* Product hero */
  .product-hero { padding-block: clamp(2.5rem, 7vw, 4rem); }

  /* Footer: stack on mobile */
  .footer__inner { flex-direction: column; gap: .75rem; }
}

@media (max-width: 480px) {
  .about__stats { grid-template-columns: 1fr; }

  /* Ensure skill tags and badges don't overflow */
  .skills__list,
  .product-badges,
  .tech-stack,
  .project-card__tags { gap: .35rem; }

  /* Slightly reduce prose font size on very small screens */
  .prose h1 { font-size: 1.75rem; }

  /* Allow email/long-text buttons inside the contact box to wrap
     rather than bursting out of the container */
  .contact-box .btn {
    white-space: normal;
    word-break: break-all;
    justify-content: flex-start;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ── Fade-in on scroll ── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .4s ease, transform .4s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}
