/* =====================================================================
   main.css — Base, layout & core sections
   Structure: tokens.css (variables) → reset.css (normalize) → this file.
   Section components live in components.css; responsive rules in media.css.
   ===================================================================== */

@import "./tokens.css";
@import "./reset.css";

/* Common styles */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  color: var(--main-text-color);
  font-family: var(--font-body);
  letter-spacing: -0.1px;
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.container {
  padding: 0 32px;
  max-width: 1200px;
  /* max-width: clamp(54.5rem, 38.125rem + 81.88vw, 120rem); */
  margin: 0 auto;
}

.container-lg {
  max-width: 1600px;
}

.title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.6rem + 2vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: center;
  margin-bottom: 54px;
  position: relative;
  padding-bottom: 20px;
}

/* Refined accent tick beneath centered section titles */
.title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 54px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--pine), var(--h2));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 0 30px;
  margin: 0 12px 16px 0;
  color: var(--white-color);
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 8px;
  background-color: var(--pine);
  border: 1.5px solid var(--pine);
  box-shadow: 0 6px 18px rgba(12, 61, 46, 0.18);
  transition: transform 0.25s ease, background-color 0.25s ease,
    border-color 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover,
.btn:focus {
  background-color: var(--h2);
  border-color: var(--h2);
  color: var(--white-color);
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(14, 157, 118, 0.32);
  outline: 0;
}

.btn:active {
  transform: translateY(-1px);
  background-color: var(--pine);
}

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

.btn-white {
  background: transparent;
  font-weight: 700;
  border: 2px solid var(--primary-accent);
  color: var(--primary-accent);
  transition: all 0.3s ease-in;
}

.btn-white:hover,
.btn-white:focus {
  background: var(--primary-accent);
  border: 2px solid var(--primary-accent);
  color: var(--white-color);
}

.btn-white:active {
  background-color: #3c4446;
}

.btn-red {
  background: var(--secondary-accent);
  border: 2px solid var(--secondary-accent);
  color: var(--white-color);
  transition: all 0.3s ease-in;
}

.btn-red:hover,
.btn-red:focus {
  background: var(--primary-accent);
  border: 2px solid var(--primary-accent);
}

.btn-red:active {
  background-color: #3c4446;
}

h5 {
  font-size: 15px;
  letter-spacing: 2px;
  line-height: 23px;
  font-weight: 600;
  text-transform: uppercase;
}

.white {
  color: var(--white-color);
}

/* Header */
.header {
  z-index: 100;
  background-color: transparent;
  height: 90px;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 25px;
  height: 90px;
}

.header-sticky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1999;
  background-color: rgba(255, 255, 255, 0.95);
  padding-top: 0;
  padding-bottom: 0;
  transition: all 0.3s ease-in-out;
}

.logo {
  position: relative;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: clamp(1.125rem, 1.011rem + 0.57vw, 1.375rem);
  color: var(--ink);
}

.nav-list {
  display: flex;
  column-gap: 40px;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0;
}

.nav-link {
  position: relative;
  transition: color 0.2s ease;
}

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

.nav-btn {
  display: none;
}

.nav-link {
  color: var(--main-text-color);
}

.nav-link.active {
  text-decoration: underline;
  text-decoration-color: var(--secondary-accent);
  text-decoration-thickness: 1.2px;
  text-underline-offset: 7px;
}

/* Hero section */
.hero {
  position: relative;
  padding-top: 180px;
  background-color: var(--primary-bg-color);
}

.hero-row {
  display: flex;
  flex-wrap: wrap;
}

.hero-content {
  text-align: left;
  align-self: center;
  padding: 20px;
  flex-grow: 1;
}

.hero-greeting {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 0.72rem + 0.3vw, 0.95rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--h2);
}

.hero-greeting::before {
  content: "H₂";
  font-weight: 600;
  color: var(--pine);
  background: var(--h2-soft);
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0;
}

.hero-heading {
  margin: 14px 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: clamp(3rem, 2.5rem + 2.5vw, 4.75rem);
  line-height: 1.08;
  color: var(--ink);
}

.hero-heading-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.2rem);
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.hero-img {
  display: flex;
  flex: 1 1 356px;
  justify-content: flex-end;
  margin-top: auto;
}

.hero-img img {
  display: block;
  position: relative;
}

.about-social-list {
  display: flex;
}

