/* ============================================================
   Design Tokens
   ============================================================ */
:root {
  --bg: #282c33;
  --bg-secondary: #1a1e23;
  --text-primary: #ffffff;
  --text-secondary: #abb2bf;
  --accent: #c778dd;
  --border: #abb2bf;
  --font-main: 'Fira Code', monospace;
  --container: 1024px;
  --page-width: 1366px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  font-family: var(--font-main);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

ul, ol {
  list-style: none;
}

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

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* ============================================================
   Layout
   ============================================================ */
.page-wrapper {
  max-width: var(--page-width);
  margin: 0 auto;
  position: relative;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  padding: 0 16px;
}

/* ============================================================
   Header
   ============================================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  padding-bottom: 8px;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  padding-left: 16px;
  padding-right: 16px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__logo-text {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header__nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header__link {
  font-weight: 400;
  font-size: 16px;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  position: relative;
}

.header__link-hash {
  color: var(--accent);
}

.header__link:hover {
  color: var(--text-primary);
}

.header__link--active {
  font-weight: 500;
  color: var(--text-primary);
}

.header__lang {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.header__lang:hover {
  color: var(--text-primary);
}

/* ============================================================
   Sidebar (Fixed Left)
   ============================================================ */
.sidebar {
  position: fixed;
  left: 17px;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 50;
  padding-top: 191px;
}

.sidebar__line {
  width: 2px;
  height: 191px;
  background-color: var(--border);
}

.sidebar__icons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sidebar__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.sidebar__icon svg {
  width: 32px;
  height: 32px;
  fill: var(--border);
  transition: fill 0.2s ease;
}

.sidebar__icon:hover svg {
  fill: var(--text-primary);
}

.sidebar__icon:hover {
  transform: translateY(-2px);
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
  padding-top: 62px;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.hero__content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.hero__info {
  max-width: 537px;
}

.hero__title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 42px;
  margin-bottom: 32px;
}

.hero__title-highlight {
  color: var(--accent);
}

.hero__subtitle {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 25px;
  margin-bottom: 24px;
}

.hero__btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  font-weight: 500;
  font-size: 16px;
  color: var(--text-primary);
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.hero__btn:hover {
  background-color: rgba(199, 120, 221, 0.2);
}

.hero__image {
  width: 457px;
  height: 386px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}

.about__image {
  width: 339px;
  height: 507px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}

/* ============================================================
   Quote
   ============================================================ */
.quote {
  margin-top: 76px;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
}

.quote__box {
  border: 1px solid var(--border);
  padding: 32px;
  max-width: 712px;
  margin: 0 auto;
  position: relative;
}

.quote__text {
  font-size: 24px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 31.5px;
}

.quote__author-wrapper {
  position: absolute;
  bottom: -20px;
  right: 0;
  overflow: visible;
}

.quote__author {
  border: 1px solid var(--border);
  padding: 16px;
  font-size: 24px;
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--bg);
}

/* ============================================================
   Section Heading
   ============================================================ */
.section-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.section-heading__title {
  display: flex;
  font-size: 32px;
  font-weight: 500;
  white-space: nowrap;
}

.section-heading__hash {
  color: var(--accent);
}

.section-heading__text {
  color: var(--text-primary);
}

.section-heading__line {
  flex: 1;
  height: 1px;
  background-color: var(--accent);
}

