:root {
  --bg: #101010;
  --panel: #1f1f1f;
  --panel-2: #252525;
  --line: #333;
  --text: #f5f5f5;
  --muted: #858585;
  --green: #8ac94a;
  --blue: #8bb8ef;
  --salmon: #d59b89;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  overflow-x: hidden;
}
body.terminal-active { overflow: hidden; }

.terminal-switch {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--green);
  border-radius: 4px;
  background: #151515;
  color: var(--green);
  font: 700 13px "JetBrains Mono", monospace;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0,0,0,.28);
}

.wrapper { width: min(1040px, calc(100% - 56px)); margin: 0 auto; padding: 62px 0 78px; }
.hero { display: grid; grid-template-columns: minmax(280px, .95fr) minmax(0, 1.08fr); gap: clamp(28px, 4.4vw, 54px); align-items: center; }
h1 { margin: 0 0 4px; font-size: clamp(34px, 4.2vw, 42px); line-height: 1.1; letter-spacing: 0; }
.subtitle, .section-title, .tech-stack, label, .api-explorer { font-family: "JetBrains Mono", monospace; }
.subtitle { color: var(--green); font-size: 16px; margin: 0 0 20px; }
.profile-img {
  width: min(100%, 360px);
  max-height: min(62vh, 760px);
  height: auto;
  aspect-ratio: 720 / 937;
  object-fit: contain;
  object-position: center;
  border-radius: 6px;
  display: block;
  background: #fff;
}
.bio, .project-desc { color: var(--muted); font-size: 15px; line-height: 1.65; }
.bio { max-width: 90%; margin: 26px 0 32px; }
.links-container { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 20px; border-radius: 4px; text-decoration: none; font-weight: 700; font-size: 14px; transition: transform .18s, border-color .18s, background .18s; }
.btn:hover, button:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #101010; border: 1px solid var(--green); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid #3d3d3d; }
.btn-secondary:hover { border-color: var(--green); color: var(--green); }

