* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family:
    "Fira Code", "Courier New", "SF Mono", "Segoe UI Mono", monospace;
  background: #0a0c10;
  color: #e0e0e0;
  line-height: 1.5;
  font-size: 14px;
  min-width: 20px;
  overflow-x: auto;
  overflow-y: scroll;
  word-wrap: break-word;
}

@supports (font-size: clamp(1px, 2vw, 3px)) {
  body {
    font-size: clamp(8px, 4vw, 20px);
  }
}

@supports (scroll-behavior: smooth) {
  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #1a1f2a;
}
::-webkit-scrollbar-thumb {
  background: #2aff9e;
  border-radius: 3px;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #2aff9e #1a1f2a;
}
.navbar {
  background: #0f1217;
  padding: 0.8rem 1.5rem;
  color: #2aff9e;
  border-bottom: 1px solid #2aff9e;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
}
.navbar::after {
  content: "";
  clear: both;
  display: table;
}
.logo {
  font-size: 1.4rem;
  font-weight: bold;
  letter-spacing: 1px;
  text-shadow: 0 0 5px #2aff9e;
  float: left;
}
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  float: right;
}
.nav-links li {
  display: inline-block;
  margin-left: 1rem;
}
.nav-links a {
  color: #c3ffd6;
  text-decoration: none;
  font-size: 0.9rem;
  transition: 0.2s;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-block;
  min-height: 44px;
  line-height: 1.5;
}
.nav-links a:hover {
  color: #2aff9e;
  background: #1e2a2a;
}
.hamburger {
  display: none;
  background: none;
  border: 1px solid #2aff9e;
  color: #2aff9e;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  min-width: 44px;
  min-height: 44px;
  float: right;
  margin-left: 0.5rem;
}
.terminal-toggle {
  background: none;
  border: 1px solid #2aff9e;
  color: #2aff9e;
  font-size: 1rem;
  font-weight: bold;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: monospace;
  min-height: 44px;
  float: right;
  margin-left: 0.5rem;
}

