﻿@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

:root {
  --header-height: 3rem;

  --font-semi: 600;

  --hue: 224;
  --color-primary: hsl(var(--hue), 89%, 60%);
  --color-primary-alt: hsl(var(--hue), 89%, 46%);
  --color-text: hsl(var(--hue), 56%, 12%);
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-input: #ffffff;
  --color-border: hsl(var(--hue), 56%, 12%);
  --color-muted: hsl(var(--hue), 20%, 40%);
  --font-family: "Poppins", system-ui, -apple-system, sans-serif;
  --fs-hero: clamp(2rem, 1.4rem + 3vw, 3.5rem);
  --fs-h2: clamp(1.25rem, 1.05rem + 1vw, 2rem);
  --fs-h3: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem);
  --fs-body: clamp(0.938rem, 0.9rem + 0.2vw, 1rem);
  --fs-small: clamp(0.75rem, 0.72rem + 0.15vw, 0.875rem);

  --sp-2: 1rem;
  --sp-4: 2rem;
  --sp-5: 2.5rem;
  --sp-6: 3rem;

  --z-behind: -10;
  --z-fixed: 100;

  --transition-fast: 0.3s ease;
  --transition-mid: 0.4s ease;

  --radius: 0.5rem;

  --focus-ring: 0 0 0 3px hsl(var(--hue), 89%, 60%, 0.45);
}