.api-section { padding-top: 0; }
.api-explorer, .contact-form-container { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 28px 80px rgba(0,0,0,.3); overflow: hidden; }
.window-controls { height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.red { background:#ff5f56; } .yellow { background:#ffbd2e; } .green { background:#27c93f; }
.terminal-close-dot {
  padding: 0;
  border: 0;
  cursor: pointer;
}
.terminal-close-dot:hover {
  transform: scale(1.18);
  box-shadow: 0 0 0 4px rgba(255, 95, 86, .14);
}
.api-explorer-header { height: 60px; display: flex; align-items: center; gap: 11px; padding: 0 22px; border-bottom: 1px solid var(--line); color:#e7e7e7; font-size: 18px; }
.request-bar { display: grid; grid-template-columns: minmax(80px, 96px) minmax(0,1fr) 28px minmax(92px,112px); gap: 11px; align-items: center; padding: 17px 22px; background: #242424; border-bottom: 1px solid var(--line); }
select, button, input, textarea { font: inherit; }
.http-method, .endpoint-select, .execute-btn, .copy-icon-btn { height: 48px; background: #1f1f1f; color: var(--green); border: 1px solid #3b3b3b; border-radius: 4px; font-size: clamp(13px, 1.45vw, 18px); }
.endpoint-select { color: #ededed; padding: 0 13px; min-width: 0; text-overflow: ellipsis; }
.execute-btn { cursor: pointer; }
.copy-icon-btn { display: grid; place-items: center; cursor: pointer; }
.copy-icon-btn svg { width: 17px; height: 17px; fill: none; stroke: #858585; stroke-width: 2; }
.response-panel { height: clamp(260px, 36vw, 376px); overflow: auto; padding: clamp(14px, 1.7vw, 22px); background: #111; color: #ddd; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-size: clamp(12px, 1.3vw, 17px); }
.prompt, .ok, .json-key { color: var(--green); }
.json-str { color: var(--salmon); }
.json-num { color: var(--blue); }
.cursor { display:inline-block; width: 7px; height: 1em; background: var(--green); margin-left: 2px; vertical-align: -2px; animation: blink .8s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.skills-wrapper,
.projects-wrapper,
.experience-wrapper { margin-top: 62px; }
.section-title { font-size: clamp(28px, 4.2vw, 40px); line-height: 1; margin: 0 0 clamp(34px, 6.5vw, 82px); }
.section-title span { color: var(--green); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.skills-grid article {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 17px;
}
.skills-grid h3 {
  margin: 0 0 10px;
  color: var(--green);
  font: 700 14px "JetBrains Mono", monospace;
}
.skills-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.project-row { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .9fr); gap: clamp(30px, 5vw, 62px); align-items: center; margin-bottom: clamp(58px, 8vw, 108px); }
.project-row.reverse { grid-template-columns: .9fr 1.08fr; }
.carousel-container {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  min-height: 260px;
  background: #0f0f0f;
  border: 1px solid var(--line);
}
.carousel-slide {
  width: 100%;
  max-width: 100%;
  display: none;
  aspect-ratio: 1265 / 712;
}
img.carousel-slide {
  height: auto;
  max-height: min(56vw, 712px);
  object-fit: contain !important;
  background: #0f0f0f;
}
.carousel-slide.active { display: block; }
.project-placeholder {
  min-height: clamp(190px, 28vw, 310px);
  aspect-ratio: 1265 / 712;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(139,201,74,.08) 1px, transparent 1px),
    linear-gradient(rgba(139,201,74,.08) 1px, transparent 1px),
    #141414;
  background-size: 28px 28px;
  color: var(--green);
  font: 700 17px "JetBrains Mono", monospace;
  border: 1px dashed #3c3c3c;
}
.project-placeholder.active { display: grid; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(32,32,32,.72); color: white; font-size: 25px; cursor: pointer; }
.carousel-btn:hover { background: var(--green); color: #101010; transform: translateY(-50%) scale(1.04); }
.prev { left: 16px; } .next { right: 16px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; gap: 9px; }
.dot-indicator { width: 8px; height: 8px; background: #565656; border-radius: 50%; }
.dot-indicator.active { background: var(--green); }
.project-title { margin: 0 0 14px; font-size: clamp(24px, 3.4vw, 31px); line-height: 1; }
.tech-stack { margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 10px; color: #ddd; font-size: clamp(13px, 1.7vw, 18px); }
.tech-stack b { color: var(--green); }
.project-desc { font-size: clamp(15px, 1.9vw, 21px); margin: 0 0 28px; }
.btn-sm { min-height: 48px; font-size: clamp(14px, 1.7vw, 19px); padding: 0 20px; }

.experience-wrapper { margin-bottom: 66px; }
.timeline {
  position: relative;
  display: grid;
  gap: 28px;
  max-width: 860px;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 166px;
  width: 2px;
  background: linear-gradient(var(--green), #3e3e3e);
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 135px 32px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.timeline-date {
  color: var(--text);
  font: 700 14px "JetBrains Mono", monospace;
  line-height: 1.35;
  text-align: right;
  padding-top: 10px;
}
.timeline-node {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin: 13px auto 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(138, 201, 74, .12);
}
.timeline-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 18px 20px;
}
.timeline-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font: 700 13px "JetBrains Mono", monospace;
}
.timeline-card h3 {
  margin: 0 0 12px;
  font-size: clamp(20px, 2.5vw, 26px);
  line-height: 1.1;
}
.timeline-card p,
.timeline-card li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.timeline-card p { margin: 0 0 12px; }
.timeline-card ul {
  margin: 0;
  padding-left: 20px;
}
.timeline-card li + li { margin-top: 6px; }

.contact-wrapper { margin-top: 28px; }
.contact-form-container { max-width: 1010px; }
.contact-form-body { padding: 52px 0 50px; max-width: 620px; margin: 0 auto; }
.contact-form-body .project-desc { margin-bottom: 26px; }
.contact-form { display: grid; gap: 15px; }
label { color: var(--green); display: grid; gap: 9px; }
.form-control { width: 100%; border: 1px solid #3b3b3b; background: #111; color: var(--text); border-radius: 4px; min-height: 60px; padding: 0 20px; font-family: "Space Grotesk", sans-serif; font-size: 21px; }
textarea.form-control { min-height: 164px; padding-top: 16px; resize: vertical; }
.btn-submit { width: max-content; margin-top: 10px; cursor: pointer; }
.form-status { min-height: 22px; color: var(--green); margin: 0; font-family: "JetBrains Mono", monospace; }
.form-status-error { color: #ff6b5f; }
button:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

.terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  padding: clamp(14px, 3vw, 34px);
  background: rgba(10, 10, 10, .96);
}
.terminal-overlay.active { display: grid; place-items: center; }
.terminal-shell {
  width: min(1040px, 100%);
  height: min(760px, calc(100vh - clamp(28px, 6vw, 68px)));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: 0 30px 100px rgba(0,0,0,.48);
}
.terminal-titlebar {
  flex: 0 0 auto;
  position: relative;
}
.terminal-title {
  margin-left: 10px;
  color: #ddd;
  font: 700 14px "JetBrains Mono", monospace;
}
.terminal-screen {
  flex: 1;
  overflow-y: auto;
  padding: clamp(18px, 3vw, 30px);
  background: #101010;
  color: #dcdcdc;
  font: 14px/1.6 "JetBrains Mono", monospace;
}
.terminal-banner,
.terminal-line,
.terminal-result {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.terminal-banner { color: var(--muted); }
.terminal-banner::first-line { color: var(--text); }
.terminal-output {
  display: grid;
  gap: 8px;
}
.terminal-entry {
  display: grid;
  gap: 4px;
}
.terminal-input-line,
.terminal-line {
  display: flex;
  align-items: center;
  gap: 9px;
}
.terminal-input-line {
  margin-top: 10px;
}
.terminal-prompt {
  flex: 0 0 auto;
  color: var(--green);
}
.terminal-input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  caret-color: var(--green);
  font: inherit;
}
.terminal-result {
  color: var(--muted);
  padding-left: 0;
}
.terminal-result a {
  color: var(--green);
}
.terminal-command-name,
.terminal-success { color: var(--green); }
.terminal-error { color: #ff6b5f; }
.terminal-muted { color: var(--muted); }
.neofetch-block {
  display: grid;
  grid-template-columns: minmax(250px, .74fr) minmax(260px, 1fr);
  gap: clamp(18px, 3vw, 30px);
  align-items: start;
  margin-bottom: 18px;
}
.neofetch-art {
  margin: 0;
  overflow: auto hidden;
  color: var(--green);
  font: 700 clamp(9px, 1.1vw, 14px)/1.08 "JetBrains Mono", monospace;
  letter-spacing: 0;
  white-space: pre;
}
.neofetch-info {
  min-width: 0;
  padding-top: 4px;
}
.neofetch-info p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.neofetch-info span {
  color: var(--green);
}
.terminal-hint {
  margin: 0 0 14px;
  padding-top: 14px;
  border-top: 1px dashed #323232;
  color: var(--muted);
  white-space: pre-wrap;
}
.terminal-hint span {
  color: var(--green);
}
@media (max-width: 980px) {
  .wrapper { padding-top: 58px; width: min(96%, 640px); }
  .hero, .project-row, .project-row.reverse { grid-template-columns: 1fr; gap: 20px; }
  .profile-section {
    display: grid;
    grid-template-columns: clamp(58px, 16vw, 65px) minmax(0, 1fr);
    grid-template-areas:
      "photo title"
      "photo subtitle"
      "bio bio"
      "links links";
    column-gap: 14px;
    row-gap: 0;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    padding: 14px 12px;
  }
  .profile-section h1 {
    grid-area: title;
    margin: 0;
    font-size: clamp(22px, 5vw, 31px);
    align-self: end;
  }
  .profile-section .subtitle {
    grid-area: subtitle;
    font-size: 13px;
    margin: 3px 0 0;
    align-self: start;
  }
  .profile-section .profile-img {
    grid-area: photo;
    width: clamp(58px, 16vw, 65px);
    height: clamp(58px, 16vw, 65px);
    max-height: clamp(58px, 16vw, 65px);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;
  }
  .profile-section .bio {
    grid-area: bio;
    margin: 11px 0 0;
    max-width: 100%;
    font-size: 13px;
    line-height: 1.5;
  }
  .profile-section .links-container {
    grid-area: links;
    margin-top: 12px;
    gap: 8px;
  }
  .api-section { padding-top: 0; }
  h1 { font-size: 33px; }
  .section-title { font-size: 27px; margin-bottom: 22px; }
  .skills-wrapper,
  .projects-wrapper,
  .experience-wrapper { margin-top: 46px; }
  .contact-form-body { padding: 25px 18px; }
  .request-bar { grid-template-columns: 76px 1fr; }
  .copy-icon-btn, .execute-btn { width: 100%; }
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .skills-grid article { padding: 15px; }
  .skills-grid h3 { font-size: 13px; margin-bottom: 9px; }
  .timeline::before { left: 15px; }
  .timeline-item { grid-template-columns: 30px minmax(0, 1fr); gap: 13px; }
  .timeline-date {
    grid-column: 2;
    text-align: left;
    padding-top: 0;
  }
  .timeline-node {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin-top: 5px;
  }
  .timeline-card { grid-column: 2; }
}

@media (max-width: 720px) {
  body { font-size: 90%; }
  .terminal-switch {
    top: 9px;
    right: calc(2vw + 4px);
    height: 28px;
    padding: 0 8px;
    font-size: 9px;
  }
  .wrapper { width: min(96%, 580px); padding: 50px 0 40px; }
  .hero { gap: 16px; }
  .profile-section {
    padding: 11px 10px;
    grid-template-columns: clamp(52px, 15vw, 58px) minmax(0, 1fr);
    column-gap: 11px;
  }
  .profile-section .profile-img {
    width: clamp(52px, 15vw, 58px);
    height: clamp(52px, 15vw, 58px);
    max-height: clamp(52px, 15vw, 58px);
  }
  .profile-section .bio { margin-top: 10px; font-size: 12px; line-height: 1.5; }
  .profile-section .links-container { margin-top: 10px; gap: 7px; }
  .profile-section h1 { font-size: clamp(20px, 4.8vw, 28px); line-height: 1.05; }
  .profile-section .subtitle { font-size: 12px; margin-top: 2px; }
  .links-container { display: grid; grid-template-columns: 1fr; gap: 7px; }
  .btn { width: 100%; min-height: 34px; padding: 0 16px; font-size: 13px; }
  .api-explorer-header { height: 38px; padding: 0 11px; font-size: 13px; gap: 8px; }
  .window-controls { height: 28px; padding: 0 10px; gap: 5px; }
  .request-bar { grid-template-columns: 1fr; padding: 9px; gap: 7px; }
  .http-method, .endpoint-select, .execute-btn, .copy-icon-btn { width: 100%; height: 34px; font-size: 12px; }
  .copy-icon-btn { display: none; }
  .response-panel {
    height: clamp(200px, 28vw, 280px);
    padding: 11px;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .section-title { font-size: 24px; margin-bottom: 18px; }
  .skills-wrapper,
  .projects-wrapper,
  .experience-wrapper { margin-top: 40px; }
  .skills-grid { grid-template-columns: 1fr; gap: 9px; }
  .skills-grid article { padding: 11px 12px; }
  .skills-grid h3 { font-size: 12px; margin-bottom: 6px; }
  .skills-grid p { font-size: 13px; line-height: 1.45; }
  .project-row, .project-row.reverse { grid-template-columns: 1fr; gap: 16px; margin-bottom: 40px; }
  .project-row.reverse .project-content { order: 2; }
  .project-row.reverse .carousel-container { order: 1; }
  .project-title { font-size: clamp(22px, 3vw, 28px); margin-bottom: 8px; line-height: 1; }
  .tech-stack { font-size: clamp(12px, 1.5vw, 16px); gap: 7px; margin-bottom: 14px; }
  .project-desc { font-size: clamp(14px, 1.7vw, 19px); margin-bottom: 16px; line-height: 1.5; }
  .btn-sm { min-height: 38px; font-size: clamp(13px, 1.5vw, 17px); padding: 0 16px; }
  img.carousel-slide { max-height: none; }
  .carousel-container { min-height: 190px; }
  .project-placeholder { min-height: 150px; font-size: 15px; }
  .carousel-btn { width: 28px; height: 28px; font-size: 20px; }
  .prev { left: 12px; } .next { right: 12px; }
  .experience-wrapper { margin-bottom: 36px; }
  .timeline { gap: 16px; }
  .timeline-card { padding: 11px 12px; }
  .timeline-card h3 { font-size: clamp(18px, 2.2vw, 23px); margin-bottom: 7px; line-height: 1.05; }
  .timeline-card p,
  .timeline-card li { font-size: 13px; line-height: 1.5; }
  .timeline-card p { margin-bottom: 8px; }
  .timeline-kicker { font-size: 12px; margin-bottom: 5px; }
  .contact-wrapper { margin-top: 20px; }
  .contact-form-body { padding: 16px 10px; }
  .contact-form-body .project-desc { margin-bottom: 16px; font-size: 14px; line-height: 1.5; }
  .contact-form { gap: 10px; }
  label { gap: 6px; font-size: 13px; }
  .form-control { min-height: 38px; padding: 0 12px; font-size: 14px; }
  textarea.form-control { min-height: 96px; padding-top: 9px; }
  .btn-submit { width: 100%; margin-top: 6px; }
  .form-status { min-height: 18px; font-size: 12px; }
  .terminal-overlay { padding: 9px; }
  .terminal-shell { height: calc(100vh - 18px); }
  .terminal-screen { font-size: 11px; padding: 14px; }
  .neofetch-block { grid-template-columns: 1fr; gap: 9px; }
  .neofetch-art { font-size: clamp(6px, 1.85vw, 8px); max-width: 100%; }
  .terminal-title { font-size: 11px; }
}

@media (max-width: 420px) {
  .wrapper { width: 96%; }
  .window-controls { height: 28px; }
  .section-title { overflow-wrap: anywhere; }
  .response-panel { max-height: 260px; }
}
