/* ── TERMINAL INTRO ── */
#terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.6s ease,
    visibility 0.6s ease;
}
#terminal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#terminal-overlay.no-transition {
  transition: none !important;
}

.term-window {
  width: min(640px, 92vw);
  background: #212129;
  border: 1px solid rgba(176, 70, 229, 0.25);
  border-radius: 10px;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.8),
    0 0 60px rgba(176, 70, 229, 0.12);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 18px;
  background: #2a2a35;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.term-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.term-dot.r {
  background: #ff5f57;
}
.term-dot.y {
  background: #febc2e;
}
.term-dot.g {
  background: #28c840;
}
.term-title {
  flex: 1;
  text-align: center;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.06em;
}
.term-body {
  padding: 28px 32px 32px;
  font-family: "DM Mono", monospace;
  font-size: 13.5px;
  line-height: 1.9;
  min-height: 280px;
}
.term-prompt {
  color: #888;
}
.term-prompt .cmd {
  color: #e8e8f2;
}
.term-comment {
  color: rgba(176, 70, 229, 0.45);
}
.term-key {
  color: #7b93d1;
}
.term-str {
  color: #b3d97a;
}
.term-fn {
  color: #c792ea;
}
.term-pun {
  color: #89ddff;
}
.term-ok {
  color: #b3d97a;
}
.term-cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--p);
  vertical-align: text-bottom;
  animation: blink 0.9s step-end infinite;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.term-line {
  display: block;
  white-space: pre-wrap;
}
.term-line.hidden-line {
  display: none;
}

/* ── HERO ── */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-rows: 1fr auto;
  gap: 0;
  padding: 0 56px;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  overflow: hidden;
}

.hero-main {
  padding-top: 120px;
  padding-bottom: 80px;
  min-width: 0;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 0.7s 0.3s forwards;
}
.hero-eyebrow .label {
  color: var(--p);
}
.hero-eyebrow-line {
  width: 48px;
  height: 1px;
  background: var(--p);
}

.hero-name {
  font-family: "Bebas Neue", cursive;
  font-size: clamp(80px, 11vw, 160px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeUp 0.7s 0.5s forwards;
}
.hero-name .shuffle {
  color: var(--p);
  display: block;
  white-space: nowrap;
  width: var(--shuffle-w, max-content);
  overflow: hidden;
}
.hero-name .solid {
  color: var(--t);
  display: block;
}

.hero-role {
  font-family: "DM Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--td);
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.7s 0.65s forwards;
}
.hero-role span {
  color: var(--p);
}

.hero-desc {
  max-width: 480px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--td);
  margin-bottom: 52px;
  opacity: 0;
  animation: fadeUp 0.7s 0.8s forwards;
}
.hero-desc strong {
  color: var(--t);
  font-weight: 500;
}

.hero-btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s 0.95s forwards;
}

.hero-sidebar {
  padding-top: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  border-left: 1px solid var(--br2);
  padding-left: 56px;
  height: 100%;
  width: 380px;
  flex-shrink: 0;
  opacity: 0;
  animation: fadeIn 1s 1.1s forwards;
}

.stat-row {
  padding: 28px 0;
  border-bottom: 1px solid var(--br2);
}
.stat-row:first-child {
  border-top: 1px solid var(--br2);
}
.stat-num {
  font-family: "Bebas Neue", cursive;
  font-size: 52px;
  letter-spacing: 0.04em;
  color: var(--p);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--td);
}

.hero-social {
  display: flex;
  gap: 14px;
  margin-top: 36px;
}
.soc-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--br);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--td);
  transition: all 0.3s;
}
.soc-btn:hover {
  border-color: var(--p);
  color: var(--p);
  background: var(--pg2);
}
.soc-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.hero-scroll {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-bottom: 40px;
  opacity: 1;
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}
.hero-scroll.scroll-hidden {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
.scroll-txt {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--td);
  animation: scrollTxt 1.7s ease-in-out infinite;
}
.scroll-track {
  position: relative;
  width: 2px;
  height: 78px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--br), var(--p));
  overflow: hidden;
}
.scroll-dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--p2);
  box-shadow:
    0 0 8px 2px var(--p),
    0 0 18px 5px var(--pg);
  animation: scrollDot 1.7s cubic-bezier(0.66, 0, 0.34, 1) infinite;
}
.scroll-arrow {
  font-size: 17px;
  line-height: 1;
  color: var(--p2);
  text-shadow: 0 0 10px var(--pg);
  animation: scrollArrow 1.7s ease-in-out infinite;
}