.section-heading__link {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.section-heading__link:hover {
  color: var(--accent);
}

/* ============================================================
   Project Cards
   ============================================================ */
.project-card {
  border: 1px solid var(--border);
  width: 330px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.project-card__image {
  height: 201px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #1a1e23, #2d3239);
  overflow: hidden;
}

.project-card__image img,
.project-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card__techs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  color: var(--text-secondary);
}

.project-card__body {
  padding: 16px;
}

.project-card__title {
  font-size: 24px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.project-card__desc {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.project-card__actions {
  display: flex;
  gap: 16px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn--primary {
  border: 1px solid var(--accent);
  color: var(--text-primary);
}

.btn--primary:hover {
  background-color: rgba(199, 120, 221, 0.2);
}

.btn--secondary {
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn--secondary:hover {
  background-color: rgba(171, 178, 191, 0.2);
}

/* ============================================================
   Skills
   ============================================================ */
.skills {
  margin-top: 112px;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
}

.skills__content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.skills__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.skill-block {
  border: 1px solid var(--border);
  padding: 8px 0;
}

.skill-block__title {
  padding: 0 8px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.skill-block__divider {
  height: 1px;
  background-color: var(--border);
  margin-bottom: 8px;
}

.skill-block__items {
  padding: 0 8px;
  font-weight: 400;
  font-size: 16px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================
   About Me
   ============================================================ */
.about-me {
  margin-top: 112px;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
}

.about-me__content {
  display: flex;
  justify-content: space-between;
  gap: 100px;
  align-items: flex-start;
}

.about-me__description {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 26px;
  white-space: pre-line;
}

/* ============================================================
   Contacts Section (Homepage)
   ============================================================ */
.contacts-section {
  margin-top: 112px;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
}

.contacts-section__content {
  display: flex;
  gap: 100px;
  align-items: flex-start;
}

.contacts-section__card {
  border: 1px solid var(--border);
  padding: 16px;
}

.contacts-section__card-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.contacts-section__card-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 400;
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.contacts-section__card-item:last-child {
  margin-bottom: 0;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  margin-top: 70px;
  border-top: 1px solid var(--border);
  padding-bottom: 32px;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
}

.footer__content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 32px;
  padding-left: 16px;
  padding-right: 16px;
}

.footer__logo-row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer__media-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.footer__copyright {
  text-align: center;
  margin-top: 48px;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 0 16px;
}

/* ============================================================
   Page Title (Sub-pages)
   ============================================================ */
.page-title {
  margin-top: 53px;
  margin-bottom: 68px;
}

.page-title__heading {
  display: flex;
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 14px;
}

.page-title__slash {
  color: var(--accent);
}

.page-title__subtitle {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary);
}

/* ============================================================
   Decorative: Dots Grid
   ============================================================ */
.dots-grid {
  display: grid;
  grid-template-columns: repeat(5, 4px);
  gap: 20px;
}

.dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--border);
}

/* ============================================================
   Decorative: Geometric Logo
   ============================================================ */
.geo-logo {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.geo-logo__cell {
  background-color: var(--text-primary);
  aspect-ratio: 1;
}

.geo-logo__cell--empty {
  background-color: transparent;
}

/* ============================================================
   Decorative: Background Rectangle
   ============================================================ */
.bg-rect {
  position: absolute;
  border: 1px solid var(--border);
  pointer-events: none;
}

/* ============================================================
   Fun Facts
   ============================================================ */
.fun-fact {
  display: inline-flex;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  font-weight: 400;
  font-size: 16px;
  color: var(--text-secondary);
}

/* ============================================================
   Contacts Page
   ============================================================ */
.contact-card {
  border: 1px solid var(--border);
  padding: 16px;
  transition: transform 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-2px);
}

.contact-card__title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.contact-card__item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 400;
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.contact-card__item:last-child {
  margin-bottom: 0;
}

.media-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 16px;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.media-link:hover {
  color: var(--text-primary);
}

.media-link svg {
  width: 24px;
  height: 24px;
  fill: var(--text-secondary);
  transition: fill 0.2s ease;
}

.media-link:hover svg {
  fill: var(--text-primary);
}

/* ============================================================
   Projects Page
   ============================================================ */
.projects-section__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* ============================================================
   TypeWriter
   ============================================================ */
.typewriter {
  color: var(--accent);
}
.typewriter__cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 0.8s infinite;
  margin-left: 2px;
  font-weight: 300;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================================
   Scroll Progress Bar
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #ab47bc, var(--accent));
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ============================================================
   Fade-in Sections
   ============================================================ */
.fade-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.fade-section--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  border-radius: 4px;
  animation: slideIn 0.3s ease-out;
  min-width: 280px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.toast--success {
  border-left: 3px solid var(--accent);
}
.toast--error {
  border-left: 3px solid #e06c75;
}
.toast__close {
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}
.toast__close:hover {
  color: var(--text-primary);
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   GitHub Stats
   ============================================================ */
.github-stats {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  margin-top: 24px;
  width: fit-content;
}
.github-stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 28px;
}
.github-stats__number {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}
.github-stats__label {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 4px;
}
.github-stats__divider {
  width: 1px;
  height: 48px;
  background-color: var(--border);
}

/* ============================================================
   Time Status
   ============================================================ */
.time-status {
  border: 1px solid var(--border);
  padding: 20px;
  margin-top: 32px;
  background-color: var(--bg-secondary);
}
.time-status__clock {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.time-status__text {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 24px;
}
.time-status__text strong {
  color: var(--text-primary);
}

/* ============================================================
   Copy Email Button
   ============================================================ */
.copy-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
  transition: color 0.2s ease;
}
.copy-email-btn:hover {
  color: var(--accent);
}
.copy-email-btn svg {
  stroke: currentColor;
}

/* ============================================================
   Tooltip
   ============================================================ */
.tooltip-wrapper {
  position: relative;
  display: inline-flex;
}
.tooltip-text {
  position: absolute;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 400;
  padding: 4px 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  border-radius: 2px;
}
.tooltip-wrapper--right .tooltip-text {
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
}
.tooltip-wrapper--bottom .tooltip-text {
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
}
.tooltip-wrapper:hover .tooltip-text {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.tooltip-wrapper--bottom:hover .tooltip-text {
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   Contact Form
   ============================================================ */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 32px;
  max-width: 500px;
}
.contact-form__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact-form__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.contact-form__input,
.contact-form__textarea {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.contact-form__input::placeholder,
.contact-form__textarea::placeholder {
  color: #555a63;
}
.contact-form__input:focus,
.contact-form__textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(199, 120, 221, 0.15);
}
.contact-form__textarea {
  resize: vertical;
  min-height: 120px;
}
.contact-form__submit {
  align-self: flex-start;
}
.contact-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   Mobile Menu
   ============================================================ */
.mobile-menu {
  display: none;
}
.mobile-menu__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 200;
}
.mobile-menu__trigger:hover {
  color: var(--text-primary);
}
.mobile-menu__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 150;
  backdrop-filter: blur(4px);
}
.mobile-menu__nav {
  position: absolute;
  top: 0;
  right: 0;
  width: 260px;
  height: 100vh;
  background-color: var(--bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 80px 24px 24px;
  gap: 4px;
  animation: slideFromRight 0.25s ease-out;
}
.mobile-menu__link {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.mobile-menu__link:hover {
  background-color: rgba(199, 120, 221, 0.1);
  color: var(--text-primary);
}
.mobile-menu__link--active {
  color: var(--text-primary);
  font-weight: 500;
  background-color: rgba(199, 120, 221, 0.1);
}
@keyframes slideFromRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ============================================================
   Utility & Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }

  .hero__content {
    flex-direction: column;
    gap: 32px;
  }

  .hero__info {
    max-width: 100%;
  }

  .about-me__content {
    flex-direction: column;
    gap: 40px;
  }

  .contacts-section__content {
    flex-direction: column;
    gap: 40px;
  }

  .skills__content {
    flex-direction: column;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .header__nav {
    gap: 16px;
  }

  .hero__title {
    font-size: 24px;
    line-height: 32px;
  }

  .quote__text {
    font-size: 18px;
    line-height: 26px;
  }

  .quote__author {
    font-size: 18px;
  }

  .section-heading__title {
    font-size: 24px;
  }

  .project-card {
    width: 100%;
  }

  .projects-section__grid {
    flex-direction: column;
  }

  .footer__content {
    flex-direction: column;
    gap: 24px;
  }

  .header__nav-links { display: none; }
  .header__lang { display: none; }
  .mobile-menu { display: block; }
  .hero__image { width: 100%; height: 280px; }
  .about__image { width: 100%; height: 350px; }
  .github-stats { width: 100%; }
  .github-stats__item { flex: 1; padding: 12px 16px; }
}

@media (max-width: 480px) {
  .header {
    padding-top: 16px;
  }

  .header__nav {
    gap: 12px;
    font-size: 14px;
  }

  .hero {
    padding-top: 32px;
  }

  .quote__box {
    padding: 16px;
  }

  .contact-form { max-width: 100%; }
  .toast { min-width: auto; max-width: calc(100vw - 48px); }
}