.social-links-row {
  display: flex;
  justify-content: center;
  align-items: center;
  column-gap: 20px;
  margin: 40px 0 40px;
  height: 24px;

  img {
    height: 24px;
    width: 24px;
  }
}

.social-links-row a {
  filter: invert(35%) sepia(11%) saturate(160%) hue-rotate(145deg)
    brightness(88%) contrast(80%);
  transition: all 0.3s ease-in-out;
}

.social-links-row a:hover {
  filter: invert(0%) sepia(0%) saturate(7500%) hue-rotate(305deg)
    brightness(97%) contrast(103%);
}

/* About section */
.about {
  padding: 7rem 0;
}

.about-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  justify-content: center;
  gap: 90px;
  margin-bottom: 80px;
  color: var(--supportive-text-color);
}

.about-descr {
  font-size: clamp(1rem, 0.964rem + 0.18vw, 1.125rem);
  line-height: 1.7;
  font-weight: 400;
  margin-bottom: 10px;
}

.skill {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 30px;
}

.skill-title,
.skill-percent {
  display: inline-block;
  font-size: 16px;
  font-weight: 400;
  /* text-transform: uppercase; */
  letter-spacing: 0px;
}

.skill-percent {
  float: right;
}
.skill-bar__progress {
  background-color: var(--gray-color);
  border-radius: 5px;
  height: 4px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.skill-bar__fill {
  background-color: var(--secondary-accent);
  height: 4px;
  width: 0; /* Initial width is 0 */
  transition: width 1.5s ease-in-out; /* Smooth transition for the fill */
}

.about-download-btn {
  margin-top: 40px;
}

.services-row {
  display: flex;
  flex-wrap: wrap;
  gap: 50px;
  justify-content: space-between;
}

.service-card {
  max-width: 300px;
}

.service-card-img {
  display: block;
  height: 50px;
  margin: 0 auto 20px;
  filter: invert(33%) sepia(7%) saturate(243%) hue-rotate(145deg)
    brightness(94%) contrast(81%);
}

.service-card-title {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: clamp(1.125rem, 1.089rem + 0.18vw, 1.25rem);
}

.service-card p {
  font-size: 16px;
  line-height: 1.7;
  text-align: center;
}

/* Works */
.projects {
  padding: 7rem 0;
  background-color: var(--primary-bg-color);
}

.projects-title {
  text-align: center;
}

.projects-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.project-box {
  position: relative;
  overflow: hidden;
  display: block;
  max-width: 510px;
}

.project-box a {
  display: inline-block;
}

.project-box:hover .project-mask {
  opacity: 1;
  visibility: visible;
}

.project-box:hover .project-mask .project-caption {
  bottom: 30px;
  opacity: 1;
}

.project-box:hover .project-img {
  transform: scale(1.1);
  transition: all 2s cubic-bezier(0.23, 1, 0.32, 1) 0s;
  width: 100%;
}

.project-img {
  transform: scale(1);
  width: 100%;
  transition: all 2s cubic-bezier(0.23, 1, 0.32, 1) 0s;
}

.project-mask {
  background: none repeat scroll 0 0 rgba(0, 0, 0, 0.7);
  height: 100%;
  position: absolute;
  transition: all 0.5s ease-in-out 0s;
  width: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
}

.project-mask p {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 400;
  margin-top: 0;
  text-align: left;
}

.project-mask .project-caption {
  position: absolute;
  bottom: -60px;
  left: 0;
  padding-left: 30px;
  padding-right: 30px;
  text-align: left;
  transition: all 0.5s ease-in-out 0s;
  opacity: 0;
}

/* Contact */
.contact {
  padding: 7rem 0;
  text-align: center;
}

.contact-content {
  font-size: clamp(1rem, 0.964rem + 0.18vw, 1.125rem);
  color: var(--supportive-text-color);
  margin: 0 auto 20px;
}

.contact form {
  max-width: 500px;
  margin: 20px auto;
  text-align: center;
}

.contact form .input-box {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.contact form .input-box input,
.contact form textarea {
  width: 100%;
  padding: 15px;
  font-size: 15px;
  color: var(--gray-text-color);
  border: 1px solid var(--gray-color-2);
  margin: 7px 0;
}

.contact form .input-box input {
  width: 100%;
}

.contact form textarea {
  resize: none;
}

.contact-button {
  margin-top: 20px;
}

/* Footer */
.footer {
  background-color: var(--primary-accent);
  color: var(--gray-color-3);
}

.footer-row {
  display: flex;
  flex-direction: column;
  column-gap: 20px;
  align-items: center;
  padding: 40px 0;
}

.footer-social {
  margin-top: 0;
}

.footer-social a:hover {
  filter: invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg)
    brightness(102%) contrast(102%);
}

.footer-copyright {
  font-size: clamp(0.75rem, 0.679rem + 0.36vw, 1rem);
}

.response {
  position: fixed;
  display: inline-block;
  background-color: var(--primary-accent);
  color: var(--white-color);
  border: 1px solid var(--white-color);
  min-width: 280px;
  padding: 20px 40px;
  bottom: -100px;
  left: 50%;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  transition: all 0.3s ease-in-out;
  z-index: 5;
}

.response.open {
  bottom: 20px;
  opacity: 1;
  visibility: visible;
}

/* "go to top" button */
.goToTop {
  z-index: 599;
  position: fixed;
  width: 40px;
  height: 40px;
  background-color: var(--gray-color);
  top: auto;
  left: auto;
  right: 30px;
  bottom: 30px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  border-radius: 2px;
  transition: opacity 350ms, visibility 350ms;
}

.goToTop a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  filter: invert(4%) sepia(23%) saturate(2306%) hue-rotate(148deg)
    brightness(91%) contrast(90%);
}

