:root {
  --bg: #0f1220;
  --card: #161a2b;
  --text: #e7e7ee;
  --muted: #aab;
  --accent: #6ea8fe;
  --maxw: 1100px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1000px 600px at 20% 0%,
      #111633 0%,
      var(--bg) 60%);
  animation: fadeIn 0.5s ease-out;
}

/* ------------------------------
   Page load fade-in
------------------------------ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------
   Scroll-triggered reveal
------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

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

/* Staggered delays for grid children */
.about-facts .reveal:nth-child(2),
.about-grid .reveal:nth-child(2),
.cta-cards .reveal:nth-child(2) { transition-delay: 0.1s; }

.about-facts .reveal:nth-child(3),
.about-grid .reveal:nth-child(3),
.cta-cards .reveal:nth-child(3) { transition-delay: 0.2s; }

.about-facts .reveal:nth-child(4),
.about-grid .reveal:nth-child(4) { transition-delay: 0.3s; }

.about-grid .reveal:nth-child(5) { transition-delay: 0.4s; }
.about-grid .reveal:nth-child(6) { transition-delay: 0.5s; }

/* ------------------------------
   Reduced motion
------------------------------ */

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .cta,
  .project-card,
  .about-card,
  .nav a::after,
  .btn {
    transition: none !important;
  }
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* ------------------------------
   Header
------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 18, 32, 0.75);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #1e2340;
}

.site-header.minimal {
  border-bottom: none;
  background: transparent;
  backdrop-filter: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

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

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #2a3057;
  transition: box-shadow 0.3s ease;
}

.brand:hover .avatar {
  box-shadow: 0 0 12px rgba(110, 168, 254, 0.35);
}

.name {
  font-weight: 700;
}

.nav a {
  margin-left: 16px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav a:hover::after {
  width: 100%;
}

.nav a:hover {
  color: var(--accent);
}

.nav a.active {
  color: var(--text);
  pointer-events: none;
  cursor: default;
}

.nav a.active::after {
  width: 100%;
  background: var(--text);
}

/* ------------------------------
   Landing Hero
------------------------------ */

.hero--landing {
  display: grid;
  gap: 24px;
  align-items: center;
  padding: 48px 0 32px;
}

@media (min-width: 860px) {
  .hero--landing {
    grid-template-columns: 1.1fr 1fr;
  }
}

.hero-media {
  display: flex;
  justify-content: center;
  position: relative;
}

.hero-media::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(110, 168, 254, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.hero-photo {
  width: 100%;
  max-width: 520px;
  border-radius: 16px;
  border: 1px solid #242a4b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), 0 10px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 1;
}

/* ------------------------------
   Typography polish
------------------------------ */

.hero-copy h1,
.about-section h1,
.section h1 {
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.home h1 {
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.type-line {
  font-size: 1.25rem;
  color: var(--muted);
  min-height: 2.2rem;
  margin-bottom: 18px;
}

.cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ------------------------------
   CTA Cards
------------------------------ */

.cta-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 16px;
}

.cta {
  display: block;
  padding: 18px;
  color: var(--text);
  text-decoration: none;
  background: var(--card);
  border: 1px solid #242a4b;
  border-radius: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.3s ease;
}

.cta:hover,
.cta:focus-visible {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(110, 168, 254, 0.15), 0 8px 20px rgba(0, 0, 0, 0.25);
}

.cta h3 {
  margin: 0 0 6px;
}

/* ------------------------------
   Sections & Footer
------------------------------ */

.section {
  padding: 3rem 0 4rem;
  border-top: 1px solid #1e2340;
}

.site-footer {
  margin-top: 24px;
  border-top: 1px solid #1e2340;
}

.footer-inner {
  padding: 16px 0;
  text-align: center;
  color: var(--muted);
}

.footer-inner a {
  color: var(--accent);
  text-decoration: none;
}

.footer-inner a:hover {
  text-decoration: underline;
}

/* ------------------------------
   Projects Page
------------------------------ */

.project-rail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (min-width: 900px) {
  .project-rail {
    grid-template-columns: 1fr 1fr;
  }
}

.project-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid #2a3057;
  border-radius: 14px;
  background: #16164f;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(110, 168, 254, 0.4);
  box-shadow: 0 4px 12px rgba(110, 168, 254, 0.1), 0 8px 18px rgba(0, 0, 0, 0.12);
}

.project-media {
  flex: 0 0 38%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
  height: 220px;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.project-title {
  margin: 0 0 .25rem;
  font-size: 1.1rem;
}

.project-tags {
  color: #6b6b7a;
  font-size: .9rem;
  margin: 0 0 .75rem;
}

.project-summary {
  margin: 0 0 .75rem;
  line-height: 1.55;
}

/* Actions */
.project-actions {
  margin-top: auto;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ------------------------------
   Buttons
------------------------------ */

.btn,
a.btn {
  text-decoration: none;
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: .55rem .9rem;
  border-radius: 10px;
  font-weight: 600;
  background: #3b1074;
  color: #fff;
  transition: filter 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  filter: brightness(.95);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(59, 16, 116, 0.3);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn.open {
  background: #571c69;
}

.btn.outline {
  background: transparent;
  color: #6f4cff;
  border: 1px solid #8d79ff;
}

.btn.outline:hover {
  box-shadow: 0 4px 10px rgba(111, 76, 255, 0.2);
}

.btn[aria-disabled="true"],
.btn.disabled,
.btn[disabled] {
  background: #3e2f7a;
  color: #dcd6ff;
  border: 1px solid #5b49a6;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: none;
}

/* ------------------------------
   Smooth project details toggle
------------------------------ */

.project-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  margin-top: .75rem;
  font-size: .95rem;
}

.project-details.active {
  max-height: 300px;
  opacity: 1;
}

/* Stack cards vertically on narrow screens */
@media (max-width: 640px) {
  .project-card { flex-direction: column; }
  .project-media {
    flex-basis: auto;
    width: 100%;
    height: 220px;
  }
}

/* ------------------------------
   About Me Page
------------------------------ */

.about-section {
  padding: 3rem 0 4rem;
}

.about-muted {
  color: #6b6b7a;
}

.about-section h2 {
  margin: 2rem 0 .75rem;
  font-size: 1.4rem;
}

/* Quick Facts */
.about-facts {
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .about-facts {
    grid-template-columns: 1fr 1fr;
  }
}

.about-fact {
  border: 1px dashed #1c2749;
  border-radius: 10px;
  padding: .75rem 1rem;
  background: #16164f;
  transition: border-color 0.3s ease;
}

.about-fact:hover {
  border-color: rgba(110, 168, 254, 0.3);
}

/* Hobbies grid */
.about-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .about-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1100px;
    margin-inline: auto;
  }
}

.about-card {
  border: 1px solid #1c2749;
  border-radius: 14px;
  background: #16164f;
  display: flex;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.about-card:hover {
  transform: translateY(-2px);
  border-color: rgba(110, 168, 254, 0.3);
  box-shadow: 0 4px 12px rgba(110, 168, 254, 0.08), 0 8px 18px rgba(0, 0, 0, 0.1);
}

.about-card figure {
  flex: 0 0 120px;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
}

.about-card figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-card .body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1rem 3rem;
}

.about-card .body h3 {
  margin: .15rem 0 .25rem;
  font-size: 1.05rem;
}

.about-card .body p {
  margin: 0;
}

/* ------------------------------
   Contact Page
------------------------------ */

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.contact-list a {
  color: inherit;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  padding: 2px 4px;
  border-radius: 4px;
}

.contact-list a:hover,
.contact-list a:focus {
  background: var(--accent);
  color: white;
}
