/* Thwaha Shuhaib — portfolio theme: light violet editorial */

:root {
  --bg-deep: #f7f5fb;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --text: #1c1630;
  --text-muted: #5a5370;
  --text-dim: #8b849c;
  --accent: #7c3aed;
  --accent-bright: #6d28d9;
  --accent-glow: rgba(124, 58, 237, 0.22);
  --accent-soft: rgba(124, 58, 237, 0.1);
  --border: rgba(28, 22, 48, 0.1);
  --header-fade: rgba(247, 245, 251, 0.88);
  --on-accent: #ffffff;
  --shadow-card: 0 4px 24px rgba(28, 22, 48, 0.06);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Epilogue", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 4.5rem;
  --max: 72rem;
  --space: clamp(1.25rem, 3vw, 2.5rem);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Atmosphere */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.orb {
  pointer-events: none;
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
}

.orb-a {
  width: min(55vw, 28rem);
  height: min(55vw, 28rem);
  top: -10%;
  right: -8%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
}

.orb-b {
  width: min(45vw, 22rem);
  height: min(45vw, 22rem);
  bottom: 15%;
  left: -12%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.18), transparent 70%);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space);
  background: linear-gradient(to bottom, var(--header-fade), rgba(247, 245, 251, 0.65));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-out);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--accent-bright);
}

.nav-menu {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.25s;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  color: var(--accent-bright);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

/* Hero */
main {
  position: relative;
  z-index: 1;
}

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--header-h) + 1.5rem) var(--space) 3rem;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  margin-top: 1rem;
  text-align: left;
  grid-template-areas:
    "meta"
    "portrait"
    "text";
  grid-template-columns: 1fr;
}

.hero-meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 0;
}

.hero-portrait {
  grid-area: portrait;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 0.5rem 0;
}

.hero-text {
  grid-area: text;
}

@media (min-width: 900px) {
  .hero {
    justify-content: center;
    padding-top: calc(var(--header-h) + 8rem);
    padding-bottom: 5rem;
  }

  .hero-grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 4rem 5rem;
    grid-template-areas:
      "meta meta"
      "text portrait";
    margin-top: 0;
  }

  .hero-meta {
    margin-bottom: 1rem;
  }
}

.hero-portrait img {
  width: clamp(8.5rem, 45vw, 14rem);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow:
    0 20px 60px rgba(124, 58, 237, 0.18),
    0 0 0 8px rgba(124, 58, 237, 0.04);
  background: var(--bg-card);
}

@media (min-width: 900px) {
  .hero-portrait img {
    width: clamp(12rem, 35vw, 24rem);
  }
}

.pill {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  border: 1px solid rgba(124, 58, 237, 0.22);
}

.location {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.05;
}

.hero-line {
  display: block;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.hero-name {
  display: block;
  font-size: clamp(2.25rem, 11vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 50%, #9333ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-role {
  margin: 0 0 1.25rem;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 500;
  color: var(--accent);
}

.hero-tagline {
  margin: 0;
  max-width: 36rem;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--text-muted);
  font-weight: 300;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 999px;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background 0.25s;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--accent-glow);
}

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

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.hero-scroll {
  margin-top: auto;
  padding-top: 4rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.scroll-line {
  width: 3rem;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  animation: pulse-line 2s ease-in-out infinite;
}

@keyframes pulse-line {
  0%,
  100% {
    opacity: 0.4;
    transform: scaleX(0.85);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 12vw, 7rem) var(--space);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-num {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.7;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.about-grid {
  display: grid;
  gap: 2rem;
  max-width: 52rem;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: start;
  }
}

.about-lead {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 300;
  line-height: 1.45;
  color: var(--text);
}

.about-body {
  margin: 0;
  color: var(--text-muted);
}

/* Timeline */
.timeline-item {
  display: grid;
  gap: 1rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  border-left: 3px solid var(--accent);
}

@media (min-width: 640px) {
  .timeline-item {
    grid-template-columns: 6rem 1fr;
    gap: 2rem;
  }
}

.timeline-when {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.timeline-body h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.timeline-role {
  margin: 0 0 0.75rem;
  color: var(--accent-bright);
  font-weight: 500;
  font-size: 0.9375rem;
}

.timeline-body p:last-child {
  margin: 0;
  color: var(--text-muted);
}

/* Projects */
.project-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  position: relative;
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  transition: border-color 0.3s, transform 0.35s var(--ease-out);
}

.project-card:hover {
  border-color: rgba(180, 122, 255, 0.35);
  transform: translateY(-4px);
}

.project-index {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 1rem;
}

.project-card h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.project-card p {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-tags li {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-dim);
}

.project-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-bright);
  transition: letter-spacing 0.25s;
}

.project-link:hover {
  letter-spacing: 0.02em;
}

.project-status,
.project-note {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}

.project-note {
  color: var(--text-dim);
}

/* Skills */
.skills-wrap {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .skills-wrap {
    grid-template-columns: repeat(3, 1fr);
  }
}

.skill-group {
  padding: 1.5rem;
  border-radius: 1rem;
  background: linear-gradient(160deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border);
}

.skill-group h3 {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.skill-group p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Contact */
.contact-block {
  max-width: 40rem;
}

.contact-lead {
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
  color: var(--text-muted);
}

.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--accent-bright);
  border-bottom: 2px solid var(--accent-soft);
  padding-bottom: 0.25rem;
  transition: border-color 0.25s, color 0.25s;
}

.contact-email:hover {
  border-color: var(--accent);
  color: var(--text);
}

.social-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.25s, border-color 0.25s, transform 0.25s var(--ease-out);
}

.social-link svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

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

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--space) 3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

.footer-note {
  margin: 0;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-text .reveal:nth-child(1) {
  transition-delay: 0.05s;
}
.hero-text .reveal:nth-child(2) {
  transition-delay: 0.12s;
}
.hero-text .reveal:nth-child(3) {
  transition-delay: 0.2s;
}
.hero-text .reveal:nth-child(4) {
  transition-delay: 0.28s;
}
.hero-text .reveal:nth-child(5) {
  transition-delay: 0.36s;
}

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

  .scroll-line {
    animation: none;
  }
}

/* Mobile nav */
@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
    align-self: end;
    justify-self: end;
  }

  .logo {
    transform: translate(0px, 33px);
  }
  .nav {
    width: 100%;
    flex-basis: 100%;
  }

  .site-header {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-h);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    padding: 1rem 0 0.5rem;
    gap: 0.75rem;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(4px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }
}

@media (max-width: 900px) {
  .hero-scroll {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 1rem);
  }

  .orb {
    filter: blur(40px);
    opacity: 0.7;
  }
}

@media (max-width: 480px) {
  .hero-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .hero-cta {
    margin-top: 1.75rem;
  }

  .btn {
    padding: 0.75rem 1.4rem;
    font-size: 0.8125rem;
  }

  .section {
    padding: clamp(3rem, 10vw, 5rem) var(--space);
  }
}