@supports (display: flex) {
  .navbar {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .navbar::after {
    display: none;
  }
  .logo {
    float: none;
  }
  .nav-links {
    float: none;
  }
  .hamburger,
  .terminal-toggle {
    float: none;
    margin-left: 0;
  }
  .navbar > :not(:last-child) {
    margin-right: 0.5rem;
  }
  .navbar > :last-child {
    margin-right: 0;
  }
  @media (max-width: 600px) {
    .navbar {
      gap: 0.5rem;
    }
  }
}

main {
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.section {
  background: #11141c;
  border-radius: 16px;
  border: 1px solid rgba(42, 255, 158, 0.5);
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: all 0.2s;
  overflow-x: auto;
}
.section h2 {
  color: #2aff9e;
  border-right: 4px solid #2aff9e;
  padding-right: 1rem;
  margin-bottom: 1.2rem;
  font-size: 1.5rem;
}
.typewriter {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  min-height: 4rem;
  direction: ltr;
  text-align: left;
}

.skills-grid {
  display: block;
}
.skill-cat {
  display: block;
  width: 100%;
  margin-bottom: 1.5rem;
}
.skill-cat h3 {
  color: #ffcc66;
  margin-bottom: 0.8rem;
}
.skill-item {
  margin-bottom: 0.8rem;
}
.skill-name {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}
.skill-bar {
  background: #1e2a2a;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.skill-fill {
  background: #2aff9e;
  width: 0%;
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

@supports (display: grid) {
  .skills-grid {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: (minmax(250px, 1fr)) [auto-fit];
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
  }
  .skill-cat {
    margin-bottom: 0;
  }
}

.stats {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 1rem;
  text-align: center;
}
.stat-card {
  background: #0c0f16;
  padding: 1rem;
  border-radius: 12px;
  min-width: 100px;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
}
.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #2aff9e;
}
@supports not (display: flex) {
  .stats {
    display: block;
    text-align: center;
  }
  .stat-card {
    display: inline-block;
    width: 45%;
    margin: 0.5rem;
    vertical-align: top;
  }
}

.timeline {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  gap: 1.2rem;
}
.job {
  border-right: 2px solid #2aff9e;
  padding-right: 1rem;
}
.job-title {
  font-weight: bold;
  color: #ffcc66;
}
.job-date {
  font-size: 0.8rem;
  color: #7e8a98;
}

.projects-grid {
  display: block;
}
.project-card {
  background: #0c0f16;
  border: 1px solid rgba(42, 255, 158, 0.25);
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.2s,
    border-color 0.2s;
  margin-bottom: 1rem;
  width: 100%;
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: #2aff9e;
}
.project-card img {
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid rgba(42, 255, 158, 0.25);
  background: #1e2a2a;
}

@supports not (object-fit: cover) {
  .project-card img {
    object-fit: fill;
    height: auto;
    max-height: 160px;
  }
}
.project-info {
  padding: 1rem;
}
.project-info h3 {
  color: #2aff9e;
  margin-bottom: 0.5rem;
}
.project-tags {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}
.tag {
  background: #1e2a2a;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-size: 0.7rem;
  color: #2aff9e;
}

@supports (display: grid) {
  .projects-grid {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: (minmax(280px, 1fr)) [auto-fill];
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  .project-card {
    margin-bottom: 0;
  }
}

.contact-form {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
  width: 100%;
}
.contact-form input,
.contact-form textarea {
  background: #0c0f16;
  border: 1px solid rgba(42, 255, 158, 0.38);
  padding: 0.8rem;
  border-radius: 8px;
  color: #fff;
  font-family: monospace;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}
.contact-form button {
  background: rgba(42, 255, 158, 0.125);
  border: 1px solid #2aff9e;
  color: #2aff9e;
  padding: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  min-height: 44px;
}

footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid rgba(42, 255, 158, 0.25);
  margin-top: 2rem;
  font-size: 0.8rem;
}
.social-links a {
  color: #2aff9e;
  text-decoration: none;
  margin: 0 0.5rem;
  display: inline-block;
  padding: 0.3rem;
}

.console-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #06080c;
  display: block;
  z-index: 1000;
}
.console-overlay.hidden {
  display: none;
}

@supports (display: flex) {
  .console-overlay {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
  }
}
@supports (backdrop-filter: blur(10px)) {
  .console-overlay {
    background: rgb(6, 8, 12);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}
.console-box {
  background: #0b0e14;
  border: 1px solid #2aff9e;
  border-radius: 14px;
  width: 90vw;
  max-width: 800px;
  height: 70vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.console-header {
  padding: 0.7rem;
  background: #07090e;
  border-bottom: 1px solid rgba(42, 255, 158, 0.31);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}
.close-console {
  background: none;
  border: none;
  color: #ff6b6b;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 0.5rem;
}
.console-log {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  font-size: 0.8rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  gap: 6px;
}
.log-entry {
  line-height: 1.4;
  word-break: break-word;
}
.command-line {
  color: #ffcc66;
}
.output-line {
  color: #9effcf;
  margin-right: 16px;
  border-right: 2px solid rgba(42, 255, 158, 0.38);
  padding-right: 12px;
}
.system-line {
  color: #7e8a98;
  font-size: 0.75rem;
}
.input-line {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  padding: 0.7rem;
  border-top: 1px solid rgba(42, 255, 158, 0.19);
  background: #07090e;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}
.prompt {
  color: #2aff9e;
  margin-left: 8px;
}
.console-input {
  background: transparent;
  border: none;
  color: #f5f06b;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  outline: none;
  font-family: monospace;
  font-size: 0.9rem;
}
.cursor-blink {
  display: inline-block;
  width: 8px;
  height: 1.2rem;
  background: #2aff9e;
  -webkit-animation: blink 1s infinite;
  animation: blink 1s infinite;
}
@-webkit-keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-blink,
  .skill-fill,
  .project-card,
  .typewriter,
  * {
    -webkit-animation: none !important;
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 40px) {
  body {
    font-size: 6px;
    overflow-x: scroll;
  }
  .navbar,
  .section,
  .stats,
  .project-card,
  .console-box {
    min-width: 150px;
  }
  .nav-links a {
    white-space: normal;
    font-size: 0.6rem;
    padding: 0.2rem;
  }
  .logo {
    font-size: 0.8rem;
  }
  .terminal-toggle {
    font-size: 0.6rem;
    padding: 0.2rem;
  }
}
@media (max-width: 20px) {
  body {
    font-size: 4px;
    overflow-x: auto;
  }
  .navbar,
  .section,
  .stats,
  .project-card,
  .console-box {
    min-width: 200px;
  }
}
@media (min-width: 3840px) {
  main {
    max-width: 90%;
    margin: 2rem auto;
  }
  html {
    font-size: 24px;
  }
  .section {
    padding: 2rem;
  }
  .project-card img {
    max-height: 240px;
  }
}

:focus {
  outline: 2px solid #2aff9e;
  outline-offset: 2px;
}
button:focus-visible,
a:focus-visible,
.terminal-toggle:focus-visible,
.close-console:focus-visible {
  outline: 2px solid #2aff9e;
  background: rgba(42, 255, 158, 0.2);
}

button:focus,
a:focus,
.terminal-toggle:focus,
.close-console:focus {
  outline: 2px solid #2aff9e;
  background: rgba(42, 255, 158, 0.2);
}

@media (max-width: 240px) and (max-height: 240px) {
  body {
    font-size: 10px;
  }
  .navbar {
    padding: 0.2rem;
  }
  .nav-links a {
    padding: 0.2rem;
    font-size: 0.7rem;
  }
  .section {
    padding: 0.5rem;
  }
  .stat-number {
    font-size: 1rem;
  }
  .project-card img {
    max-height: 80px;
  }
  .console-box {
    width: 95vw;
    height: 80vh;
  }
}

button,
a,
.terminal-toggle,
.close-console,
.hamburger {
  touch-action: manipulation;
}

@media print {
  .console-overlay,
  .terminal-toggle,
  .hamburger,
  .social-links,
  .contact-form button {
    display: none;
  }
  body {
    background: white;
    color: black;
  }
  .section {
    border: 1px solid #ccc;
    break-inside: avoid;
  }
  a {
    color: black;
    text-decoration: underline;
  }
}
