/* ==========================================================================
   Sections: header, hero, about, skills, portfolio, experience, contact, footer
   ========================================================================== */

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

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: var(--bg-header);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s, border-color 0.3s;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(to top right, #4f46e5, #8b5cf6);
  color: #fff;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  box-shadow: 0 10px 15px -3px rgb(99 102 241 / 0.2), 0 4px 6px -4px rgb(99 102 241 / 0.2);
  transition: transform 0.15s var(--ease);
}

.brand:hover .brand__logo {
  transform: scale(1.05);
}

.brand__name {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--heading);
}

.nav {
  display: none;
  align-items: center;
  gap: 2rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--muted);
}

:root.dark .nav {
  color: var(--slate-300);
}

.nav a {
  transition: color 0.15s var(--ease);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-cta {
  display: none;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* Theme icon swaps via CSS so there is no flash or JS icon juggling */
.theme-toggle .icon-sun {
  display: none;
}

:root.dark .theme-toggle .icon-sun {
  display: inline-block;
}

:root.dark .theme-toggle .icon-moon {
  display: none;
}

.menu-toggle {
  display: inline-flex;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: var(--header-height);
  left: 0;
  width: 100%;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-2xl);
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu a {
  padding-block: 0.5rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border-soft);
}

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

@media (min-width: 640px) {
  .header-cta {
    display: inline-flex;
  }
}

@media (min-width: 768px) {
  .nav {
    display: flex;
  }

  .menu-toggle,
  .mobile-menu,
  .mobile-menu.is-open {
    display: none;
  }
}

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

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: 8rem 5rem;
}

.hero__blob {
  position: absolute;
  z-index: -1;
  border-radius: 9999px;
  filter: blur(80px);
  pointer-events: none;
}

.hero__blob--a {
  top: 25%;
  left: 50%;
  width: 500px;
  height: 500px;
  background: rgb(99 102 241 / 0.1);
  transform: translate(-50%, -50%);
}

.hero__blob--b {
  top: 66.666667%;
  right: 2.5rem;
  width: 350px;
  height: 350px;
  background: rgb(139 92 246 / 0.1);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__content {
  text-align: center;
}

.hero__content > * + * {
  margin-top: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--accent);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}

.hero__title {
  font-size: 2.25rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--heading);
}

.text-gradient {
  background: linear-gradient(to right, #4f46e5, #7c3aed, #db2777);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__lead {
  max-width: 42rem;
  margin-inline: auto;
  font-size: 1.125rem;
  line-height: 1.625;
  font-weight: 400;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding-top: 1rem;
}

.hero__actions .btn {
  width: 100%;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 32rem;
  margin-inline: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stats > div {
  display: flex;
  flex-direction: column-reverse;
}

.stats__value {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 800;
  color: var(--heading);
}

.stats__label {
  margin-top: 0.125rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--subtle);
}

.hero__visual {
  display: flex;
  justify-content: center;
}

.portrait {
  position: relative;
  width: 18rem;
  height: 25rem;
}

.portrait__glow {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-2xl);
  background: linear-gradient(to top right, #4f46e5, #8b5cf6);
  transform: rotate(6deg);
  opacity: 0.3;
  filter: blur(24px);
}

.portrait__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  background: var(--slate-200);
  border: 2px solid rgb(99 102 241 / 0.2);
  box-shadow: var(--shadow-2xl);
}

:root.dark .portrait__frame {
  background: var(--slate-800);
}

.portrait__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  /*filter: grayscale(1);*/
  transform: scale(1.05);
  transition: all 0.5s var(--ease);
}

.portrait__img:hover {
  filter: grayscale(0);
  transform: scale(1);
}

.portrait__badge {
  position: absolute;
  bottom: -1.5rem;
  left: -1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
}

.portrait__badge-label {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--subtle);
}

.portrait__badge-value {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  color: var(--heading);
}

@media (min-width: 640px) {
  .hero__title {
    font-size: 3.75rem;
  }

  .hero__lead {
    font-size: 1.25rem;
    line-height: 1.625;
  }

  .hero__actions {
    flex-direction: row;
  }

  .hero__actions .btn {
    width: auto;
  }

  .stats__value {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }

  .portrait {
    width: 24rem;
    height: 30rem;
  }
}

@media (min-width: 768px) {
  .hero {
    padding-block: 11rem 8rem;
  }

  .hero__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .hero__content {
    grid-column: span 7;
    text-align: left;
  }

  .hero__lead {
    margin-inline: 0;
  }

  .hero__actions {
    justify-content: flex-start;
  }

  .stats {
    margin-inline: 0;
  }

  .hero__visual {
    grid-column: span 5;
  }
}

