/*=============== CSS VARIABLES (LIGHT/DARK) ===============*/
:root {
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --text: #000000;
  --text-muted: #6b7280;
  --text-muted-light: #9ca3af;
  --border: #000000;
  --card-bg: #ffffff;
  --card-header-bg: #fafafa;
  --footer-bg: #000000;
  --footer-text: #ffffff;
  --footer-muted: #a1a1aa;
  --dot-color: rgba(0,0,0,0.08);
}

.dark {
  --bg: #0a0a0a;
  --bg-alt: #141414;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-muted-light: #71717a;
  --border: #fafafa;
  --card-bg: #141414;
  --card-header-bg: #1a1a1a;
  --footer-bg: #fafafa;
  --footer-text: #0a0a0a;
  --footer-muted: #52525b;
  --dot-color: rgba(255,255,255,0.08);
}

/*=============== BASE ===============*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

a {
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  border: none;
  outline: none;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
}

/*=============== HEADER & NAV ===============*/
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.scroll-header {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.nav {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.nav-avatar {
  width: 36px;
  height: 36px;
  overflow: hidden;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
}

.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1);
}

.dark .nav-avatar img {
  filter: invert(1);
}

.nav-name {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-link {
  position: relative;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
}

.nav-link-bg {
  position: absolute;
  inset: 0;
  background: var(--text);
  transform: translateY(-100%);
  transition: transform 0.2s ease-in-out;
}

.nav-link:hover .nav-link-bg {
  transform: translateY(0);
}

.nav-link-text {
  position: relative;
  z-index: 10;
  transition: color 0.2s;
}

.nav-link:hover .nav-link-text {
  color: var(--bg);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--border);
  padding: 0 16px;
  height: 36px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  background: var(--text);
  color: var(--bg);
  transition: all 0.2s;
}

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

.nav-cta-arrow {
  width: 16px;
  height: 16px;
}

.nav-cta-icon {
  display: none;
}

/*=============== DARK MODE TOGGLE ===============*/
.theme-toggle {
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

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

/*=============== MOBILE MENU ===============*/
.nav-mobile-toggle {
  display: none;
  border: 2px solid var(--border);
  padding: 6px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.nav-mobile-toggle:hover {
  background: var(--text);
  color: var(--bg);
}

.nav-mobile-toggle svg {
  width: 20px;
  height: 20px;
}

.mobile-menu {
  display: none;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.mobile-menu.show {
  display: block;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 1.5rem;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: all 0.15s;
}

.mobile-menu a:last-child {
  border-bottom: none;
}

.mobile-menu a:hover {
  background: var(--text);
  color: var(--bg);
}

/*=============== HERO ===============*/
.hero {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.hero-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 48px 1.5rem;
  display: flex;
  align-items: center;
  gap: 64px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -1px;
  margin-bottom: 28px;
}

.hero p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 24rem;
  margin-bottom: 32px;
  line-height: 1.6;
}

.hero p a {
  font-weight: 700;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hero-cta {
  display: inline-block;
  border: 2px solid var(--border);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  transition: all 0.15s;
}

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

.hero-illustration {
  flex-shrink: 0;
  width: 288px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-illustration img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dark .hero-illustration img {
  filter: invert(1);
}

/*=============== QUICK LINKS ===============*/
.quick-links {
  background: var(--bg);
  padding: 40px 0;
  border-bottom: 2px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.quick-links-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.quick-links-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.quick-links-grid {
  border: 2px solid var(--border);
  overflow: hidden;
  display: flex;
}

.quick-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}

.quick-link:not(:last-child) {
  border-right: 2px solid var(--border);
}

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

.quick-link svg {
  width: 20px;
  height: 20px;
}

/*=============== DOT BACKGROUND ===============*/
.dot-bg {
  background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: 24px 24px;
}

/*=============== SECTIONS ===============*/
.section {
  padding: 64px 0;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  transition: background 0.3s, border-color 0.3s;
}

.section-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  margin-bottom: 40px;
}

/*=============== SERVICES ===============*/
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.service-card {
  border: 2px solid var(--border);
  padding: 20px;
  background: var(--card-bg);
  transition: all 0.15s;
}

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

.service-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

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

.service-card:hover p {
  color: var(--bg);
  opacity: 0.7;
}

/*=============== PORTFOLIO (browser-style cards) ===============*/
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  border: 2px solid var(--border);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  transition: background 0.3s, border-color 0.3s;
}

.project-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 2px solid var(--border);
  background: var(--card-header-bg);
  transition: background 0.3s, border-color 0.3s;
}

.project-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.project-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.project-bar-title {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
  text-align: center;
  padding-right: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-img {
  height: 208px;
  border-bottom: 2px solid var(--border);
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted-light);
  font-size: 13px;
  overflow: hidden;
  transition: background 0.3s, border-color 0.3s;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.project-body h3 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.project-body p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.project-link {
  display: inline-block;
  border: 2px solid var(--border);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  text-align: center;
  transition: all 0.15s;
}

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

/*=============== EXPERIENCE TIMELINE ===============*/
.edu-timeline {
  position: relative;
  padding-left: 32px;
}

.edu-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.edu-item {
  position: relative;
  padding-bottom: 24px;
}

.edu-item:last-child {
  padding-bottom: 0;
}

.edu-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.edu-item:last-child::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 0;
  height: 22px;
  width: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.edu-item:first-child::before {
  top: 20px;
}

.edu-marker {
  position: absolute;
  left: -32px;
  top: 16px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  background: var(--text);
  z-index: 1;
  transition: background 0.3s, border-color 0.3s;
}

.edu-connector {
  position: absolute;
  left: -20px;
  top: 21px;
  width: 20px;
  height: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.edu-card {
  border: 2px solid var(--border);
  background: var(--card-bg);
  padding: 16px;
  transition: background 0.3s, border-color 0.3s;
}

.edu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.edu-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted-light);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.edu-year {
  font-size: 10px;
  font-weight: 700;
  background: var(--text);
  color: var(--bg);
  padding: 2px 8px;
  white-space: nowrap;
}

.edu-card h3 {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 4px;
}

.edu-card .edu-school {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.edu-card .edu-location {
  font-size: 12px;
  color: var(--text-muted-light);
  margin-bottom: 12px;
}

.edu-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.edu-tag {
  font-size: 11px;
  border: 1px solid var(--border);
  padding: 2px 8px;
  color: var(--text-muted);
  transition: border-color 0.3s;
}

/*=============== TECH STACK (marquee carousel) ===============*/
.tech-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.tech-header h2 {
  margin-bottom: 0;
  white-space: nowrap;
}

.tech-header-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-top: 6px;
  transition: background 0.3s;
}

.tech-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
}

.tech-marquee-wrap {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
  mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}

.tech-marquee {
  display: flex;
  gap: 12px;
  width: max-content;
}

.tech-marquee-forward {
  animation: marquee-scroll var(--marquee-duration, 35s) linear infinite;
}

.tech-marquee-reverse {
  animation: marquee-scroll-reverse var(--marquee-duration, 28s) linear infinite;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-100% / 3)); }
}

