* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 2rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid white;
  padding: 0.5rem;
  font-family: monospace;
  border-radius: 0.5rem;
  background-color: black;
  color: white;
  cursor: pointer;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;

  a {
    text-decoration: none !important;
  }
}

.btn:hover {
  border-color: #ffd000;
  background-color: #131313;
}

.btn:focus-visible {
  outline: none;
  border-color: #ffd000;
  box-shadow: 0 0 0 2px rgba(255, 208, 0, 0.35);
}

.btn.btn-disabled,
.btn:disabled,
.btn[aria-disabled="true"] {
  border-color: rgba(255, 255, 255, 0.28);
  background-color: #111;
  color: rgba(255, 255, 255, 0.42);
  cursor: not-allowed;
  opacity: 0.7;
  pointer-events: none;
}

body {
  font-family: Arial, sans-serif;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

[data-i18n] {
  transition: opacity 0.16s ease;
}

.i18n-text-leave {
  opacity: 0;
}

.i18n-text-enter {
  opacity: 0;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  height: 100vh;
  background: #000;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  padding: 30px 20px;
  position: fixed;
  left: 0;
  top: 0;
}

.cta-wrapper {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

.CTA {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 1;
  width: auto;
  background: #ffd000;
  color: #000;
  font-weight: bold;
  margin-bottom: 40px;
  border-radius: 0.5rem;
  box-shadow: 0 9px 35px rgba(255, 255, 255, 0.25);
  border: 0;
  padding: 0.7rem 0.65rem;
  cursor: pointer;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 0;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;

  img {
    width: 1.6rem;
    transition: transform 0.2s ease;
  }
}

a.CTA[href="#contact"] img {
  transform-origin: 50% 80%;
}

a.CTA[href="#contact"].is-bowing img {
  animation: contactCtaBow 260ms ease;
}

@keyframes contactCtaBow {
  0% {
    transform: perspective(260px) rotateX(0deg) scale(1);
  }
  45% {
    transform: perspective(260px) rotateX(24deg) scale(0.92);
  }
  100% {
    transform: perspective(260px) rotateX(0deg) scale(1);
  }
}

.CTA:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(255, 255, 255, 0.28);
  filter: brightness(0.97);
}

.CTA:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px #000,
    0 0 0 4px rgba(255, 208, 0, 0.65);
}

.lang-toggle span {
  line-height: 1;
}

.lang-toggle img {
  transform-origin: 50% 50%;
}

.lang-toggle.is-switching img {
  animation: langIconSpin 320ms ease;
}

@keyframes langIconSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(180deg);
  }
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.menu a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #aaa;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  transition: 0.2s;
  font-size: 14px;
}

.menu-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.menu a:hover {
  color: #fff;
}

.menu a:focus-visible {
  outline: none;
  color: #fff;
  border-bottom-color: #ffd000;
  box-shadow: 0 2px 0 0 #ffd000;
}

.menu a:hover .menu-icon,
.menu a.is-active .menu-icon {
  opacity: 1;
}

.menu a.is-active {
  color: #ffd000;
  border-bottom-color: #ffd000;
}

/* HERO */
.main {
  flex: 1;
  margin-left: 260px;
  width: calc(100% - 260px);
}

.hero {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 60px;
  padding-bottom: 0;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  scroll-margin-top: 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  contain: layout paint;
}

.hero-bg pre {
  margin: 0;
}

.hero-text {
  max-width: 600px;
  padding: 1.5rem;
  border-radius: 1rem;
  z-index: 1;
  font-family: monospace !important;
}

.hero-text h1 {
  font-size: 50px;
  margin-bottom: 10px;
}

.hero-text p {
  color: #aaa;
  padding: 0rem 0.5rem !important;
}

.hero-img {
  position: relative;
  bottom: 0;
  width: 50%;
  height: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;

  img {
    object-fit: contain;
    position: absolute;
    bottom: 0;
    filter: brightness(0.65);
  }
}

.hero-text,
.hero-img {
  position: relative;
  z-index: 1;
}

.hero-img img {
  max-height: 100%;
  width: 100%;
  border-radius: 10px;
}

.hero-bg .code-base_first,
.hero-bg .code-base_second,
.hero-bg .code-base_third,
.hero-bg .code-base_fourth,
.hero-bg .code-base_fifth,
.hero-bg .code-base_sixth,
.hero-bg .code-base_seventh,
.hero-bg .code-base_eighth,
.hero-bg .code-base_ninth,
.hero-bg .code-base_tenth,
.hero-bg .code-base_eleventh,
.hero-bg .code-base_twelfth {
  --typed-box-width: min(28vw, 20rem);
  --typed-box-height: 8.6rem;
  position: absolute;
  filter: brightness(0.3);
  font-family: monospace;
  width: var(--typed-box-width);
  height: var(--typed-box-height);
  overflow: hidden;
}

