/* ===== Font ===== */
@font-face {
  font-family: 'CHNOPixelCodePro';
  src: url('CHNOPixelCodePro-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --bg: #1a1a14;
  --orange: #e8930a;
  --footer-bg: #e8930a;
  --text: #e8930a;
  --font: 'CHNOPixelCodePro', monospace;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 5px, rgba(0,0,0,0.15) 5px, rgba(0,0,0,0.15) 6px),
    repeating-linear-gradient(90deg, transparent, transparent 5px, rgba(0,0,0,0.15) 5px, rgba(0,0,0,0.15) 6px),
    radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.55) 85%, rgba(0,0,0,0.85) 100%),
    radial-gradient(ellipse at 50% 0%, #1f1200 0%, #0c0700 100%);
  background-color: #0c0700;
  background-attachment: fixed;
  animation: crtTextShadow 1.6s infinite;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.4;
  min-height: 100vh;
  text-transform: uppercase;
}

a {
  color: var(--orange);
  text-decoration: none;
  transition: opacity 0.2s;
}
a:hover { opacity: 0.7; }

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

/* ===== Header ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 100px;
}

.header__name {
  font-size: 24px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cursor-blink {
  animation: terminalBlink 1s step-end infinite;
  margin-left: 2px;
  font-size: 0.7em;
  vertical-align: middle;
}

@keyframes terminalBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.header__follow {
  font-size: 1rem;
  white-space: nowrap;
  position: relative;
  padding: 8px 16px;
  background: transparent;
  border: none;
  transition: opacity 0.2s;
}

.header__follow::before,
.header__follow::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--orange);
  border-style: solid;
}
.header__follow::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.header__follow::after { top: 0; right: 0; border-width: 1px 1px 0 0; }

.header__follow-corners { position: absolute; inset: 0; pointer-events: none; }
.header__follow-corners::before,
.header__follow-corners::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--orange);
  border-style: solid;
}
.header__follow-corners::before { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.header__follow-corners::after { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

/* ===== Divider ===== */
.divider {
  border: none;
  border-top: 1px solid var(--orange);
  margin: 0 100px;
}

/* ===== Main two-column layout ===== */
.main {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0 48px;
  padding: 16px 100px;
}

/* ===== About ===== */
.about {
  position: sticky;
  top: 40px;
  align-self: start;
}

.about__photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.about__bio {
  margin-top: 26px;
  font-size: 1rem;
  line-height: 1.4;
}

.about__bio p + p {
  margin-top: 16px;
}

.about__follow-mobile {
  display: none;
  position: relative;
  padding: 8px 16px;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  margin-top: 24px;
  white-space: nowrap;
  width: fit-content;
}

.about__follow-mobile::before,
.about__follow-mobile::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--orange);
  border-style: solid;
}
.about__follow-mobile::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.about__follow-mobile::after { top: 0; right: 0; border-width: 1px 1px 0 0; }

/* ===== Projects ===== */
.projects {
  padding: 0;
  padding-bottom: 12px;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--orange);
  background: transparent;
  transition: background 0.3s, box-shadow 0.3s;
  text-decoration: none;
  color: var(--text);
}

.project-card:hover {
  background: rgba(232, 147, 10, 0.1);
  box-shadow: inset 0 0 30px rgba(232, 147, 10, 0.08);
  opacity: 1;
}

.project-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.project-card__name {
  font-size: 18px;
}

.project-card__logo {
  width: 25px;
  height: 25px;
  object-fit: contain;
  flex-shrink: 0;
  order: -1;
  animation: logoGlitch 1.6s infinite;
}

.project-card__desc {
  font-size: 1rem;
  line-height: 1.4;
  flex: 1;
}

.project-card__year {
  margin-top: 16px;
  font-size: 1rem;
  opacity: 0.5;
}


/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--orange);
  margin: 0 100px;
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__title {
  font-size: 1rem;
  font-weight: 400;
}

.footer__links {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.footer__link {
  color: var(--text);
  font-size: 1rem;
}
.footer__link:hover { opacity: 0.6; }

/* ===== CRT Effects ===== */
body::before {
  content: "";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background:
    linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.2) 50%),
    linear-gradient(90deg, rgba(255,0,0,0.04), rgba(0,255,0,0.01), rgba(0,0,255,0.04));
  background-size: 100% 2px, 3px 100%;
  z-index: 9999;
  pointer-events: none;
}

body::after {
  content: "";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background: rgba(18,16,16,0.1);
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
  animation: crtFlicker 0.15s infinite;
}

body {
  text-shadow: 0 0 5px;
  -webkit-font-smoothing: auto;
}

.bg-flicker {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(232, 147, 10, 0.07) 0%, transparent 65%);
  animation: bgPulse 3s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 0.15; }
  50%       { opacity: 0.7; }
}

@keyframes crtFlicker {
  0%   { opacity: 0.04; }
  25%  { opacity: 0.07; }
  50%  { opacity: 0.03; }
  75%  { opacity: 0.06; }
  100% { opacity: 0.03; }
}

