:root {
  --black-primary: #1c1c1c;
  --black-second: #252525;
  --black-01: #313131;
  --black-02: #474747;
  --yellow: #efc576;
  --gray-01: #a6a6a6;
  --gray-03: #d3d3d3;
  --gray-300: #d1d5dc;
  --gray-400: #99a1af;
  --gradient-black: linear-gradient(315deg, #252525, #323131);
  --shadow-deep:
    0 54px 55px rgba(0, 0, 0, 0.25),
    0 -12px 30px rgba(0, 0, 0, 0.12),
    0 4px 6px rgba(0, 0, 0, 0.12),
    0 12px 13px rgba(0, 0, 0, 0.17),
    0 -3px 5px rgba(0, 0, 0, 0.09);
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: "Roboto Slab", Georgia, serif;
  --font-accent: Poppins, var(--font-body);
}

/* ---------- Base ---------- */

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

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--black-primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

h1,
h2,
h3,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Star background ---------- */

.stars {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

/* Each layer is a single dot; main.js paints the stars as its box-shadow. */
.stars__layer {
  position: absolute;
  top: 0;
  left: 0;
  animation: star-drift linear infinite;
}

/* Second copy one field-height below, so the loop has no visible seam. */
.stars__layer::after {
  content: "";
  position: absolute;
  top: 2000px;
  left: 0;
  width: inherit;
  height: inherit;
  box-shadow: inherit;
}

.stars__layer--sm {
  width: 1px;
  height: 1px;
  animation-duration: 50s;
}

.stars__layer--md {
  width: 2px;
  height: 2px;
  animation-duration: 100s;
}

.stars__layer--lg {
  width: 3px;
  height: 3px;
  animation-duration: 150s;
}

@keyframes star-drift {
  to {
    transform: translateY(-2000px);
  }
}

/* ---------- Layout ---------- */

.page {
  padding: 24px;
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
}

.panel {
  background: var(--black-second);
  border-radius: 16px;
}

.content {
  width: 100%;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

/* ---------- Profile ---------- */

.profile {
  padding: 32px 12px;
}

.profile__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.profile__avatar {
  width: 192px;
  height: 192px;
  border-radius: 16px;
  background: var(--black-02);
  box-shadow: var(--shadow-deep);
  object-fit: cover;
}

.profile__name {
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
}

.profile__role {
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--black-01);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35);
  color: var(--gray-03);
  font-size: 14px;
  line-height: 20px;
}

.profile__divider {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--gray-300);
}

.social {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.social__link {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 266px;
  padding: 3px;
  border-radius: 6px;
}

.social__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  background: var(--gradient-black);
  color: var(--yellow);
}

.social__icon .icon {
  transition: transform 0.15s ease-out;
}

.social__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.social__label {
  color: var(--gray-400);
}

.social__value {
  overflow-wrap: anywhere;
}

.social__link:hover {
  background: var(--yellow);
}

.social__link:hover .icon {
  transform: scale(1.1) rotate(20deg);
}

.social__link:hover .social__label {
  color: #616161;
  font-weight: 600;
}

.social__link:hover .social__value {
  color: #434343;
  font-weight: 600;
}

/* ---------- Navigation ---------- */

.mobile-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
}

.mobile-nav__link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--gradient-black);
}

.mobile-nav__link:hover,
.mobile-nav__link.is-active {
  background: var(--yellow);
  color: var(--black-second);
}

.tabs {
  display: none;
  justify-content: center;
  gap: 12px;
  width: max-content;
  height: 62px;
  margin-left: auto;
  border-radius: 0 16px;
  background: var(--black-01);
}

.tabs__link {
  margin: 18px 20px;
  border-bottom: 2px solid transparent;
}

.tabs__link:hover {
  color: var(--yellow);
  filter: drop-shadow(0 0 0.75rem var(--yellow));
}

.tabs__link.is-active {
  border-bottom-color: currentColor;
  color: var(--yellow);
}

/* ---------- Views (tab pages) ---------- */