/* ── MATRIX RAIN DIVIDER ── */
.matrix-band {
  position: relative;
  z-index: 1;
  height: 180px;
  overflow: hidden;
  background: var(--bg);
  border-top: 1px solid var(--br2);
  border-bottom: 1px solid var(--br2);
}
.matrix-band canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.matrix-band::before,
.matrix-band::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 140px;
  z-index: 2;
  pointer-events: none;
}
.matrix-band::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}
.matrix-band::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}

/* ── SELECTED WORK ── */
.work-section {
  position: relative;
  z-index: 1;
  padding: 120px 56px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 72px;
  gap: 32px;
}

.section-title {
  font-family: "Bebas Neue", cursive;
  font-size: clamp(44px, 6vw, 80px);
  line-height: 0.95;
  letter-spacing: 0.02em;
}
.section-title em {
  color: var(--p);
  font-style: normal;
}

.section-count {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  color: var(--td2);
  letter-spacing: 0.1em;
  align-self: flex-end;
  padding-bottom: 8px;
}

.proj-list {
  display: grid;
  gap: 2px;
}

.proj-row {
  display: grid;
  grid-template-columns: 64px 1fr 1fr 180px;
  align-items: center;
  gap: 40px;
  padding: 36px 40px;
  background: var(--bg2);
  border: 1px solid transparent;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.proj-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--p), transparent);
  transition: width 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.6;
}
.proj-row:hover {
  border-color: var(--br);
  background: var(--bg3);
  transform: translateX(6px);
}
.proj-row:hover::before {
  width: 3px;
}

.proj-idx {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  color: var(--td2);
  opacity: 0.6;
}
.proj-idx.starred {
  color: var(--p);
  opacity: 1;
}
.proj-name-wrap {
}
.proj-name {
  font-family: "Bebas Neue", cursive;
  font-size: 26px;
  letter-spacing: 0.05em;
  color: var(--t);
  transition: color 0.3s;
  margin-bottom: 4px;
}
.proj-row:hover .proj-name {
  color: var(--p);
}
.proj-subtitle {
  font-size: 13px;
  color: var(--td);
}
.proj-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.proj-arrow {
  text-align: right;
  font-family: "DM Mono", monospace;
  font-size: 18px;
  color: var(--td2);
  transition: all 0.3s;
}
.proj-row:hover .proj-arrow {
  color: var(--p);
  transform: translateX(4px);
}

/* ── SPLIT SECTION (about preview) ── */
.split-section {
  position: relative;
  z-index: 1;
  background: var(--bg2);
  border-top: 1px solid var(--br2);
  border-bottom: 1px solid var(--br2);
}
.split-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1400px;
  margin: 0 auto;
}
.split-left {
  padding: 100px 56px;
  border-right: 1px solid var(--br2);
}
.split-right {
  padding: 100px 56px;
}

.about-lead {
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.5;
  font-weight: 300;
  color: var(--t);
  margin-bottom: 40px;
}
.about-lead em {
  color: var(--p);
  font-style: normal;
  font-weight: 500;
}

.about-body {
  font-size: 14px;
  line-height: 1.85;
  color: var(--td);
  margin-bottom: 40px;
}

.btn-mt {
  margin-top: 12px;
}

.timeline-mt {
  margin-top: 48px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.skill-cell {
  background: var(--bg);
  border: 1px solid var(--br2);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}
.skill-cell::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: var(--p);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  opacity: 0;
  transition: opacity 0.3s;
}
.skill-cell:hover {
  border-color: var(--br);
}
.skill-cell:hover::after {
  opacity: 1;
}
.skill-cell-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--t);
  margin-bottom: 3px;
}
.skill-cell-sub {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: var(--td2);
  letter-spacing: 0.08em;
}

.timeline {
  position: relative;
  margin-top: 8px;
}
.timeline::before,
.tl-wrapper::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--p) 0%,
    var(--br) 55%,
    transparent 100%
  );
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 18px;
  padding-bottom: 22px;
}
.tl-item:last-child,
.tl-item--last {
  padding-bottom: 0;
}
.tl-node {
  width: 12px;
  height: 12px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--p);
  position: relative;
  z-index: 1;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}
