:root {
  --purple: #6a3fe0;
  --deep-purple: #1c1335;
  --black: #08070f;
  --orange: #ff7a45;
  --white: #f9f5ff;
  --gray: #c7c4d7;
  --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-primary);
  color: var(--white);
  background: radial-gradient(circle at top, rgba(106, 63, 224, 0.35), transparent 55%),
              linear-gradient(160deg, #0b0913 0%, #140d26 50%, #08070f 100%);
  min-height: 100vh;
}

.no-scroll {
  overflow: hidden;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  background: rgba(8, 7, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(106, 63, 224, 0.25);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.branding {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--orange));
  font-weight: 700;
  color: var(--black);
  letter-spacing: 0.08em;
}

.brand-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.brand-tagline {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gray);
}

.site-nav {
  display: flex;
  gap: 1.2rem;
}

.site-nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: color 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--orange);
  transform: translateY(-1px);
}

.hero {
  padding: 6rem 0 5rem;
  background: linear-gradient(140deg, rgba(106, 63, 224, 0.22) 0%, rgba(8, 7, 15, 0) 65%);
}

.hero--detail {
  padding: 5.5rem 0 3rem;
  background: none;
  position: relative;
  isolation: isolate;
}

.hero--detail::before,
.hero--detail::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero--detail::before {
  z-index: -2;
  background-image: var(--hero-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(1.05);
}

.hero--detail::after {
  background: linear-gradient(160deg, rgba(8, 7, 15, 0.9) 0%, rgba(8, 7, 15, 0.55) 42%, rgba(8, 7, 15, 0.88) 100%);
}

.hero-copy--detail {
  background: rgba(8, 7, 15, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(106, 63, 224, 0.35);
  box-shadow: 0 18px 36px rgba(8, 7, 15, 0.65);
  padding: 2.25rem;
  border-radius: 20px;
}

.hero-copy {
  max-width: 32rem;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.5rem, 4vw, 3.3rem);
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero p {
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange), var(--purple));
  color: var(--black);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta:hover,
.cta:focus {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(106, 63, 224, 0.35);
}

.portfolio {
  padding: 4rem 0 5rem;
}

.section-heading {
  text-align: center;
  margin-bottom: 3rem;
}

.section-heading h2 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.section-heading p {
  color: rgba(255, 255, 255, 0.7);
  max-width: 36rem;
  margin: 0 auto;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-card {
  background: rgba(28, 19, 53, 0.65);
  border: 1px solid rgba(106, 63, 224, 0.35);
  border-radius: 22px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  box-shadow: 0 16px 30px rgba(8, 7, 15, 0.5);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--orange);
  box-shadow: 0 18px 34px rgba(106, 63, 224, 0.22);
}

.project-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.project-card p,
.project-card li {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.project-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.project-card li + li {
  margin-top: 0.5rem;
}

.markdown p + p {
  margin-top: 1rem;
}

.markdown ul,
.markdown ol {
  margin: 1rem 0;
  padding-left: 1.2rem;
  color: rgba(255, 255, 255, 0.78);
}

.markdown li + li {
  margin-top: 0.4rem;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.card-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.project-year {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--orange);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-summary {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.card-actions {
  display: flex;
  gap: 0.8rem;
}

.project-card--featured {
  gap: 1.6rem;
}

.project-card--featured .card-main {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.5rem;
  align-items: start;
}

.project-card--featured .card-media {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(106, 63, 224, 0.45), rgba(8, 7, 15, 0.85));
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card--featured .card-media img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.project-card--featured .card-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}

.project-card--featured .card-summary {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

.project-card--featured .card-actions {
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.project-card--featured .btn {
  flex: 0 1 220px;
  max-width: 240px;
}

.project-card--featured .btn.secondary {
  border: 1px solid rgba(106, 63, 224, 0.4);
}

.project-card--featured .btn.primary {
  box-shadow: 0 12px 24px rgba(106, 63, 224, 0.28);
}

.project-card--featured .btn.primary:hover,
.project-card--featured .btn.primary:focus {
  box-shadow: 0 14px 28px rgba(255, 122, 69, 0.32);
}

.project-card--featured .btn.secondary:hover,
.project-card--featured .btn.secondary:focus {
  border-color: var(--orange);
}

.btn {
  text-align: center;
  text-decoration: none;
  padding: 0.7rem 1.3rem;
  border-radius: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.btn.primary {
  background: linear-gradient(135deg, var(--orange), var(--purple));
  color: var(--black);
  border: none;
}

.btn.secondary {
  background: rgba(8, 7, 15, 0.85);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn:hover,
.btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(106, 63, 224, 0.35);
}

.cta-slab {
  padding: 4rem 0;
  background: linear-gradient(140deg, rgba(106, 63, 224, 0.18) 0%, rgba(8, 7, 15, 0.55) 100%);
  text-align: center;
}

.cta-slab h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.cta-slab p {
  margin: 0 auto 2rem;
  max-width: 32rem;
  color: rgba(255, 255, 255, 0.75);
}

.site-footer {
  border-top: 1px solid rgba(106, 63, 224, 0.25);
  padding: 1.5rem 0;
  background: rgba(8, 7, 15, 0.75);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-brand {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  margin-left: 1rem;
  font-size: 0.85rem;
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--orange);
}


.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 4, 12, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1200;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: min(520px, 100%);
  background: linear-gradient(160deg, rgba(106, 63, 224, 0.28) 0%, rgba(20, 13, 38, 0.95) 60%);
  border: 1px solid rgba(106, 63, 224, 0.5);
  border-radius: 24px;
  box-shadow: 0 28px 60px rgba(8, 7, 15, 0.6);
  padding: 2.2rem 2.4rem;
  position: relative;
  color: var(--white);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(8, 7, 15, 0.85);
  border: 1px solid rgba(106, 63, 224, 0.4);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  color: var(--orange);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-close:hover,
.modal-close:focus {
  transform: rotate(8deg);
  box-shadow: 0 6px 12px rgba(106, 63, 224, 0.3);
}

.modal h2 {
  margin: 0 0 0.6rem;
  font-size: 1.8rem;
}

.modal-intro {
  margin: 0 0 1.4rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-feedback {
  min-height: 1.2rem;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.7);
  margin: -0.4rem 0 0;
}

.form-feedback.is-error {
  color: #ff9e7a;
}

.form-feedback.is-success {
  color: #cbbff6;
}

.modal-form label {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

.modal-form input,
.modal-form textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 138, 77, 0.4);
  background: rgba(36, 26, 61, 0.75);
  color: var(--white);
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-form input::placeholder,
.modal-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.modal-form input:focus,
.modal-form textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 138, 77, 0.25);
}

.modal-form .btn.primary {
  align-self: flex-start;
  padding: 0.75rem 1.6rem;
}

@media (max-width: 640px) {
  .site-header .container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .site-nav {
    gap: 0.8rem;
  }

  .card-actions {
    flex-direction: column;
    gap: 0.6rem;
  }

  .btn {
    width: 100%;
    font-size: 0.95rem;
    padding: 0.55rem 1.1rem;
    border-radius: 12px;
  }

  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal {
    padding: 1.8rem;
  }

  .modal h2 {
    font-size: 1.6rem;
  }

  .modal-form {
    gap: 0.9rem;
  }
}

@media (max-width: 900px) {
  .project-card--featured .card-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .project-card--featured {
    padding: 1.6rem;
  }

  .project-card--featured .card-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .project-card--featured .btn {
    max-width: none;
    flex: 0 0 auto;
    font-size: 0.95rem;
    padding: 0.55rem 1.1rem;
    border-radius: 12px;
  }
}
