:root {
  --ink: #1c1a18;
  --accent: #d66534;
  --accent-dark: #b84d22;
  --line: #dbcbb2;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow: hidden;
}

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

html::before,
html::after {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: 0;
}

html::before {
  background-image:
    radial-gradient(circle, rgba(28, 26, 24, 0.2) 1px, transparent 1.6px),
    radial-gradient(circle, rgba(214, 101, 52, 0.24) 1.2px, transparent 2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.3) 1.6px, transparent 2.4px);
  background-size: 90px 90px, 140px 140px, 210px 210px;
  background-position: 0 0, 30px 20px, 80px 50px;
  animation: particles-drift-1 14s linear infinite, twinkle-1 4.6s ease-in-out infinite;
}

html::after {
  background-image:
    radial-gradient(circle, rgba(28, 26, 24, 0.15) 1px, transparent 1.6px),
    radial-gradient(circle, rgba(255, 255, 255, 0.28) 1.4px, transparent 2.2px),
    radial-gradient(circle, rgba(214, 101, 52, 0.2) 2px, transparent 3px),
    repeating-linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.1) 0 1px,
      transparent 1px 26px
    );
  background-size: 120px 120px, 180px 180px, 260px 260px, 300px 300px;
  background-position: 40px 10px, 0 60px, 120px 30px, 0 0;
  animation: particles-drift-2 18s linear infinite, twinkle-2 5.2s ease-in-out infinite;
  opacity: 0.9;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at 15% 20%, #fff7d9 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, #ffd9be 0%, transparent 42%),
    linear-gradient(160deg, #f8f3e8 0%, #efe4d0 100%);
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
}

#shape-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.62;
}

main {
  position: relative;
  z-index: 1;
  padding-bottom: 3rem;
}

.hero {
  width: min(980px, 92vw);
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.2rem 2rem 2rem;
  animation: rise-in 900ms ease-out both;
  margin: 0 auto;
}

.kicker {
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
  font-weight: 700;
}