@keyframes marquee-scroll-reverse {
  0% { transform: translateX(calc(-100% / 3)); }
  100% { transform: translateX(0); }
}

.tech-tag {
  border: 2px solid var(--border);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--card-bg);
  color: var(--text);
  cursor: default;
  user-select: none;
  transition: background 0.15s, color 0.15s, border-color 0.3s;
}

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

/*=============== TESTIMONIALS ===============*/
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.testimonial-card {
  border: 2px solid var(--border);
  padding: 20px;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  transition: background 0.3s, border-color 0.3s;
}

.testimonial-quote {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  font-style: italic;
  flex: 1;
  margin-bottom: 16px;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 2px solid var(--border);
  padding-top: 16px;
  transition: border-color 0.3s;
}

.testimonial-initials {
  width: 36px;
  height: 36px;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.testimonial-name {
  font-size: 13px;
  font-weight: 700;
}

.testimonial-role {
  font-size: 12px;
  color: var(--text-muted-light);
}

/*=============== BLOG ===============*/
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.blog-card {
  border: 2px solid var(--border);
  background: var(--card-bg);
  overflow: hidden;
  transition: background 0.3s, border-color 0.3s;
}

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

.blog-thumb {
  height: 140px;
  background: var(--bg-alt);
  border-bottom: 2px solid var(--border);
  overflow: hidden;
  transition: background 0.3s, border-color 0.3s;
}

.blog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-info {
  padding: 16px;
}

.blog-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted-light);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.blog-info h3 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.blog-info p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.blog-card:hover .blog-info p,
.blog-card:hover .blog-date {
  color: var(--bg);
  opacity: 0.7;
}

/*=============== CONTACT ===============*/
.contact {
  background: var(--bg-alt);
  transition: background 0.3s;
}

.contact h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  margin-bottom: 16px;
}

.contact > .section-inner > p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 28rem;
  margin-bottom: 32px;
  line-height: 1.6;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--border);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}

.contact-link:first-child {
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}

.contact-link:first-child:hover {
  background: var(--bg);
  color: var(--text);
}

.contact-link:not(:first-child):hover {
  background: var(--text);
  color: var(--bg);
}

.contact-link svg {
  width: 16px;
  height: 16px;
}

.contact-link .threads-icon {
  width: 16px;
  height: 16px;
}

.dark .contact-link .threads-icon {
  filter: invert(1);
}

.contact-link:first-child:hover .threads-icon,
.contact-link:not(:first-child):hover .threads-icon {
  filter: invert(1);
}

/*=============== FOOTER ===============*/
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 32px 0;
  transition: background 0.3s, color 0.3s;
}

.footer-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-inner span:first-child {
  font-size: 14px;
  font-weight: 600;
}

.footer-inner span:last-child {
  font-size: 14px;
  color: var(--footer-muted);
}

/*=============== SCROLLBAR ===============*/
::-webkit-scrollbar {
  width: 0.5rem;
  background-color: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
  background-color: var(--text-muted-light);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-muted);
}

/*=============== RESPONSIVE ===============*/
@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column-reverse;
    gap: 16px;
    padding: 24px 1.5rem;
    align-items: flex-start;
  }

  .hero-illustration {
    width: 140px;
    height: 168px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-cta {
    display: block;
    text-align: center;
    width: 100%;
  }

  .projects-grid,
  .services-grid {
    grid-template-columns: 1fr;
  }

  .testimonials-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .quick-links-grid {
    flex-direction: column;
  }

  .quick-link:not(:last-child) {
    border-right: none;
    border-bottom: 2px solid var(--border);
  }

  .nav-links {
    display: none;
  }

  .nav-mobile-toggle {
    display: flex;
  }

  /* Make all nav-right buttons uniform square icons on mobile */
  .nav-right {
    gap: 6px;
  }

  .nav-cta {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }

  .nav-cta-text,
  .nav-cta-arrow {
    display: none;
  }

  .nav-cta-icon {
    display: block;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .nav-mobile-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .contact-links {
    flex-direction: column;
  }

  .contact-link {
    justify-content: center;
  }

  .nav-name {
    display: none;
  }
}