@keyframes logoGlitch {
  0%   { filter: drop-shadow(0.44px 0 1px rgba(180,125,10,0.5)) drop-shadow(-0.44px 0 1px rgba(100,60,0,0.4)); }
  5%   { filter: drop-shadow(2.79px 0 1px rgba(180,125,10,0.5)) drop-shadow(-2.79px 0 1px rgba(100,60,0,0.4)); }
  10%  { filter: drop-shadow(0.03px 0 1px rgba(180,125,10,0.5)) drop-shadow(-0.03px 0 1px rgba(100,60,0,0.4)); }
  20%  { filter: drop-shadow(3.48px 0 1px rgba(180,125,10,0.5)) drop-shadow(-3.48px 0 1px rgba(100,60,0,0.4)); }
  30%  { filter: drop-shadow(0.70px 0 1px rgba(180,125,10,0.5)) drop-shadow(-0.70px 0 1px rgba(100,60,0,0.4)); }
  35%  { filter: drop-shadow(3.90px 0 1px rgba(180,125,10,0.5)) drop-shadow(-3.90px 0 1px rgba(100,60,0,0.4)); }
  50%  { filter: drop-shadow(0.08px 0 1px rgba(180,125,10,0.5)) drop-shadow(-0.08px 0 1px rgba(100,60,0,0.4)); }
  60%  { filter: drop-shadow(2.20px 0 1px rgba(180,125,10,0.5)) drop-shadow(-2.20px 0 1px rgba(100,60,0,0.4)); }
  70%  { filter: drop-shadow(0.49px 0 1px rgba(180,125,10,0.5)) drop-shadow(-0.49px 0 1px rgba(100,60,0,0.4)); }
  80%  { filter: drop-shadow(0.08px 0 1px rgba(180,125,10,0.5)) drop-shadow(-0.08px 0 1px rgba(100,60,0,0.4)); }
  90%  { filter: drop-shadow(3.44px 0 1px rgba(180,125,10,0.5)) drop-shadow(-3.44px 0 1px rgba(100,60,0,0.4)); }
  100% { filter: drop-shadow(2.62px 0 1px rgba(180,125,10,0.5)) drop-shadow(-2.62px 0 1px rgba(100,60,0,0.4)); }
}

@keyframes crtTextShadow {
  0%   { text-shadow: 0.44px 0 1px rgba(180,125,10,0.5), -0.44px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  5%   { text-shadow: 2.79px 0 1px rgba(180,125,10,0.5), -2.79px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  10%  { text-shadow: 0.03px 0 1px rgba(180,125,10,0.5), -0.03px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  15%  { text-shadow: 0.40px 0 1px rgba(180,125,10,0.5), -0.40px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  20%  { text-shadow: 3.48px 0 1px rgba(180,125,10,0.5), -3.48px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  25%  { text-shadow: 1.61px 0 1px rgba(180,125,10,0.5), -1.61px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  30%  { text-shadow: 0.70px 0 1px rgba(180,125,10,0.5), -0.70px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  35%  { text-shadow: 3.90px 0 1px rgba(180,125,10,0.5), -3.90px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  40%  { text-shadow: 3.87px 0 1px rgba(180,125,10,0.5), -3.87px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  45%  { text-shadow: 2.23px 0 1px rgba(180,125,10,0.5), -2.23px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  50%  { text-shadow: 0.08px 0 1px rgba(180,125,10,0.5), -0.08px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  55%  { text-shadow: 2.38px 0 1px rgba(180,125,10,0.5), -2.38px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  60%  { text-shadow: 2.20px 0 1px rgba(180,125,10,0.5), -2.20px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  65%  { text-shadow: 2.86px 0 1px rgba(180,125,10,0.5), -2.86px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  70%  { text-shadow: 0.49px 0 1px rgba(180,125,10,0.5), -0.49px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  75%  { text-shadow: 1.89px 0 1px rgba(180,125,10,0.5), -1.89px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  80%  { text-shadow: 0.08px 0 1px rgba(180,125,10,0.5), -0.08px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  85%  { text-shadow: 0.10px 0 1px rgba(180,125,10,0.5), -0.10px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  90%  { text-shadow: 3.44px 0 1px rgba(180,125,10,0.5), -3.44px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  95%  { text-shadow: 2.18px 0 1px rgba(180,125,10,0.5), -2.18px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
  100% { text-shadow: 2.62px 0 1px rgba(180,125,10,0.5), -2.62px 0 1px rgba(100,60,0,0.4), 0 0 3px rgba(212,145,10,0.15); }
}

/* ===== Tablet ===== */
@media (max-width: 1024px) {
  .header { padding: 20px 100px; }
  .divider { margin: 0 100px; }
  .main {
    grid-template-columns: 240px 1fr;
    gap: 0 28px;
    padding: 24px 100px;
  }
  .about__photo img {
    max-height: 180px;
    aspect-ratio: 1 / 1;
  }
  .about__bio {
    font-size: 0.85rem;
    margin-top: 12px;
  }
  .about__bio p + p { margin-top: 10px; }
  .footer { margin: 0 100px; padding: 14px 0; }
  .projects__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Mobile ===== */
@media (max-width: 600px) {
  html { font-size: 18px; }
  .projects { padding-top: 20px; }
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
  }

  .header__follow { display: none; }

  .divider { margin: 0 20px; }

  .main {
    display: block;
    padding: 24px 20px;
  }

  .about {
    position: static;
    margin-bottom: 32px;
  }

  .about__bio { font-size: 1rem; margin-top: 36px; }

  .about__photo img {
    max-height: none;
    aspect-ratio: 1 / 1;
  }

  .about__follow-mobile {
    display: block;
    width: 100%;
    text-align: center;
  }

  .projects__grid {
    grid-template-columns: 1fr;
      gap: 18px;
  }


  .project-card {
    min-height: 235px;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .footer {
    margin: 0 20px;
    padding: 16px 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer__links {
    flex-direction: column;
    gap: 12px;
  }
}
