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

:root {
  --bg:          #0a0b0f;
  --surface:     #0f1018;
  --border:      #1e1a2e;
  --green:       #0ed128;
  --second-green: #21cd0e;
  --second-purple: #9000ff;
  --green-dim:   #00cc0e;
  --green-glow:  rgba(13, 161, 18, 0.15);
  --purple:      #bf5fff;
  --purple-dim:  #9333ea;
  --purple-glow: rgba(191, 95, 255, .15);
  --blue:        #bf5fff;
  --muted:       #3d3556;
  --text:        #cdd6f0;
  --text-dim:    #6b6890;
  --mono:        "Ubuntu Sans Mono", monospace;
  --display:     'Space Grotesk', sans-serif;
  --footer-font: 'Silkscreen', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: none;
}

/* background grid */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at var(--bx1, 15%) var(--by1, 25%), rgba(191, 95, 255, .1) 0%, transparent 65%),
    radial-gradient(ellipse 45% 55% at var(--bx2, 85%) var(--by2, 75%), rgba(0, 255, 159, .08) 0%, transparent 65%),
    radial-gradient(ellipse 35% 45% at var(--bx3, 75%) var(--by3, 15%), rgba(191, 95, 255, .06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  transition: --bx1 8s ease, --by1 8s ease;
}

/* scanlines */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0, 0, 0, .07) 2px, rgba(0, 0, 0, .07) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* cursor */
.cursor {
  position: fixed;
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid var(--green);
  background: transparent;
  pointer-events: none;
  z-index: 9999;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 4px var(--green)) drop-shadow(0 0 10px var(--green-glow));
  animation: rotateCursor3D 4s linear infinite;
}

.cursor-ring {
  position: fixed;
  width: 0; height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 22px solid rgba(0, 255, 159, .12);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 6px var(--green-glow));
  animation: rotateCursor3D 4s linear infinite reverse;
}

@keyframes rotateCursor3D {
  0%   { transform: translate(-50%, -50%) rotateZ(0deg)   rotateX(0deg)   rotateY(0deg);   }
  25%  { transform: translate(-50%, -50%) rotateZ(90deg)  rotateX(180deg) rotateY(45deg);  }
  50%  { transform: translate(-50%, -50%) rotateZ(180deg) rotateX(360deg) rotateY(90deg);  }
  75%  { transform: translate(-50%, -50%) rotateZ(270deg) rotateX(180deg) rotateY(135deg); }
  100% { transform: translate(-50%, -50%) rotateZ(360deg) rotateX(360deg) rotateY(180deg); }
}
.cursor-trail {
  position: fixed;
  width: 4px; height: 4px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%, -50%);
  background: var(--green);
}

.typing-cursor {
  color: var(--green);
  margin-left: 1px;
}

body:has(a:hover) .cursor-ring,
body:has(button:hover) .cursor-ring {
  width: 44px; height: 44px;
  border-color: var(--green);
}

/* nav */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 3rem;
  background: rgba(10, 14, 19, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: .85rem;
  font-weight: 500;
  color: var(--green);
  letter-spacing: .06em;
}

.nav-logo .blink {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--green);
  margin-left: 2px;
  vertical-align: middle;
}

.nav-links {
  display: flex; gap: 2rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-size: .75rem;
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--muted);
  transition: color .2s;
}

.nav-links a::before { margin-right: .3em; opacity: .4; }
.nav-links a:hover,
.nav-links a.active { color: var(--green); }

/* hero */
#typingText {
  color: var(--green);
}

#hero-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative; z-index: 2;
}

#hero {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-start;  /* era center */
  padding: 10rem 3rem 4rem;
  gap: 5rem;
}

.hero-prompt {
  font-size: 1.1rem;
  color: var(--green);
  margin-bottom: 1.2rem;
  opacity: 0;
  animation: fadeUp .5s .1s forwards;
}
.hero-prompt span { color: var(--blue); }

.hero-name {
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  color: #e8f4ff;
  letter-spacing: -.02em;
  margin-bottom: .6rem;
  opacity: 0;
  animation: fadeUp .6s .25s forwards;
}
.hero-name .accent { color: var(--green); }

.hero-role {
  font-size: .88rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp .6s .4s forwards;
}
.hero-role .tag-role {
  color: var(--purple);
  border: 1px solid rgba(191, 95, 255, .25);
  padding: .2rem .7rem;
  border-radius: 3px;
  font-size: .75rem;
}