body.dark-mode {
  --color-text: #e0e0e0;
  --color-surface: #1a1a1a;
  --color-bg: #121212;
  --color-input: #2a2a2a;
  --color-border: #3a3a3a;
  --color-muted: #b0b3b8;
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-family);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: var(--header-height) 0 0 0;
  font-family: var(--font-family);
  font-size: var(--fs-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
a {
  text-decoration: none;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
button {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.section-title {
  position: relative;
  font-size: var(--fs-h2);
  color: var(--color-primary);
  margin-top: var(--sp-2);
  margin-bottom: var(--sp-4);
  text-align: center;
}
.section-title::after {
  content: "";
  position: absolute;
  width: 64px;
  height: 0.18rem;
  left: 0;
  right: 0;
  margin: auto;
  top: 2rem;
  background-color: var(--color-primary);
}

.section {
  padding-top: 3rem;
  padding-bottom: 2rem;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bd-grid {
  max-width: 1024px;
  display: grid;
  margin-left: var(--sp-2);
  margin-right: var(--sp-2);
}

.button {
  display: inline-block;
  background-color: var(--color-primary);
  color: #fff;
  padding: 0.75rem 2.5rem;
  font-weight: var(--font-semi);
  border-radius: var(--radius);
  transition: box-shadow var(--transition-fast);
  min-height: 44px;
}
.button:hover {
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.15);
}

.l-header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-fixed);
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(146, 161, 176, 0.15);
}
body.dark-mode .l-header {
  background-color: var(--color-surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: var(--font-semi);
}

.nav__logo {
  color: var(--color-text);
}
body.dark-mode .nav__logo {
  color: var(--color-text);
}

.nav__toggle {
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
  /* Touch target */
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.nav__link {
  position: relative;
  color: var(--color-text);
  padding: 0.4rem 0;
  display: inline-block;
}
body.dark-mode .nav__link {
  color: var(--color-text);
}
.nav__link:hover::after,
.active-link::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 0.18rem;
  left: 0;
  top: 2rem;
  background-color: var(--color-primary);
}

.dark__mode {
  color: var(--color-text);
  font-size: 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
  min-width: 44px;
  min-height: 44px;
}
.dark__mode:hover {
  color: var(--color-primary);
}
body.dark-mode .dark__mode {
  color: var(--color-primary);
}

@media screen and (max-width: 900px) {
  .nav__toggle {
    display: flex;
  }

  .nav__menu {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 40%;
    max-width: 280px;
    height: 100%;
    padding: 2rem 1.5rem;
    background-color: var(--color-text);
    transition: right var(--transition-mid);
    overflow-y: auto;
  }
  .nav__menu.show {
    right: 0;
  }

  .nav__list {
    display: flex;
    flex-direction: column;
  }
  .nav__item {
    margin-bottom: var(--sp-4);
  }

  .nav__item.dark-mode-item {
    order: -1;
    margin-bottom: var(--sp-2);
  }

  .nav__link {
    display: block;
    color: #fff;
    font-size: 1rem;
    padding: 0.5rem 0;
  }
  .nav__link:hover::after,
  .active-link::after {
    top: 1.9rem;
  }

  .nav__menu .dark__mode {
    color: #fff;
  }
  .nav__menu .dark__mode:hover {
    color: #ccc;
  }
}

@media screen and (min-width: 901px) {
  body {
    margin: 0;
  }
  .nav {
    height: calc(var(--header-height) + 1.5rem);
  }
  .nav__list {
    display: flex;
    align-items: center;
  }
  .nav__item {
    margin-left: var(--sp-6);
    margin-bottom: 0;
  }
  .nav__toggle {
    display: none;
  }
  .dark__mode {
    margin-left: 1rem;
    padding-right: 0.5rem;
  }
}

.home {
  position: relative;
  row-gap: 5rem;
  padding: 4rem 0 5rem;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.home__data {
  align-self: center;
}
.home__title {
  font-size: var(--fs-hero);
  margin-bottom: var(--sp-5);
  line-height: 1.2;

  min-height: calc(var(--fs-hero) * 1.2 * 3.3);
}
.home__title-color {
  color: var(--color-primary);
}

.home__social {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--sp-4);
}
.home__social-icon {
  width: max-content;
  margin-bottom: var(--sp-2);
  font-size: 1.5rem;
  color: var(--color-text);
  /* Touch target */
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.home__social-icon:hover {
  color: var(--color-primary);
}

.home__img {
  position: absolute;
  right: 0;
  top: 145px;
  width: 260px;
}
.home__blob {
  fill: var(--color-primary);
}
.home__img svg.home__blob {
  width: 100%;
  height: auto;
  display: block;
}
.home__blob-img {
  width: 100%;
  height: auto;
  display: block;
  transform: translateY(7px);
  transform-box: fill-box;
  transform-origin: center;
}

.hero-cursor {
  display: inline-block;
  width: 2px;
  height: 0.78em;
  margin-left: 0.15em;
  background-color: var(--color-primary);
  vertical-align: middle;
  transform: translateY(-0.05em);
}
.hero-cursor--blink {
  animation: hero-blink 0.75s step-end infinite;
}
@keyframes hero-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.about__container {
  row-gap: 2rem;
  text-align: center;
}
.about__subtitle {
  margin-bottom: var(--sp-2);
  font-size: var(--fs-h3);
}
body.dark-mode .about__subtitle {
  color: #f1f3f4;
}
.about__img {
  justify-self: center;
}
.about__img img {
  width: 200px;
  border-radius: var(--radius);
  transform: translateY(-10px);
}
body.dark-mode .about__img img {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.about__text {
  line-height: 1.6;
}
body.dark-mode .about__text {
  color: var(--color-muted);
}

.skills__container {
  row-gap: 2rem;
  text-align: center;
}
.skills__subtitle {
  margin-bottom: var(--sp-2);
  font-size: var(--fs-h3);
}
body.dark-mode .skills__subtitle {
  color: #f1f3f4;
}
.skills__text {
  margin-bottom: var(--sp-4);
  line-height: 1.6;
}
body.dark-mode .skills__text {
  color: var(--color-muted);
}

.skills__list {
  text-align: left;
}

.skills__data {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  font-weight: var(--font-semi);
  padding: 0.5rem 1rem;
  margin-bottom: var(--sp-4);
  border-radius: var(--radius);
  background-color: var(--color-surface);
  box-shadow: 0 4px 25px rgba(14, 36, 49, 0.15);
}
body.dark-mode .skills__data {
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
}
.skills__names {
  display: flex;
  align-items: center;
}
.skills__icon {
  font-size: 2rem;
  margin-right: var(--sp-2);
  color: var(--color-primary);
}
.skills__names img.skills__icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  margin-right: var(--sp-2);
}
.skills__icon--ts {
  width: 2rem;
  height: 2rem;
}

.skills__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  background-color: var(--color-primary);
  height: 0.25rem;
  border-radius: var(--radius);
  z-index: 0;
}

.skills__html {
  width: 95%;
}
.skills__css {
  width: 85%;
}
.skills__js {
  width: 65%;
}
.skills__ts {
  width: 75%;
}
.skills__ux {
  width: 85%;
}
.skills__git {
  width: 80%;
}
.skills__github {
  width: 80%;
}
.skills__mysql {
  width: 70%;
}
.skills__networking {
  width: 60%;
}
.skills__react {
  width: 70%;
}
.skills__tailwind {
  width: 80%;
}

.skills__img {
  border-radius: var(--radius);
  width: 100%;
}

.projects__container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.project__item {
  padding: 1.5rem;
  box-shadow: 0 4px 25px rgba(14, 36, 49, 0.15);
  border-radius: var(--radius);
  background-color: #fff;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}
body.dark-mode .project__item {
  background-color: var(--color-surface);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
}
.project__item:hover {
  box-shadow: 0 8px 35px rgba(14, 36, 49, 0.25);
  transform: translateY(-5px);
}
body.dark-mode .project__item:hover {
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.7);
}
.project__title {
  font-size: 1.1rem;
  font-weight: var(--font-semi);
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}
.project__description {
  line-height: 1.6;
}
body.dark-mode .project__description {
  color: var(--color-muted);
}

.projects__github-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 0.75rem;
  border: 2px dashed var(--color-primary);
}
body.dark-mode .projects__github-card {
  border-color: var(--color-primary);
}
.projects__github-icon {
  font-size: 2.5rem;
  color: var(--color-primary);
  line-height: 1;
}
.projects__github-btn {
  margin-top: 0.5rem;
  padding: 0.5rem 1.5rem;
  font-size: var(--fs-small);
}

.contact__field {
  margin-bottom: 0;
}
.contact__input {
  width: 100%;
  font-size: var(--fs-body);
  font-weight: var(--font-semi);
  font-family: inherit;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--color-text);
  outline: none;
  margin-bottom: var(--sp-4);
  background-color: var(--color-input);
  color: var(--color-text);
}
body.dark-mode .contact__input {
  border-color: var(--color-border);
}
.contact__input::placeholder {
  color: var(--color-muted);
  opacity: 0.7;
}