.view {
  padding: 24px;
  animation: view-in 0.3s ease-out;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.view__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.title {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 400;
  line-height: 36px;
}

.title-bar {
  display: block;
  width: 85px;
  height: 6px;
  margin: 16px 0;
  border-radius: 2px;
  background: var(--yellow);
}

.subtitle {
  margin: 24px 0 16px;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 400;
}

.lead {
  color: var(--gray-300);
}

.lead + .lead {
  margin-top: 12px;
}

/* ---------- About: services ---------- */

.services {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.service-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: #242424;
  box-shadow: var(--shadow-deep);
  transition: transform 0.25s, border-color 0.25s;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(239, 197, 118, 0.29), rgba(115, 74, 88, 0.1) 15%, #292929 20%, #292929);
  opacity: 0;
  transition: opacity 0.25s;
}

.service-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.service-card:hover::before {
  opacity: 1;
}

.service-card__icon {
  width: 50px;
  height: 50px;
  color: var(--yellow);
  stroke-width: 1.5;
}

.service-card__title {
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

.service-card__text {
  color: var(--gray-01);
  line-height: 32px;
}

/* ---------- About: skills marquee ---------- */

.skills {
  display: flex;
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.skills__group {
  display: flex;
  flex: none;
  gap: 20px;
  padding-right: 20px;
  animation: skills-scroll 30s linear infinite;
}

.skills:hover .skills__group {
  animation-play-state: paused;
}

.skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 110px;
  color: var(--gray-01);
  font-size: 14px;
  white-space: nowrap;
}

.skill:hover {
  color: var(--yellow);
}

.skill__logo {
  width: 72px;
  height: 72px;
}

@keyframes skills-scroll {
  to {
    transform: translateX(-100%);
  }
}

/* ---------- Resume ---------- */

.btn-download {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 45px;
  padding: 14px;
  border-radius: 8px;
  background: var(--gradient-black);
  font-weight: 500;
  white-space: nowrap;
}

.btn-download .icon {
  color: var(--yellow);
}

.btn-download:hover {
  background: var(--yellow);
  color: var(--black-second);
}

.btn-download:hover .icon {
  color: inherit;
}

.btn-download__label {
  display: none;
}

.timeline-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.timeline + .timeline-head {
  margin-top: 32px;
}

.timeline-head__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  background: var(--gradient-black);
  color: var(--yellow);
}

.timeline-head__title {
  font-size: 24px;
  font-weight: 500;
}

/* The 22px offset lines the rail up with the centre of the 45px heading icon. */
.timeline {
  margin-left: 22px;
}

.timeline::before {
  content: "";
  display: block;
  height: 30px;
  border-left: 1px solid var(--black-02);
}

.timeline__item {
  position: relative;
  padding: 0 0 32px 41px;
  border-left: 1px solid var(--black-02);
}

.timeline__item:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.timeline__item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  width: 15px;
  height: 15px;
  border: 1px solid var(--black-01);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 10px rgba(172, 150, 40, 0.59);
}

.timeline__company {
  font-family: var(--font-accent);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
}

.timeline__role {
  color: var(--gray-300);
}

.timeline__time {
  color: var(--yellow);
  font-family: var(--font-accent);
  font-size: 14px;
  font-weight: 500;
  line-height: 2.5;
  text-transform: uppercase;
}

.timeline__details {
  color: var(--gray-400);
}

.timeline__details li {
  position: relative;
  padding: 0 0 6px 16px;
}

.timeline__details li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--yellow);
}

.timeline__details strong {
  color: var(--gray-300);
  font-weight: 600;
}

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

.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.project-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 7px 10px rgba(0, 0, 0, 0.5);
  font-weight: 600;
}

.project-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.4s ease-out;
}

/* For screenshots whose main content sits at the left edge. */
.project-card--align-left img {
  object-position: left;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.5s;
}

.project-card__info {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transition: opacity 0.5s;
}

.project {
  display: block;
  border-radius: 15px;
}

.project__title {
  display: block;
  margin-top: 12px;
  padding: 0 4px;
  font-size: 18px;
  font-weight: 600;
  transition: color 0.25s;
}

.project:hover .project__title,
.project:focus-visible .project__title {
  color: var(--yellow);
}

.project:hover .project-card img,
.project:focus-visible .project-card img {
  filter: blur(1px);
}

.project:hover .project-card::before,
.project:focus-visible .project-card::before,
.project:hover .project-card__info,
.project:focus-visible .project-card__info {
  opacity: 1;
}

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

.contact-form,
.contact-form__row {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.input {
  width: 100%;
  height: 48px;
  padding: 0 0.8em;
  border: 2px solid transparent;
  border-radius: 10px;
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input::placeholder {
  color: #b3b3b3;
}

.input:hover,
.input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 7px rgba(239, 197, 118, 0.2);
}

.input.is-invalid {
  border-color: #ef6b6b;
  box-shadow: 0 0 0 7px rgba(239, 107, 107, 0.2);
}

.input--area {
  display: block;
  height: 270px;
  padding: 0.8em;
  resize: vertical;
}

.btn-send {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100px;
  height: 40px;
  margin-left: auto;
  border: 0;
  border-radius: 10px;
  background: var(--black-01);
  color: var(--yellow);
  font: inherit;
  cursor: pointer;
}

.btn-send:hover {
  background: var(--yellow);
  color: var(--black-second);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
  color: #363636;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -150%);
  transition: transform 0.3s, opacity 0.3s;
}

.toast::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #61d345;
}

.toast--error::before {
  background: #ff4b4b;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Breakpoints ---------- */

@media (min-width: 380px) {
  .btn-download__label {
    display: inline;
  }
}

@media (min-width: 640px) {
  .page {
    padding: 64px;
  }

  .profile {
    padding: 40px;
  }

  .mobile-nav {
    display: none;
  }

  .tabs {
    display: flex;
  }

  .service-card {
    flex-direction: row;
    align-items: flex-start;
  }
}

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

  .contact-form__row {
    flex-direction: row;
  }
}

@media (min-width: 1280px) {
  .layout {
    flex-direction: row;
    justify-content: center;
  }

  .profile {
    flex: none;
    align-self: flex-start;
    width: 346px;
  }

  .services {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1536px) {
  .layout {
    max-width: 1536px;
  }

  .projects {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stars__layer,
  .skills__group,
  .view {
    animation: none;
  }

  .skills {
    overflow-x: auto;
  }

  .skills__group[aria-hidden="true"] {
    display: none;
  }
}