.hero-bio {
  max-width: 560px;
  font-size: .9rem;
  line-height: 1.9;
  color: var(--text-dim);
  opacity: 0;
  animation: fadeUp .6s .55s forwards;
}
.hero-bio .hl { color: var(--green); }

.hero-stats {
  display: flex; gap: 3rem;
  margin-top: 2.5rem;
  opacity: 0;
  animation: fadeUp .6s .7s forwards;
}
.stat-val {
  font-family: var(--display);
  font-size: 2rem; font-weight: 800;
  color: var(--green); line-height: 1;
}
.stat-lbl { font-size: .7rem; color: var(--muted); margin-top: .2rem; }

.hero-cta {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-top: 2.5rem;
  opacity: 0;
  animation: fadeUp .6s .85s forwards;
}

/* buttons */
.btn {
  display: inline-block;
  text-decoration: none;
  padding: .65rem 1.6rem;
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .08em;
  border-radius: 3px;
  transition: all .2s;
  cursor: none;
}
.btn-green {
  background: var(--green);
  color: var(--bg);
  border: 1px solid var(--green);
}
.btn-green:hover {
  box-shadow: 0 0 20px var(--green-glow), 0 0 40px var(--green-glow);
}
.btn-outline {
  background: transparent;
  color: var(--green);
  border: 1px solid rgba(4, 229, 0, 0.3);
}
.btn-outline:hover {
  border-color: var(--green);
  background: var(--green-glow);
}

/* avatar */
.hero-avatar {
  opacity: 0;
  align-self: flex-start;
  margin-top: -0.4rem;
  animation: fadeIn .8s .5s forwards;
  flex-shrink: 0;
}
.avatar-frame {
  position: relative;
  width: clamp(200px, 20vw, 280px);
  height: clamp(200px, 20vw, 280px);
}
.avatar-hex {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: none;
  animation: spinSlow 20s linear infinite;
}
.avatar-hex::before {
  content: '';
  position: absolute; inset: 10px;
  border-radius: 50%;
  border: 1.5px dashed rgba(121, 0, 213, 0.63);
}
.avatar-circle {
  position: absolute; inset: 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #00ff22;
  background: var(--surface);
  box-shadow:
    0 0 15px rgba(136, 0, 255, 0.4),
    0 0 40px rgba(0, 255, 34, .2),
    0 0 80px rgba(0, 255, 34, .1),
    inset 0 0 40px rgba(0, 0, 0, .4);
  transition: box-shadow .4s ease, transform .4s cubic-bezier(.34, 1.56, .64, 1);
}
.avatar-circle:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 25px var(--purple-glow),
    0 0 60px rgba(191, 0, 255, 0.3),
    0 0 100px rgba(153, 0, 255, 0.15),
    inset 0 0 40px rgba(0, 0, 0, .4);
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-size: 3.5rem; font-weight: 800;
  color: var(--green);
  background: linear-gradient(135deg, #0f1018 0%, #1a0f2e 100%);
  text-shadow: 0 0 30px var(--green-glow);
}
.avatar-badge {
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--green);
  color: var(--green);
  font-size: .65rem;
  padding: .25rem .8rem;
  border-radius: 2px;
  white-space: nowrap;
  letter-spacing: .12em;
  box-shadow: 0 0 40px rgba(0, 255, 159, .1), 0 0 80px rgba(191, 95, 255, .1), inset 0 0 40px rgba(0, 0, 0, .4);
}
.avatar-badge::before {
  content: '● ';
  animation: blink 1.4s ease-in-out infinite;
}

/* shared section */
.section-wrap {
  position: relative; z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 3rem;
}
.sec-label {
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: .5rem;
}
.sec-label::before { content: '> '; }
.sec-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 800;
  color: #ddeeff;
  margin-bottom: 3rem;
  letter-spacing: -.02em;
}
.sec-title .dim { color: var(--muted); font-weight: 400; }
.sec-divider {
  width: 100%; height: 1px;
  background: linear-gradient(to right, var(--green), var(--purple), transparent);
  margin-bottom: 3.5rem;
  opacity: .3;
}

/* exp */
.timeline { display: flex; flex-direction: column; }