.hero-bg .code-base_first pre,
.hero-bg .code-base_second pre,
.hero-bg .code-base_third pre,
.hero-bg .code-base_fourth pre,
.hero-bg .code-base_fifth pre,
.hero-bg .code-base_sixth pre,
.hero-bg .code-base_seventh pre,
.hero-bg .code-base_eighth pre,
.hero-bg .code-base_ninth pre,
.hero-bg .code-base_tenth pre,
.hero-bg .code-base_eleventh pre,
.hero-bg .code-base_twelfth pre {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-bg code {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  white-space: pre;
}

.code-base_first {
  top: 4vh;
  left: 3vw;
  --typed-box-width: min(22vw, 16rem);
  --typed-box-height: 7.8rem;
}

.code-base_second {
  top: 34vh;
  left: 11vw;
  --typed-box-width: min(23vw, 17rem);
}

.code-base_fifth {
  bottom: 6vh;
  left: 26vw;
  --typed-box-width: min(21vw, 15rem);
}

.code-base_third {
  top: 2vh;
  right: 22vw;
  --typed-box-width: min(20vw, 15rem);
  --typed-box-height: 7.2rem;
}

.code-base_fourth {
  top: 27vh;
  right: 1vw;
  --typed-box-width: min(21vw, 15rem);
}

.code-base_sixth {
  bottom: 16vh;
  left: 3vw;
  --typed-box-width: min(20vw, 15rem);
}

.code-base_seventh {
  top: 11vh;
  left: 47vw;
  --typed-box-width: min(19vw, 14rem);
  --typed-box-height: 7.2rem;
}

.code-base_eighth {
  top: 51vh;
  right: 30vw;
  --typed-box-width: min(19vw, 14rem);
  --typed-box-height: 6.8rem;
}

.code-base_ninth {
  bottom: 7vh;
  right: 13vw;
  --typed-box-width: min(20vw, 15rem);
  --typed-box-height: 7.2rem;
}

.code-base_tenth {
  top: 58vh;
  left: 42vw;
  --typed-box-width: min(18vw, 13rem);
  --typed-box-height: 6.6rem;
}

.code-base_eleventh {
  top: 18vh;
  left: 19vw;
  --typed-box-width: min(18vw, 13rem);
  --typed-box-height: 6.6rem;
}

.code-base_twelfth {
  bottom: 20vh;
  right: 42vw;
  --typed-box-width: min(17vw, 12.5rem);
  --typed-box-height: 6.3rem;
}

.section-wrapper {
  border-top: 1px solid white;
  height: 100vh;
  min-height: 100vh;
  padding: 4rem 1.5rem;
  display: flex;
  align-items: center;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  scroll-margin-top: 2rem;
}

.section-inner {
  width: min(100%, 1200px);
  margin: 0 auto;
}

.skills.section-wrapper {
  height: auto;
  min-height: 115vh;
  overflow: visible;
}

.section-title {
  font-size: 2rem;
  text-transform: uppercase;
  padding-bottom: 3rem;
  color: white;
  font-family: monospace;
  text-align: center;
}

.surface-card {
  background: #101010;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 25px rgba(0, 0, 0, 0.35);
}

/* GRID */
.skills-cards {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: 3rem;
}

/* CARD */
.skill-card {
  padding: 2rem;
  width: 550px;
  transition: 0.3s;
  font-family:
    "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

/* HOVER 🔥 */
.skill-card:hover {
  border-color: #f0f0f0;
}

/* TITLE */
.skill-card h3 {
  color: #f1f1f1;
  margin-bottom: 1rem;
  font-family: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

/* LIST */
.skill-card ul {
  list-style: none;
  padding: 0;
}

.skill-card li {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr);
  column-gap: 0.35rem;
  color: #ccc;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.skill-card li::before {
  content: ">";
  color: #d0d0d0;
  grid-column: 1;
  line-height: inherit;
}

.skill-card li:last-child {
  border-bottom: 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.project-card {
  overflow: hidden;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.project-card:hover {
  transform: scale(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 32px rgba(0, 0, 0, 0.5);
}

.project-image-wrap {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.project-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-content {
  padding: 1rem 1.2rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.project-content h3 {
  font-family:
    "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f1f1f1;
}

.contact {
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.contact.section-wrapper {
  height: auto;
  min-height: 110vh;
}

.contact-card {
  display: block;
  max-width: 800px;
  margin: 0 auto;
  padding: 1.6rem;
}

.contact-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
}

.contact-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.contact-item:hover,
.contact-item-copyable:hover {
  border-color: #f0f0f0;
}

.contact-item-copyable {
  cursor: default;
}

.contact-main-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}

.contact-main-link:focus-visible {
  outline: none;
}

.contact-main-link:focus-visible .contact-meta .contact-value {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.contact-icon {
  width: 2.5rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #3a3a3a;
  border-radius: 0.5rem;
  font-family:
    "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #d0d0d0;

  img {
    width: 1rem;
  }
}

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.contact-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8f8f8f;
}

.contact-value {
  font-size: 0.95rem;
  color: #f1f1f1;
}

.copy-icon {
  width: 1.2rem;
  height: 1.2rem;
  background-color: #9a9a9a;
  -webkit-mask-image: url("src/copy.svg");
  mask-image: url("src/copy.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 0.2s ease;
}

.copy-trigger {
  position: absolute;
  right: 0;
  top: 0.1rem;
  margin-left: auto;
  width: 1.8rem;
  height: 1.8rem;
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0.45rem;
  transition: background-color 0.2s ease;
}

.copy-trigger:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.copy-trigger:focus-visible {
  outline: none;
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(255, 208, 0, 0.45);
}

.copy-trigger.copied .copy-icon {
  background-color: #00c853;
}

.last-section-block {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  html {
    scroll-snap-type: none;
    scroll-padding-top: 0.5rem;
  }

  .hero,
  .section-wrapper,
  .last-section-block {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
    scroll-margin-top: 4rem;
  }

  .sidebar {
    position: sticky;
    top: 0;
    left: auto;
    z-index: 20;
    display: flex;
    width: 100%;
    height: auto;
    padding: 0.75rem 1rem;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: center;
    align-items: center;
  }

  .cta-wrapper {
    width: 100%;
    margin: 1rem 0rem;
  }

  .CTA {
    margin-bottom: 0;
    padding: 0;
    width: 100%;
  }

  .menu {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
  }

  .menu-icon {
    display: none;
  }

  .menu a {
    flex: 0 0 auto;
    border-bottom: 0;
    padding-bottom: 0;
  }

  .main {
    margin: 0;
    width: 100%;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    height: auto;
    min-height: 100svh;
    overflow: visible;
    padding: 0rem 1rem;
  }

  .skills {
    padding: 0rem 1rem;
  }

  .skills.section-wrapper {
    min-height: auto;
    overflow: visible;
    align-items: flex-start;
  }

  .skills-cards {
    gap: 1rem;
    padding-bottom: 1.5rem;
  }

  .skill-card {
    width: 100%;
    padding: 1.2rem;
  }

  .skill-card h3 {
    margin-bottom: 0.7rem;
    font-size: 0.78rem;
  }

  .skill-card li {
    grid-template-columns: 1rem minmax(0, 1fr);
    column-gap: 0.25rem;
    padding: 0.25rem 0;
    font-size: 0.76rem;
    letter-spacing: 0.02em;
  }

  .section-wrapper {
    height: auto;
    min-height: auto;
    padding: 3.2rem 1rem;
    align-items: flex-start;
    overflow: visible;
  }

  .section-title {
    padding-bottom: 2rem;
  }

  .hero-text {
    padding: 2.5rem 1rem 0rem 1rem;
  }

  .hero-img {
    width: 100%;
    height: auto;
    justify-content: start;
  }

  .hero-img img {
    position: relative;
    width: min(100%, 24rem);
    max-height: none;
    margin-top: auto;
  }

  .code-base_first {
    top: 1rem;
    left: -5rem;
    font-size: 0.5rem;
  }

  .hero-bg .code-base_first,
  .hero-bg .code-base_second,
  .hero-bg .code-base_third,
  .hero-bg .code-base_fourth,
  .hero-bg .code-base_fifth,
.hero-bg .code-base_sixth,
.hero-bg .code-base_seventh,
.hero-bg .code-base_eighth,
.hero-bg .code-base_ninth,
.hero-bg .code-base_tenth,
.hero-bg .code-base_eleventh,
.hero-bg .code-base_twelfth {
    --typed-box-width: min(75vw, 18rem);
    --typed-box-height: 6.5rem;
    opacity: 50%;
  }

  .code-base_second {
    top: 2rem;
    left: 7.5rem;
    font-size: 0.5rem;
  }

  .code-base_third {
    top: 8rem;
    left: -3rem;
    font-size: 0.5rem;
  }

  .code-base_fourth {
    top: 8rem;
    left: 8rem;
    font-size: 0.5rem;
  }

  .code-base_fifth {
    top: 15rem;
    left: 10rem;
    font-size: 0.5rem;
  }

  .code-base_sixth {
    top: 15rem;
    left: -4rem;
    font-size: 0.5rem;
  }

  .code-base_seventh,
  .code-base_eighth,
  .code-base_ninth,
  .code-base_tenth,
  .code-base_eleventh,
  .code-base_twelfth {
    display: none;
  }

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

  .contact {
    min-height: 80svh;
  }

  .contact-card {
    padding: 1.2rem;
  }

  .last-section-block {
    min-height: auto;
    display: flex;
    flex-direction: column;
  }

  .last-section-block .contact.section-wrapper {
    height: auto;
    min-height: 80svh;
    flex: 1;
    overflow: visible;
    align-items: flex-start;
    border-bottom: 0;
  }

  .contact-content {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .projects.section-wrapper {
    height: auto;
    min-height: auto;
    overflow: visible;
    align-items: flex-start;
  }

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

  .skill-card-blank {
    display: none;
  }
}