.goToTop img {
  height: 16px;
  width: 16px;
}

.goToTop:hover {
  filter: invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg)
    brightness(102%) contrast(102%);
}

.goToTop.reveal {
  display: block;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s;
}

/* Preloader with jumping dots */
#preloader {
  position: fixed;
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-items: center;
  background: var(--color-preloader-bg);
  z-index: 3000;
  height: 100vh;
  width: 100vw;
  opacity: 1;
  overflow: hidden;
  transition: opacity 0.5s ease-out;
}

.jumping-dots {
  position: relative;
  width: 6px;
  height: 6px;
  padding: 0;
  display: inline-block;
}

.jumping-dots > div {
  position: absolute;
  content: "";
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--color-dots);
  border-radius: 50%;
}

.jumping-dots > div:nth-of-type(1) {
  left: 20px;
}

.jumping-dots > div:nth-of-type(3) {
  left: -20px;
}

.jumping-dots > div {
  animation: jumping-dots 1.2s infinite ease;
  animation-delay: 0.2s;
}

.jumping-dots > div:nth-of-type(1) {
  animation-delay: 0.4s;
}

.jumping-dots > div:nth-of-type(3) {
  animation-delay: 0s;
}

@keyframes jumping-dots {
  0% {
    top: 0;
  }

  40% {
    top: -6px;
  }

  80% {
    top: 0;
  }
}
/* --- Hero portrait + orbit signature --- */
.hero-img {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img img {
    position: relative;
    z-index: 2;
    width: 300px !important;
    height: 300px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
    border: 4px solid var(--paper);
    box-shadow: 0 18px 50px rgba(12, 61, 46, 0.22);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

/* Dual orbit ring — two atoms of H₂ / an electron orbit around the portrait */
.hero-img::before,
.hero-img::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

/* Outer ring: dashed pine, slow clockwise rotation */
.hero-img::before {
    width: 372px;
    height: 372px;
    border: 1.5px dashed rgba(12, 61, 46, 0.35);
    animation: orbit-spin 26s linear infinite;
}

/* Inner ring: solid hydrogen-emerald with a single glowing electron dot */
.hero-img::after {
    width: 328px;
    height: 328px;
    border: 2px solid transparent;
    border-top-color: var(--h2);
    border-right-color: var(--h2);
    box-shadow: 0 0 0 6px rgba(14, 157, 118, 0.06);
    animation: orbit-spin 9s linear infinite reverse;
}

@keyframes orbit-spin {
    to { transform: rotate(360deg); }
}

.hero-img img:hover {
    transform: scale(1.03);
    box-shadow: 0 22px 60px rgba(14, 157, 118, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .hero-img::before,
    .hero-img::after {
        animation: none;
    }
}

/* Keep the portrait + orbit comfortably inside small screens */
@media (max-width: 480px) {
    .hero-img img {
        width: 240px !important;
        height: 240px !important;
    }
    .hero-img::before { width: 300px; height: 300px; }
    .hero-img::after { width: 266px; height: 266px; }
}