.tl-item--work .tl-node {
  background: var(--p);
}
.tl-item--current .tl-node {
  background: var(--p2);
  border-color: var(--p2);
  box-shadow:
    0 0 0 3px var(--pg2),
    0 0 14px 3px var(--pg);
  animation: tlPulse 2.4s ease-in-out infinite;
}
@keyframes tlPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 2px var(--pg2),
      0 0 8px 2px var(--pg);
  }
  50% {
    box-shadow:
      0 0 0 5px var(--pg2),
      0 0 16px 4px var(--pg);
  }
}
.tl-content {
  transition: transform 0.25s ease;
}
.tl-item:hover .tl-content {
  transform: translateX(4px);
}
.tl-item:hover .tl-node {
  transform: scale(1.18);
  box-shadow: 0 0 12px 2px var(--pg);
}
.tl-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.tl-year {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: var(--p);
  background: var(--pg2);
  border: 1px solid var(--br);
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.tl-tag {
  font-family: "DM Mono", monospace;
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--td2);
}
.tl-item--work .tl-tag,
.tl-item--current .tl-tag {
  color: var(--p2);
}
.tl-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--t);
  margin-bottom: 3px;
}
.tl-detail {
  font-size: 13px;
  color: var(--td);
  line-height: 1.5;
}
@media (prefers-reduced-motion: reduce) {
  .tl-item--current .tl-node {
    animation: none;
  }
}

/* Split section extra sub-blocks */
.split-extra {
  margin-top: 40px;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.tl-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}

/* Code preview block in split section */
.code-preview {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  line-height: 1.9;
  color: var(--td);
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--br2);
  padding: 16px 20px;
  border-radius: 4px;
}
.syn-comment {
  color: rgba(176, 70, 229, 0.5);
}
.syn-key {
  color: #7b93d1;
}
.syn-str {
  color: #b3d97a;
}
.syn-pun {
  color: #89ddff;
}

/* ── CONTACT SECTION ── */
.contact-section {
  position: relative;
  z-index: 1;
  padding: 140px 56px 120px;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.contact-big {
  font-family: "Bebas Neue", cursive;
  font-size: clamp(64px, 8vw, 120px);
  line-height: 0.9;
  letter-spacing: 0.02em;
}
.contact-big em {
  color: var(--p);
  font-style: normal;
}

.contact-email {
  display: block;
  width: fit-content;
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 300;
  color: var(--t);
  text-decoration: none;
  border-bottom: 1px solid var(--br2);
  padding-bottom: 12px;
  margin-bottom: 28px;
  position: relative;
  transition:
    color 0.3s,
    border-color 0.3s;
}
.contact-email:hover {
  color: var(--p);
  border-color: var(--p);
}

.contact-phone {
  font-family: "DM Mono", monospace;
  font-size: 13px;
  color: var(--td);
  display: block;
  width: fit-content;
  margin-bottom: 40px;
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
}
.contact-phone::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--p);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.contact-phone:hover {
  color: var(--p);
}
.contact-phone:hover::after {
  width: 100%;
}

.social-row {
  display: flex;
  gap: 12px;
}

/* ── KEYFRAMES ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes scrollDot {
  0% {
    transform: translateY(-8px);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(74px);
    opacity: 0;
  }
}
@keyframes scrollTxt {
  0%,
  100% {
    color: var(--td);
  }
  50% {
    color: var(--p);
  }
}
@keyframes scrollArrow {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  50% {
    transform: translateY(4px);
    opacity: 1;
  }
}
/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-sidebar {
    display: none;
  }
  .hero {
    padding: 0 32px;
  }
  .proj-row {
    grid-template-columns: 48px 1fr;
  }
  .proj-tags,
  .proj-arrow {
    display: none;
  }
  .split-inner {
    grid-template-columns: 1fr;
  }
  .split-left {
    border-right: none;
    border-bottom: 1px solid var(--br2);
  }
  .split-left,
  .split-right {
    padding: 60px 32px;
  }
  .contact-section {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 80px 32px;
  }
  .work-section {
    padding: 80px 32px;
  }
  .skill-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .hero-name {
    font-size: clamp(64px, 16vw, 100px);
  }
  .hero-name .shuffle {
    white-space: normal;
    overflow: visible;
    width: auto;
  }
  .section-head {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .proj-row {
    padding: 24px 20px;
    gap: 16px;
  }
  .skill-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 375px) {
  .hero,
  .work-section,
  .contact-section {
    padding-left: 16px;
    padding-right: 16px;
  }
  .split-left,
  .split-right {
    padding-left: 16px;
    padding-right: 16px;
  }
}