.job {
  display: grid;
  grid-template-columns: 1fr;
  gap: .6rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s, transform .5s;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.job-header-left {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.job-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
  flex-shrink: 0;
}
.job.visible { opacity: 1; transform: none; }
.job:last-child { border-bottom: 1px solid var(--border); }

.job-period {
  font-size: .72rem;
  color: var(--green);
  letter-spacing: .06em;
  margin-bottom: .3rem;
  font-weight: 700;
}

.job-company-box {
  font-size: .78rem;
  color: var(--purple);
  margin-bottom: .1rem;
  font-weight: 700;
  display: inline-block;
  width: fit-content;
  border: 1px solid rgba(191, 95, 255, .25);
  background: rgba(191, 95, 255, .05);
  padding: .2rem .65rem;
  border-radius: 2px;
  letter-spacing: .05em;
}
.job-location { font-size: .72rem; color: var(--second-green);    }

.job-title {
  font-family: var(--display);
  font-size: 1.2rem; font-weight: 700;
  color: #ddeeff;
  margin-bottom: .5rem;
}
.job-desc {
  font-size: .9rem;
  line-height: 1.85;
  color: var(--text-dim);
  margin-bottom: .9rem;
  white-space: pre-line;
}
.job-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .68rem;
  padding: .2rem .65rem;
  background: rgba(8, 229, 0, 0.05);
  border: 1px solid rgba(0, 229, 34, 0.15);
  border-radius: 2px;
  color: var(--green-dim);
  letter-spacing: .05em;
}

/* skillset */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.8rem 4rem;
  align-items: start;
}

.skills-category {
  grid-column: 1 / -1;
  font-size: .65rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--second-green);
  border-left: 2px solid var(--green);
  padding-left: .7rem;
  margin-top: 1rem;
}

.skill-item {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity .5s, transform .5s;
}
.skill-item.visible { opacity: 1; transform: none; }

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .5rem;
}
.skill-name { font-size: .78rem; font-weight: 500; color: var(--text); letter-spacing: .04em; }
.skill-name .lang {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--blue);
  border-radius: 0;
  margin-right: .5rem;
  vertical-align: middle;
  font-size: 0;
}

.skill-pct {
  position: absolute;
  right: -38px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .68rem;
  color: var(--green);
  font-weight: 700;
  letter-spacing: .05em;
  white-space: nowrap;
}

.skill-bar-bg {
  height: 8px;
  background: var(--border);
  border-radius: 0;
  position: relative;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 0;
  background: linear-gradient(90deg, var(--purple-dim), var(--green));
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(.4, 0, .2, 1);
  position: relative;
}

.skill-item.visible .skill-bar-fill {
  transform: scaleX(var(--pct));
}

.skill-bar-fill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--purple-dim), var(--green));
  filter: blur(6px);
  opacity: .7;
  z-index: -1;
  transform: translateY(2px);
}

.skill-bar-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0;
  width: 3px;
  height: 100%;
  background: #fff;
  opacity: .6;
  box-shadow: 0 0 6px var(--green), 0 0 12px var(--green);
}

/* contact */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

