:root {
  --bg: #0d1117;
  --surface: #131a26;
  --surface-alt: #192232;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #7c3aed;
  --accent-soft: #c4b5fd;
  --border: rgba(148, 163, 184, 0.16);
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease-out, transform 0.65s ease-out;
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-group .reveal {
  transition-delay: calc(var(--reveal-delay, 0s));
}

.reveal-delay-1 { --reveal-delay: 0.08s; }
.reveal-delay-2 { --reveal-delay: 0.16s; }
.reveal-delay-3 { --reveal-delay: 0.24s; }
.reveal-delay-4 { --reveal-delay: 0.32s; }

body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 24%),
              radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.14), transparent 22%),
              linear-gradient(180deg, #071019 0%, #0b121f 100%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(20px);
  background: rgba(7, 12, 23, 0.8);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.navbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

.nav-links.open {
  display: flex;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.hero {
  padding: 5rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.hero-copy {
  max-width: 560px;
}

.hero-copy h1 {
  font-size: clamp(2.75rem, 5vw, 4.25rem);
  line-height: 0.98;
  margin: 0;
}

.hero-copy p {
  margin: 1.5rem 0 2.5rem;
  color: var(--muted);
  line-height: 1.8;
  max-width: 45rem;
}

.cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  color: #fff;
  box-shadow: 0 18px 35px rgba(124, 58, 237, 0.25);
}

.btn-secondary {
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.btn:hover {
  transform: translateY(-1px);
}

.hero-visual {
  position: relative;
  overflow: hidden;
  border-radius: clamp(36px, 20vw, 64px);
  border: 1px solid rgba(148, 163, 184, 0.08);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.25), transparent 30%),
              radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.22), transparent 25%);
  pointer-events: none;
}

.hero-visual img {
  width: 100%;
  height: auto;
  display: block;
}

.section {
  padding: 5rem 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.section-title::before {
  content: "";
  width: 50px;
  height: 1px;
  background: rgba(148, 163, 184, 0.4);
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.section-description {
  color: var(--muted);
  max-width: 640px;
  line-height: 1.8;
}

.about-grid,
.projects-grid {
  display: grid;
  gap: 2rem;
}

.about-grid {
  grid-template-columns: 1fr 1fr;
}

.profile-card,
.skill-card,
.project-card,
.contact-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.profile-card p,
.skill-card p,
.contact-card p {
  color: var(--muted);
}

.profile-card .tag {
  display: inline-flex;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.12);
  color: var(--accent);
  font-size: 0.94rem;
  margin-bottom: 1rem;
}

.profile-card ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0.9rem;
}

.profile-card li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text);
}

.profile-card li span:first-child {
  color: var(--muted);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.skill-card {
  min-height: 220px;
}

.skill-card h3 {
  margin-top: 0;
}

.projects-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  overflow: hidden;
  position: relative;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.project-card:hover {
  transform: translateY(-6px);
}

.project-card a {
  display: block;
  color: inherit;
}

.project-card img {
  border-radius: 24px;
}

.project-card .project-info {
  position: absolute;
  inset: auto 1.5rem 1.5rem;
  background: rgba(7, 12, 23, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  padding: 1rem 1.25rem;
  transition: transform 0.28s ease, background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.project-card a:hover .project-info {
  transform: translateY(-4px);
  background: rgba(15, 18, 33, 0.96);
  border-color: rgba(124, 58, 237, 0.28);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.22);
}

.project-card small {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}

.project-card h3 {
  margin: 0.55rem 0 0.75rem;
  font-size: 1.25rem;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
}

.contact-card {
  display: grid;
  gap: 1rem;
}

.contact-card h3 {
  margin-top: 0;
}

.contact-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.contact-card li {
  display: flex;
  gap: 0.8rem;
  color: var(--muted);
}

.contact-card li span:first-child {
  color: var(--text);
  min-width: 90px;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: 0.5rem;
}

.form-field label {
  color: var(--muted);
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 1rem 1rem;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid rgba(124, 58, 237, 0.3);
  border-color: rgba(124, 58, 237, 0.35);
}

textarea {
  min-height: 170px;
  resize: vertical;
}

.footer {
  padding: 2rem 0 4rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .hero-grid,
  .about-grid,
  .projects-grid,
  .contact-grid,
  .assignment-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 4rem;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 25;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem 1.25rem 1.5rem;
    background: rgba(7, 12, 23, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-top: none;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 1rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    transition: background 0.2s ease, color 0.2s ease;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(124, 58, 237, 0.18);
    color: #fff;
  }

  .navbar {
    flex-wrap: wrap;
  }

  .hero-copy {
    max-width: 100%;
  }

  .project-card .project-info {
    position: static;
    inset: auto;
    margin: 1rem 0 0;
    border-radius: 24px;
  }

  .project-card:hover {
    transform: none;
  }
}

.dashboard-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-header h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(2rem, 2.5vw, 2.75rem);
  line-height: 1.05;
}

.page-label {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.88rem;
}

.dashboard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.dashboard-meta span {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.dashboard-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  padding: 1.5rem 1.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.10);
  border-radius: 20px;
}

