/* ============================================
   Express Data Management -- Editorial Brutalist
   ============================================ */

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

:root {
  --bg: #f5f0eb;
  --text: #1a1a1a;
  --accent: #e63946;
  --secondary-bg: #1a1a1a;
  --secondary-text: #f5f0eb;
  --muted: #8a8a8a;
  --rule: #1a1a1a;
  --card-bg: #ece7e1;
  --card-dark-bg: #1a1a1a;
  --card-dark-text: #f5f0eb;
  --topbar-bg: #f5f0eb;
  --topbar-border: #1a1a1a;
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --text: #e8e3de;
  --secondary-bg: #1a1a1a;
  --secondary-text: #e8e3de;
  --muted: #8a8a8a;
  --rule: #e8e3de;
  --card-bg: #1a1a1a;
  --card-dark-bg: #000000;
  --card-dark-text: #e8e3de;
  --topbar-bg: #0f0f0f;
  --topbar-border: #333;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Archivo', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Reveal Animation --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children in the stack grid */
.stack__item[data-reveal]:nth-child(2) { transition-delay: 0.05s; }
.stack__item[data-reveal]:nth-child(3) { transition-delay: 0.1s; }
.stack__item[data-reveal]:nth-child(4) { transition-delay: 0.15s; }
.stack__item[data-reveal]:nth-child(5) { transition-delay: 0.2s; }
.stack__item[data-reveal]:nth-child(6) { transition-delay: 0.25s; }
.stack__item[data-reveal]:nth-child(7) { transition-delay: 0.3s; }
.stack__item[data-reveal]:nth-child(8) { transition-delay: 0.35s; }

/* --- Horizontal Rule --- */
.rule {
  border: none;
  border-top: 2px solid var(--rule);
  margin: 0 0 2rem 0;
}

.rule--light {
  border-top-color: var(--secondary-text);
}

/* --- Sticky Top Bar --- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background-color: var(--topbar-bg);
  border-bottom: 2px solid var(--topbar-border);
  backdrop-filter: blur(8px);
}

.topbar__name {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topbar__link {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  border: 2px solid var(--text);
  padding: 0.4rem 1rem;
  transition: background-color 0.2s, color 0.2s;
}

.topbar__link:hover {
  background-color: var(--text);
  color: var(--bg);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 2px solid var(--text);
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.2s;
}

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

.theme-toggle__icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--text);
  transition: background-color 0.2s, box-shadow 0.2s;
}

.theme-toggle:hover .theme-toggle__icon {
  background-color: var(--bg);
}

[data-theme="dark"] .theme-toggle__icon {
  background-color: transparent;
  box-shadow: inset -4px -2px 0 0 var(--text);
}

[data-theme="dark"] .theme-toggle:hover .theme-toggle__icon {
  box-shadow: inset -4px -2px 0 0 var(--bg);
}


/* ========================
   HERO
   ======================== */
.hero {
  padding: 10rem 2rem 6rem;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
}

.hero__inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.hero__label {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 2rem;
}

.hero__title {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}

.hero__divider {
  width: 80px;
  height: 4px;
  background-color: var(--accent);
  margin-bottom: 2rem;
}

.hero__tagline {
  font-family: 'Archivo', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 500;
  max-width: 500px;
  margin-bottom: 2rem;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.hero__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--accent);
}


/* ========================
   ABOUT
   ======================== */
.about {
  padding: 6rem 2rem;
}

.about__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.about__label,
.projects__label,
.stack__label,
.contact__label {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

.about__heading {
  font-family: 'Space Mono', monospace;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
}

.about__text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.about__text:last-child {
  margin-bottom: 0;
}


/* ========================
   PROJECTS
   ======================== */
.projects {
  padding: 6rem 2rem;
}

.projects__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

/* --- Project Card --- */
.project {
  background-color: var(--card-bg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 2px solid transparent;
  transition: border-color 0.25s, transform 0.25s;
  position: relative;
}

.project:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* Size variations for asymmetry */
.project--large {
  grid-column: span 2;
  grid-row: span 2;
  padding: 3rem;
}

.project--wide {
  grid-column: span 2;
}

.project--dark {
  background-color: var(--card-dark-bg);
  color: var(--card-dark-text);
}

[data-theme="dark"] .project--dark {
  background-color: #000;
}

/* Status badge */
.project__status {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.25rem 0.6rem;
  width: fit-content;
}

.project__status--live {
  background-color: var(--accent);
  color: #fff;
}

.project__status--dev {
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

.project__status--soon {
  border: 1.5px solid var(--muted);
  color: var(--muted);
}

.project__name {
  font-family: 'Space Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.project--large .project__name {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.project__desc {
  font-size: 0.95rem;
  line-height: 1.5;
  color: inherit;
  opacity: 0.85;
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.project__tags span {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border: 1px solid currentColor;
  opacity: 0.6;
}

.project__link {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
  transition: opacity 0.2s;
}

.project__link:hover {
  opacity: 0.7;
  text-decoration: underline;
}


/* ========================
   TECH STACK
   ======================== */
.stack {
  background-color: var(--secondary-bg);
  color: var(--secondary-text);
  padding: 6rem 2rem;
}

[data-theme="dark"] .stack {
  background-color: #1a1a1a;
}

.stack__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.stack__label {
  color: var(--muted);
}

.stack__intro {
  font-size: 1.05rem;
  margin-bottom: 3rem;
  max-width: 480px;
  opacity: 0.8;
}

.stack__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.stack__item {
  font-family: 'Space Mono', monospace;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 700;
  padding: 2rem 1.5rem;
  border: 1px solid rgba(245, 240, 235, 0.12);
  transition: background-color 0.25s, color 0.25s;
  text-align: center;
}

.stack__item:hover {
  background-color: var(--accent);
  color: #fff;
}


/* ========================
   CONTACT
   ======================== */
.contact {
  padding: 6rem 2rem;
}

.contact__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

.contact__heading {
  font-family: 'Space Mono', monospace;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
}

.contact__text {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact__email,
.contact__github {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}

.contact__email:hover,
.contact__github:hover {
  opacity: 0.7;
  text-decoration: underline;
}


/* ========================
   FOOTER
   ======================== */
.footer {
  padding: 2rem;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer__grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
}

.footer__name {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer__copy,
.footer__location {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}


/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 900px) {
  .about__grid,
  .contact__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .projects__grid {
    grid-template-columns: 1fr 1fr;
  }

  .project--large {
    grid-column: span 2;
    grid-row: span 1;
  }

  .stack__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 8rem 1.25rem 4rem;
    min-height: auto;
  }

  .hero__title {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .hero__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .hero__dot {
    display: none;
  }

  .topbar {
    padding: 0.6rem 1.25rem;
  }

  .topbar__name {
    font-size: 0.7rem;
  }

  .about,
  .projects,
  .contact,
  .footer {
    padding: 4rem 1.25rem;
  }

  .stack {
    padding: 4rem 1.25rem;
  }

  .projects__grid {
    grid-template-columns: 1fr;
  }

  .project--large,
  .project--wide {
    grid-column: span 1;
  }

  .stack__grid {
    grid-template-columns: 1fr 1fr;
  }

  .stack__item {
    padding: 1.25rem 1rem;
  }

  .footer__grid {
    flex-direction: column;
    align-items: flex-start;
  }
}