h1 {
  margin: 0.4rem 0 0.8rem;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: clamp(3.4rem, 12vw, 9rem);
  line-height: 0.9;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.letter {
  display: inline-block;
  transition: color 180ms ease, text-shadow 180ms ease, transform 260ms ease-out;
}

.letter:hover {
  color: #120f0d;
  text-shadow:
    0 0 8px rgba(214, 101, 52, 0.55),
    0 0 18px rgba(255, 255, 255, 0.45),
    0 0 30px rgba(214, 101, 52, 0.35);
  transform: translateY(-2px);
  transition: color 160ms ease, text-shadow 160ms ease, transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.letter-t:hover {
  transform: translateY(-2px) scale(1.04) rotate(0deg);
  color: #a83d1a;
  text-shadow:
    0 0 10px rgba(214, 101, 52, 0.85),
    0 0 24px rgba(255, 214, 160, 0.9),
    0 0 40px rgba(214, 101, 52, 0.55);
  animation: t-glow-burst 1400ms ease-out forwards;
  transition: color 180ms ease, text-shadow 180ms ease, transform 520ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.letter-space {
  display: inline-block;
  width: 0.14em;
}

.initial {
  font-size: 1.22em;
  line-height: 0.8;
}

.intro {
  margin: 0 auto;
  max-width: 600px;
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  line-height: 1.6;
}

.stats {
  margin: 1.6rem auto 0;
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.stat-card {
  position: relative;
  min-height: 106px;
  perspective: 900px;
  touch-action: manipulation;
  cursor: pointer;
  user-select: none;
}

.stat-face {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  border-radius: 14px;
  padding: 0.9rem 0.8rem;
  display: grid;
  place-content: center;
  backface-visibility: hidden;
  transition: transform 620ms cubic-bezier(0.22, 0.8, 0.2, 1);
}

.stat-front {
  transform: rotateY(0deg);
}

.stat-back {
  transform: rotateY(180deg);
  background: rgba(255, 247, 235, 0.9);
}

.stat-card.is-flipped .stat-front {
  transform: rotateY(-180deg);
}

.stat-card.is-flipped .stat-back {
  transform: rotateY(0deg);
}

.stat-card:focus-visible {
  outline: 2px solid rgba(214, 101, 52, 0.45);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .stat-card:hover .stat-front {
    transform: rotateY(-180deg);
  }

  .stat-card:hover .stat-back {
    transform: rotateY(0deg);
  }
}

.stat-value {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.stat-label {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-detail {
  margin: 0;
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.45;
}

.actions {
  margin-top: 1.35rem;
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.social-links {
  margin: 1.1rem auto 0;
  width: fit-content;
  max-width: 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.social-link:hover {
  transform: translateY(-2px);
  border-color: rgba(184, 77, 34, 0.45);
  box-shadow: 0 10px 22px rgba(184, 77, 34, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.social-icon {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(214, 101, 52, 0.12);
  color: var(--accent-dark);
  flex: 0 0 auto;
}

.social-icon svg {
  width: 0.8rem;
  height: 0.8rem;
  fill: currentColor;
}

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

.social-title {
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1.1;
}

.social-link:hover .social-title {
  color: var(--accent-dark);
}

.btn {
  display: inline-block;
  text-decoration: none;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

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

.btn-primary {
  background-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--accent-dark);
}

.btn-ghost {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost:hover {
  background-color: rgba(28, 26, 24, 0.08);
}

.projects {
  width: min(980px, 92vw);
  margin: 1.8rem auto 0;
  padding: 1.4rem 2rem 2rem;
  scroll-margin-top: 1.25rem;
}

.projects-window {
  border: 1px solid rgba(219, 203, 178, 0.95);
  border-radius: 24px;
  padding: 1.1rem 1.2rem 1.25rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(251, 242, 230, 0.66) 100%);
  box-shadow:
    0 14px 34px rgba(95, 68, 45, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: opacity 260ms ease, visibility 260ms ease, transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 500ms ease;
}

.projects-window.is-temporarily-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.projects-window.is-expanded {
  transform: scale(1.09);
  box-shadow:
    0 36px 80px rgba(95, 68, 45, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.projects-window-bar {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.window-btn {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: background-color 170ms ease, transform 170ms ease;
}

.window-btn::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.52rem;
  font-weight: 900;
  color: rgba(20, 20, 20, 0.75);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 120ms ease, transform 120ms ease;
}

.projects-window-bar:hover .window-btn::after {
  opacity: 1;
  transform: scale(1);
}

.window-btn-close {
  background: #e0b09a;
}

.window-btn-minimize {
  background: #c9bba8;
}

.window-btn-expand {
  background: #d2c4b1;
}

.projects-window-bar:hover .window-btn-close {
  background: #ff5f56;
}

.projects-window-bar:hover .window-btn-minimize {
  background: #ffbd2e;
}

.projects-window-bar:hover .window-btn-expand {
  background: #27c93f;
}

.window-btn-close::after {
  content: "×";
  transform: scale(0.7) translateY(0.8px);
}

.projects-window-bar:hover .window-btn-close::after {
  transform: scale(1) translateY(0.8px);
}

.window-btn-minimize::after {
  content: "−";
}

.window-btn-expand::after {
  content: "+";
}

.window-btn:active {
  transform: scale(0.94);
}

.projects h2 {
  margin: 0.35rem 0 0.6rem;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.7rem, 8vw, 4.6rem);
  line-height: 0.9;
  letter-spacing: 0.03em;
}

.projects-intro {
  margin: 0 auto;
  max-width: 640px;
  font-size: 1.03rem;
  line-height: 1.6;
}

.project-grid {
  margin-top: 1.35rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  padding: 1rem 0.95rem;
  text-align: left;
}

.project-tag {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.72;
}

.project-card h3 {
  margin: 0.45rem 0 0.45rem;
  font-size: 1.1rem;
}

.project-card p {
  margin: 0;
  line-height: 1.55;
}

@keyframes t-glow-burst {
  0% {
    color: inherit;
    text-shadow: none;
  }
  14% {
    color: #ffcc88;
    text-shadow:
      0 0 3px rgba(255, 240, 180, 1),
      0 0 10px rgba(255, 180, 70, 0.95),
      0 0 22px rgba(214, 101, 52, 0.9);
  }
  32% {
    color: #d95c1e;
    text-shadow:
      0 0 5px rgba(255, 210, 130, 0.85),
      0 0 18px rgba(255, 130, 40, 0.75),
      0 0 48px rgba(214, 101, 52, 0.6),
      0 0 96px rgba(214, 101, 52, 0.25);
  }
  100% {
    color: #a83d1a;
    text-shadow:
      0 0 10px rgba(214, 101, 52, 0.85),
      0 0 24px rgba(255, 214, 160, 0.9),
      0 0 40px rgba(214, 101, 52, 0.55);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@keyframes particles-drift-1 {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-260px, -180px, 0);
  }
}

@keyframes particles-drift-2 {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(210px, -230px, 0);
  }
}

@keyframes twinkle-1 {
  0%,
  100% {
    opacity: 0.65;
    filter: blur(0px);
  }
  50% {
    opacity: 1;
    filter: blur(0.3px);
  }
}

@keyframes twinkle-2 {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.95;
  }
}

.projects-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.projects-modal.hidden {
  display: none;
}

.projects-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 26, 24, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.projects-modal-box {
  position: relative;
  z-index: 1;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: modal-pop 280ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.projects-modal-gif {
  display: block;
  max-width: min(480px, 88vw);
  max-height: 80vh;
  width: auto;
  height: auto;
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  body {
    padding: 1rem 0 0.7rem;
    -webkit-text-size-adjust: 100%;
  }

  .hero {
    margin: 0 auto;
    padding: 1.25rem 0.95rem 1rem;
    min-height: auto;
  }

  h1 {
    font-size: clamp(2.4rem, 11vw, 3.8rem);
    white-space: normal;
    word-break: break-word;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .stat-card {
    min-height: 96px;
  }

  .actions {
    gap: 0.65rem;
  }

  .social-links {
    justify-content: center;
    gap: 0.45rem;
  }

  .projects {
    padding: 1.1rem 0.95rem 1.2rem;
  }

  .projects-window {
    border-radius: 18px;
    padding: 0.95rem 0.85rem 1rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}

@media (max-width: 400px) {
  .hero {
    padding: 1rem 0.75rem;
  }

  h1 {
    font-size: clamp(2.2rem, 11vw, 3.4rem);
  }

  .intro {
    font-size: 0.95rem;
  }

  .btn {
    padding: 0.7rem 1.1rem;
    font-size: 0.9rem;
  }

  .projects {
    padding: 0.9rem 0.75rem 1rem;
  }
}