.dashboard-summary h2 {
  margin: 0.4rem 0 0;
  font-size: 2rem;
}

.summary-label {
  color: var(--muted);
  margin: 0;
}

.summary-pill {
  background: rgba(56, 189, 248, 0.12);
  color: #dbeafe;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.assignment-grid {
  display: grid;
  gap: 1.5rem;
}

.assignment-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.assignment-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.25);
}

.assignment-card__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.assignment-card__content > div {
  min-width: 0;
}

.assignment-card__content h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.25rem;
}

.assignment-card__summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.assignment-button {
  margin-top: 0.5rem;
  padding: 0.9rem 1.4rem;
  white-space: nowrap;
}

.assignment-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.assignment-card__header h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.25rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.2s ease, color 0.2s ease;
}

.status-draft {
  background: rgba(124, 58, 237, 0.12);
  color: #c4b5fd;
}

.status-submitted {
  background: rgba(56, 189, 248, 0.12);
  color: #93c5fd;
}

.status-graded {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.btn-tertiary {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.assignment-card__details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.28s ease, opacity 0.28s ease;
  margin-top: 1.5rem;
}

.assignment-card.is-open .assignment-card__details {
  max-height: 1000px;
  opacity: 1;
}

.assignment-card__details h4,
.assignment-card__details strong {
  font-weight: 700;
}

.assignment-card__details p,
.assignment-card__details ol,
.assignment-card__details ul {
  color: var(--muted);
  line-height: 1.75;
  margin: 0.8rem 0;
}

.assignment-card__details ul,
.assignment-card__details ol {
  padding-left: 1.25rem;
}

.notice-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  padding: 1.75rem;
  margin-top: 2rem;
}

.notice-card .tag {
  background: rgba(56, 189, 248, 0.12);
  color: #bfdbfe;
}

.notice-card h3 {
  margin: 1rem 0 0.75rem;
}

.notice-card p {
  margin: 0;
  color: var(--muted);
}

.assignment-detail-page {
  padding-bottom: 4rem;
}

.assignment-detail-page .section {
  padding-top: 3rem;
}

.assignment-detail-header {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.assignment-detail-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: transparent;
  transition: all 0.2s ease;
  width: fit-content;
  position: relative;
  z-index: 1;
}

.assignment-detail-header .back-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4d4d, #ffb14d, #f6ff4d, #4dff86, #4dbbff, #8b4dff, #ff4dcc);
  z-index: -1;
  padding: 1.5px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.assignment-detail-header .back-link:hover {
  color: var(--text);
}

.assignment-detail-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.05;
}

.assignment-detail-course {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.assignment-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 1.5rem 0;
}

.assignment-detail-meta span {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  color: var(--muted);
}

.assignment-detail-content {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 20px;
  padding: 2rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.assignment-detail-content h2,
.assignment-detail-content h3,
.assignment-detail-content h4,
.assignment-detail-content h5 {
  color: var(--text);
  margin-top: 1.6rem;
}

.assignment-detail-content p,
.assignment-detail-content ol,
.assignment-detail-content ul {
  color: var(--muted);
  line-height: 1.8;
  margin: 1rem 0;
}

.assignment-detail-content ol,
.assignment-detail-content ul {
  padding-left: 1.25rem;
}

.assignment-detail-content li {
  margin: 0.6rem 0;
}

.scroll-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 44px;
  height: 44px;
  border: 2px solid #9fe8a7;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease;
  z-index: 999;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: rgba(159, 232, 167, 0.12);
}

.scroll-to-top:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(159, 232, 167, 0.24);
}

@media (max-width: 720px) {
  .dashboard-meta,
  .dashboard-summary,
  .assignment-card__header {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-summary {
    padding: 1.25rem 1rem;
  }

  .assignment-card__content {
    flex-direction: column;
    align-items: stretch;
  }

  .assignment-button,
  .btn {
    width: 100%;
  }

  .hero-copy h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero-visual {
    max-width: 100%;
  }
}