.contact__button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  outline: none;
  font-size: var(--fs-body);
  cursor: pointer;
  margin-left: auto;
  transition:
    box-shadow var(--transition-fast),
    transform 0.2s ease;
  min-height: 44px;
}
.contact__button:hover {
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}
.contact__btn-icon {
  font-size: 1.1rem;
}

.contact__notice {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-small);
  color: var(--color-text);
  opacity: 0.7;
  margin-bottom: var(--sp-2);
}
.contact__notice i {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.contact__error {
  color: #c0392b;
  font-size: var(--fs-small);
  margin-bottom: var(--sp-2);
  min-height: 1.2em;
  font-weight: var(--font-semi);
}
.contact__success {
  color: var(--color-primary-alt);
  font-size: var(--fs-small);
  margin-bottom: var(--sp-2);
  min-height: 1.2em;
  font-weight: var(--font-semi);
}
body.dark-mode .contact__form {
  background-color: var(--color-surface);
}

.footer {
  background-color: var(--color-text);
  color: #fff;
  text-align: center;
  font-weight: var(--font-semi);
  padding: 2rem 0;
}
body.dark-mode .footer {
  background-color: #0a0a0a;
}
.footer__title {
  font-size: 2rem;
  margin-bottom: var(--sp-4);
}
.footer__social {
  margin-bottom: var(--sp-4);
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
}
.footer__icon {
  font-size: 1.5rem;
  color: #fff;
  margin: 0 var(--sp-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}
.footer__copy {
  font-size: var(--fs-small);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode .section-title,
body.dark-mode .home__title {
  color: #f1f3f4;
}

@media screen and (max-width: 900px) {
  .home {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 5rem 1rem 3rem;
  }

  .home__img {
    order: 1;
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: min(85vw, 340px);
    margin: 0 auto;
    z-index: 1;
  }
  .home__blob-img {
    width: 100%;
    transform: translateY(7px);
  }

  .home__data {
    order: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .home__title {
    margin-bottom: var(--sp-4);
  }

  .home__social {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: var(--sp-4);
  }
  .home__social-icon {
    margin-bottom: 0;
  }

  .about__container,
  .skills__container {
    row-gap: 2rem;
    text-align: center;
  }

  .section {
    padding-top: 3rem;
    padding-bottom: 2rem;
  }

  .projects__container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact__button {
    margin-left: auto;
    margin-right: auto;
  }

  .contact__form {
    width: 100%;
    max-width: 420px;
    padding-top: 2rem;
  }
  .contact__container {
    justify-items: center;
  }
}

@media screen and (min-width: 901px) {
  .section {
    padding-top: 4rem;
    padding-bottom: 3rem;
  }
  .section-title {
    margin-bottom: var(--sp-6);
  }
  .section-title::after {
    width: 80px;
    top: 3rem;
  }

  .home {
    padding: 8rem 0 2rem;
    display: grid;
    grid-template-columns: 1fr;
  }
  .home__img {
    width: 400px;
    bottom: 0;
  }
  .home__blob-img {
    transform: translateY(7px);
  }
  .skills__icon--ts {
    width: 2.5rem;
    height: 2.5rem;
  }

  .home__social {
    flex-direction: row;
    gap: 1.25rem;
    margin-bottom: var(--sp-4);
  }
  .home__social-icon {
    margin-bottom: 0;
  }

  .about__container {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    text-align: initial;
    padding-top: 2rem;
  }
  .about__img img {
    width: 300px;
  }

  .skills__container {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
    align-items: center;
    text-align: initial;
  }
  .projects__container {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
  }

  .contact__form {
    width: 460px;
    padding-top: 2rem;
  }
  .contact__container {
    justify-items: center;
  }
}

@media screen and (min-width: 1024px) {
  .bd-grid {
    margin-left: auto;
    margin-right: auto;
  }
  .home {
    padding: 10rem 0 2rem;
  }
  .home__img {
    width: 450px;
  }
  .projects__container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (min-width: 1440px) {
  .bd-grid {
    max-width: 1200px;
  }
  .home__img {
    width: 480px;
  }
}