/* terminal window */
.terminal-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 229, 160, .06), 0 30px 80px rgba(0, 0, 0, .5);
}
.term-bar {
  background: #0c0b14;
  border-bottom: 1px solid var(--border);
  padding: .65rem 1rem;
  display: flex; align-items: center; gap: .6rem;
}
.term-dot { width: 12px; height: 12px; border-radius: 50%; }
.term-dot.red    { background: #ff5f56; }
.term-dot.yellow { background: #ffbd2e; }
.term-dot.green  { background: #27c93f; }
.term-title { margin-left: .6rem; font-size: .72rem; color: var(--muted); letter-spacing: .08em; }

.term-body {
  padding: 1.8rem 2rem;
  min-height: 340px;
  font-size: .82rem;
  line-height: 1.7;
}

/* terminal lines */
.term-line { margin-bottom: .3rem; color: var(--text-dim); }
.term-line .prompt { color: var(--green); margin-right: .4rem; user-select: none; }
.term-line .cmd    { color: var(--text); }
.term-line .comment { color: var(--muted); font-style: italic; }
.term-line .output  { color: var(--green-dim); }
.term-line.is-error  { color: #ff6b6b; }
.term-line.is-success { color: var(--green); font-weight: 500; }

.term-input-row {
  display: flex; align-items: center;
  margin-bottom: .4rem; gap: .5rem;
}
.term-input-label { color: var(--green); white-space: nowrap; font-size: .82rem; }
.term-input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--mono); font-size: .82rem;
  flex: 1; caret-color: var(--green);
}

.term-textarea {
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--mono); font-size: .82rem;
  resize: none; width: 100%; caret-color: var(--green); line-height: 1.6;
}
.term-input::placeholder,
.term-textarea::placeholder { color: var(--muted); opacity: .6; }

.term-submit-row {
  margin-top: 1rem;
  display: flex; align-items: center; gap: 1rem;
}
.term-submit {
  background: transparent;
  border: 1px solid rgba(0, 229, 4, 0.4);
  color: var(--green);
  font-family: var(--mono);
  font-size: .78rem;
  padding: .5rem 1.4rem;
  border-radius: 3px;
  cursor: none;
  transition: all .2s;
  letter-spacing: .08em;
}
.term-submit:hover {
  background: var(--green-glow);
  border-color: var(--green);
  box-shadow: 0 0 14px var(--green-glow);
}
.term-submit:disabled { opacity: .4; pointer-events: none; }

.term-sending {
  display: none;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  color: var(--muted);
}
.term-sending.visible { display: flex; }
.spinner {
  width: 10px; height: 10px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

#termOutput { margin-top: .6rem; }

/* contact */
.contact-aside { display: flex; flex-direction: column; gap: 1.2rem; }
.aside-title { font-size: .65rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }

.contact-row {
  display: flex; align-items: flex-start; gap: .8rem;
  opacity: 0; transform: translateX(12px);
  transition: opacity .5s, transform .5s;
}
.contact-row.visible { opacity: 1; transform: none; }
.contact-key  { color: var(--blue); min-width: 80px; font-size: .78rem; }
.contact-val  { color: var(--text-dim); font-size: .78rem; }
.contact-val a { color: var(--green); text-decoration: none; }
.contact-val a:hover { text-decoration: underline; }
.status-open  { color: var(--green); }
.online-badge {
  color: var(--green);
  font-size: .7rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.online-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: statusBlink 1.8s ease-in-out infinite;
  box-shadow: 0 0 6px var(--green), 0 0 12px var(--green-glow);
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green), 0 0 12px var(--green-glow); }
  50%       { opacity: .3; box-shadow: none; }
}

/* footer */
footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--border);
  padding: 2rem 3rem;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--footer-font);
  font-size: 1.1rem;
}
.foot-copy { font-size: .72rem; color: var(--muted); }
.foot-copy .hl { color: var(--green); }
.foot-links { display: flex; gap: 1.5rem; }
.foot-links a {
  font-size: .72rem; color: var(--muted);
  text-decoration: none; transition: color .2s;
}
.foot-links a:hover { color: var(--green); }

/* projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s, transform .5s, border-color .2s;
}
.project-card.visible { opacity: 1; transform: none; }
.project-card:hover { border-color: rgba(0, 255, 159, .25); }

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.project-status { font-size: .7rem; letter-spacing: .08em; }

.project-status .status-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: .4rem;
  vertical-align: middle;
  animation: statusBlink 1.8s ease-in-out infinite;
}

.project-status .status-dot.live {
  background: var(--green);
  box-shadow: 0 0 6px var(--green), 0 0 12px var(--green-glow);
}

.project-status .status-dot.wip {
  background: #ffbd2e;
  box-shadow: none;
  animation: none;
}

.project-status .status-dot.archived {
  background: #818181;
  box-shadow: none;
  animation: none;
}

.project-status .status-dot.learning {
  background: var(--purple);
  box-shadow: 0 0 6px var(--purple), 0 0 12px var(--pur-glow);
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green), 0 0 12px var(--green-glow); }
  50%       { opacity: .3; box-shadow: none; }
}

.project-name {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  color: #ddeeff;
}

.project-name-row {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.project-icon {
  font-size: 1.4rem;
  color: var(--green);
  opacity: .8;
  flex-shrink: 0;
}

.project-desc {
  font-size: .8rem;
  line-height: 1.75;
  color: var(--text-dim);
  flex: 1;
}
.project-link {
  font-size: .72rem;
  color: var(--green);
  text-decoration: none;
  letter-spacing: .06em;
  transition: opacity .2s;
}
.project-link:hover { opacity: .7; }

/* animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  nav { padding: .8rem 1.5rem; }

  #hero {
    grid-template-columns: 1fr;
    padding: 6rem 1.5rem 3rem;
  }
  .hero-avatar { order: -1; display: flex; justify-content: center; }

  .section-wrap { padding: 3.5rem 1.5rem; }

  .skills-grid { grid-template-columns: 1fr; gap: 1.4rem; }

  .job { grid-template-columns: 1fr; gap: .4rem; }

  .contact-layout { grid-template-columns: 1fr; }

  footer { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .hero-stats { gap: 1.5rem; }
  .term-body { padding: 1.2rem; }
}