/* Skills ------------------------------------------------------------------- */

.skill-group__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.skill-group__title {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: var(--heading);
}

/* About -------------------------------------------------------------------- */

.about-card .icon-box {
  margin-bottom: 1.5rem;
}

.about-card .card__title {
  margin-bottom: 0.75rem;
}

/* Portfolio ---------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  transition: all 0.15s var(--ease);
}

.filter-btn:hover {
  border-color: #6366f1;
}

.filter-btn.is-active {
  background: var(--indigo-600);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 6px -1px rgb(79 70 229 / 0.2), 0 2px 4px -2px rgb(79 70 229 / 0.2);
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease);
}

.project-card[hidden] {
  display: none;
}

.project-card:hover {
  box-shadow: var(--shadow-xl);
}

.project-card__media {
  position: relative;
  height: 13rem;
  overflow: hidden;
  background: var(--chip-bg);
}

.project-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.project-card:hover .project-card__img {
  transform: scale(1.05);
}

.project-card__tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: rgb(15 23 42 / 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
}

.project-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
}

.project-card__title {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: var(--heading);
}

.project-card__desc {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted);
}

.project-card .chips {
  margin-bottom: 1.5rem;
}

.project-card__links {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s var(--ease);
}

.link i {
  font-size: 0.75rem;
}

.link:hover {
  color: var(--heading);
}

.link--accent {
  color: var(--accent);
}

.link--accent:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Experience timeline ------------------------------------------------------ */

.timeline {
  position: relative;
  margin-left: 1rem;
  border-left: 1px solid var(--border);
}

.timeline > * + * {
  margin-top: 3rem;
}

.timeline__item {
  position: relative;
  padding-left: 2rem;
}

.timeline__marker {
  position: absolute;
  top: 0.375rem;
  left: -17px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: var(--marker-bg);
  color: var(--marker-text);
  font-size: 0.75rem;
  line-height: 1rem;
}

.timeline__marker--current {
  background: var(--indigo-600);
  color: #fff;
  box-shadow: 0 10px 15px -3px rgb(79 70 229 / 0.3), 0 4px 6px -4px rgb(79 70 229 / 0.3);
}

.timeline__date {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.timeline__date--side {
  display: none;
  position: absolute;
  top: 0.375rem;
  left: -8rem;
  width: 6rem;
  text-align: right;
  color: var(--faint);
}

.timeline__date--inline {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.timeline__company {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--accent);
}

.timeline__summary {
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .timeline {
    margin-left: 8rem;
  }

  .timeline__item {
    padding-left: 3rem;
  }

  .timeline__date--side {
    display: block;
  }

  .timeline__date--inline {
    display: none;
  }
}

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

.contact__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

.contact__info > * + * {
  margin-top: 1.5rem;
}

.contact__intro > * + * {
  margin-top: 0.75rem;
}

.contact__intro p:last-child {
  line-height: 1.625;
  color: var(--muted);
}

.contact__list {
  padding-top: 1rem;
}

.contact__list > * + * {
  margin-top: 1rem;
}

.contact__item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact__label {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--subtle);
}

.contact__value {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  color: var(--heading);
}

.socials {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
}

.socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--chip-text);
  transition: border-color 0.15s var(--ease);
}

.socials a:hover {
  border-color: #6366f1;
}

.contact-form {
  padding: 2rem;
}

.contact-form__fields > * + * {
  margin-top: 1.5rem;
}

.contact-form__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.contact-form .btn--primary {
  padding: 1rem;
  box-shadow: 0 10px 15px -3px rgb(79 70 229 / 0.25), 0 4px 6px -4px rgb(79 70 229 / 0.25);
}

.contact-form__success {
  padding-top: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--success);
}

.contact-form__success[hidden] {
  display: none;
}

@media (min-width: 640px) {
  .contact-form {
    padding: 2.5rem;
  }

  .contact-form__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .contact__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .contact__info {
    grid-column: span 5;
  }

  .contact-form {
    grid-column: span 7;
  }
}

/* Footer ------------------------------------------------------------------- */

.site-footer {
  padding-block: 3rem;
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  transition: background-color 0.3s, border-color 0.3s;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--heading);
}

.site-footer__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  background: var(--indigo-600);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.site-footer__copy,
.site-footer__links {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--subtle);
}

.site-footer__links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-footer__links a {
  transition: color 0.15s var(--ease);
}

.site-footer__links a:hover {
  color: var(--indigo-600);
}

@media (min-width: 640px) {
  .site-footer__inner {
    flex-direction: row;
  }
}
