/* =============================================================
   GLOBAL STYLES
   Reset, base typography, layout helpers, shared components,
   buttons, fade-up animation, footer.
   ============================================================= */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-1);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 300ms ease, color 300ms ease;
}

img, video {
  max-width: 100%;
  display: block;
}

/* ── Skip link (accessibility) ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--s2);
  z-index: 9999;
  padding: var(--s1) var(--s2);
  background: var(--accent);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  left: var(--s2);
}

/* ── Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--s4);
}

@media (max-width: 768px) {
  .container { padding: 0 var(--s3); }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--s2); }
}

/* ── Section padding ── */
section {
  padding: var(--s12) 0;
}

@media (max-width: 768px) {
  section { padding: var(--s8) 0; }
}

@media (max-width: 480px) {
  section { padding: var(--s6) 0; }
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-1);
}

p {
  color: var(--text-2);
  line-height: 1.7;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: opacity 200ms ease;
}

a:hover {
  opacity: 0.75;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 13px var(--s3);
  border-radius: var(--radius-pill);
  font-size: var(--text-base);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 200ms ease, transform 150ms ease,
              background-color 200ms ease, border-color 200ms ease,
              color 200ms ease, opacity 200ms ease;
  line-height: 1;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

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

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  opacity: 1;
}

.btn-sm {
  padding: 9px var(--s2);
  font-size: var(--text-sm);
}

/* ── Section label ── */
.label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: var(--s2);
}

/* ── Tag pill (hero badge) ── */
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px var(--s2);
  background: var(--accent-bg);
  color: var(--accent-light);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  border: 1px solid var(--accent);
}

/* ── Tag chips (on cards) ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-top: var(--s2);
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-elevated);
  color: var(--text-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  border: 1px solid var(--border);
}

/* ── Section header (centred) ── */
.section-header {
  text-align: center;
  margin-bottom: var(--s8);
}

.section-header h2 {
  font-size: var(--text-h2);
  letter-spacing: -0.02em;
  margin-bottom: var(--s2);
}

.section-header p {
  font-size: var(--text-lg);
  max-width: 540px;
  margin: 0 auto;
}

/* ── Project card ── */
.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.project-card:hover {
  transform: scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.12);
  opacity: 1;
}

.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project-card__image {
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.project-card__body {
  padding: var(--s3);
}

.project-card__title {
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: var(--s1);
}

.project-card__desc {
  font-size: var(--text-base);
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: var(--s2);
}

.project-card__link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent-light);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 200ms ease;
}

.project-card:hover .project-card__link {
  gap: 8px;
}

/* ── Projects grid (2-col) ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s4);
}

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

/* ── Fade-up animation ── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.is-visible {
  opacity: 1;
  transform: none;
}

.fade-up:nth-child(2) { transition-delay: 80ms; }
.fade-up:nth-child(3) { transition-delay: 160ms; }
.fade-up:nth-child(4) { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: var(--s4) 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2);
}

.footer__inner p {
  font-size: var(--text-sm);
  color: var(--text-3);
}

.footer__links {
  display: flex;
  gap: var(--s3);
}

.footer__links a {
  font-size: var(--text-sm);
  color: var(--text-3);
  text-decoration: none;
  transition: color 200ms ease;
}

.footer__links a:hover {
  color: var(--accent-light);
  opacity: 1;
}

.footer__links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
