/* ════════════════════════════════════════════════════════════
   VARIABLES & RESET
   ════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0e13;
  --bg2:       #0f1419;
  --bg3:       #141b24;
  --border:    #1e2d3d;
  --border2:   #243447;
  --cyan:      #00d4ff;
  --green:     #39d353;
  --yellow:    #e3b341;
  --red:       #f85149;
  --purple:    #bc8cff;
  --text:      #c9d1d9;
  --text-dim:  #6e7681;
  --text-mid:  #8b949e;
  --font:      'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ─── GRID BACKGROUND ───────────────────────────────────── */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
@media (min-width: 768px) {
  body::after { background-size: 40px 40px; opacity: 0.15; }
}

/* ════════════════════════════════════════════════════════════
   LAYOUT  (mobile-first)
   ════════════════════════════════════════════════════════════ */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}
@media (min-width: 768px) { .container { padding: 0 24px; } }

section { padding: 48px 0; }
@media (min-width: 768px) { section { padding: 72px 0; } }

/* ════════════════════════════════════════════════════════════
   NAV  (mobile-first → hamburger)
   ════════════════════════════════════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 19, 0.92);
}
nav .inner {
  max-width: 900px; margin: 0 auto; padding: 0 16px;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
}
@media (min-width: 768px) { nav .inner { padding: 0 24px; } }

.nav-logo {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-host { color: var(--text-dim); }
.logo-path { color: var(--green); }

/* ─── LANG SWITCHER ─────────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.lang-sep {
  color: var(--border2);
  font-size: 11px;
  pointer-events: none;
  line-height: 1;
}
.lang-btn {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 0 6px;
  height: 26px;
  border-radius: 3px;
  transition: color .15s, border-color .15s, background .15s;
  line-height: 1;
}
.lang-btn:hover { color: var(--cyan); background: var(--bg3); }
.lang-btn.active {
  color: var(--cyan);
  border-color: rgba(0, 212, 255, .3);
  background: rgba(0, 212, 255, .06);
}

/* nav-right: wraps lang switcher + hamburger (mobile) / lang + links (desktop) */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* hamburger button — visible only on mobile */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background .15s;
  flex-shrink: 0;
}
.nav-toggle:hover { background: var(--bg3); }
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-mid);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease, background .2s;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--cyan); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--cyan); }

/* mobile dropdown */
.nav-links {
  display: none;
  flex-direction: column;
  gap: 0;
  list-style: none;
  position: absolute;
  top: 52px; left: 0; right: 0;
  background: rgba(10, 14, 19, 0.97);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.nav-links.open { display: flex; }
.nav-links a {
  display: block;
  padding: 12px 20px;
  color: var(--text-mid);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: color .2s, background .15s;
  min-height: 44px;
  display: flex; align-items: center;
}
.nav-links a:hover { color: var(--cyan); background: var(--bg3); }

/* desktop: horizontal, always visible */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex !important;
    flex-direction: row;
    gap: 24px;
    position: static;
    background: transparent;
    border: none;
    padding: 0;
  }
  .nav-links a {
    padding: 0;
    font-size: 12px;
    min-height: auto;
    display: inline;
  }
  .nav-links a:hover { background: transparent; }
}

/* ════════════════════════════════════════════════════════════
   HERO  (mobile-first)
   ════════════════════════════════════════════════════════════ */
#hero {
  padding-top: 100px;
  padding-bottom: 56px;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
}
@media (min-width: 768px) {
  #hero { padding-top: 140px; padding-bottom: 80px; }
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-mid);
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}
@media (min-width: 768px) { .hero-badge { margin-bottom: 28px; } }

.hero-badge::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.hero-name {
  font-size: clamp(32px, 9vw, 64px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 8px;
}
.hero-name .cursor {
  display: inline-block;
  width: 3px; height: 0.85em;
  background: var(--cyan);
  vertical-align: middle;
  margin-left: 4px;
  animation: blink 1s step-end infinite;
}

.hero-title {
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 500;
  color: var(--cyan);
  margin-bottom: 16px;
  letter-spacing: 0.03em;
}
.hero-title .sep { color: var(--border2); margin: 0 8px; }

.hero-desc {
  color: var(--text-mid);
  font-size: 12px;
  line-height: 1.85;
  margin-bottom: 28px;
}
@media (min-width: 768px) {
  .hero-desc { font-size: 13px; max-width: 580px; margin-bottom: 36px; }
}

.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* ════════════════════════════════════════════════════════════
   BUTTONS  (min touch target 44px)
   ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 20px;
  height: 44px;
  border-radius: 4px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}
.btn-primary { background: var(--cyan); color: var(--bg); border: none; }
.btn-primary:hover { background: #fff; box-shadow: 0 0 20px rgba(0,212,255,.4); }
.btn-ghost { background: transparent; color: var(--text-mid); border: 1px solid var(--border2); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

/* ════════════════════════════════════════════════════════════
   SECTION HEADER
   ════════════════════════════════════════════════════════════ */
.section-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
}
@media (min-width: 768px) { .section-header { gap: 14px; margin-bottom: 36px; } }

.section-num { color: var(--cyan); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; }
.section-title { font-size: 17px; font-weight: 600; color: #fff; letter-spacing: -0.01em; }
@media (min-width: 768px) { .section-title { font-size: 20px; } }
.section-line { flex: 1; height: 1px; background: var(--border); }

/* ════════════════════════════════════════════════════════════
   TABLES  (mobile: scroll + hidden columns)
   ════════════════════════════════════════════════════════════ */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; min-width: 480px; }
thead tr { background: var(--bg3); }
thead th {
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
@media (min-width: 768px) { thead th { padding: 10px 16px; font-size: 11px; } }

tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover:not(.exp-details-row) { background: var(--bg3); }
.exp-details-row { border-bottom: none; }
td { padding: 10px 12px; font-size: 12px; vertical-align: middle; }
@media (min-width: 768px) { td { padding: 12px 16px; font-size: 13px; } }

/* Skills: hide LEVEL column on mobile */
@media (max-width: 639px) {
  #skills thead th:last-child,
  #skills tbody td:last-child { display: none; }
}

/* Experience: hide PERIOD + STACK columns on mobile — user expands for details */
@media (max-width: 639px) {
  #experience thead th:nth-child(3),
  #experience thead th:nth-child(4),
  #experience tbody td:nth-child(3),
  #experience tbody td:nth-child(4) { display: none; }
  #experience table { min-width: 0; }

  .exp-bullet-list { padding: 12px 12px 12px 20px; }
}

/* ─── TAGS ──────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid;
}
@media (min-width: 768px) { .tag { font-size: 11px; padding: 2px 9px; } }
.tag-cyan   { color: var(--cyan);   border-color: rgba(0,212,255,.25); background: rgba(0,212,255,.06); }
.tag-green  { color: var(--green);  border-color: rgba(57,211,83,.25);  background: rgba(57,211,83,.06); }
.tag-purple { color: var(--purple); border-color: rgba(188,140,255,.25);background: rgba(188,140,255,.06); }
.tag-yellow { color: var(--yellow); border-color: rgba(227,179,65,.25); background: rgba(227,179,65,.06); }

/* ─── LEVEL BAR ─────────────────────────────────────────── */
.level-bar { display: flex; gap: 3px; }
.level-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--border); }
.level-dot.on { background: var(--cyan); box-shadow: 0 0 4px rgba(0,212,255,.5); }

/* ════════════════════════════════════════════════════════════
   EXPERIENCE EXPAND
   ════════════════════════════════════════════════════════════ */
.exp-company { font-weight: 600; color: #fff; font-size: 13px; }
.exp-meta { color: var(--text-dim); font-size: 11px; margin-top: 2px; }
.exp-period { color: var(--yellow); font-size: 12px; white-space: nowrap; }
.exp-role { color: var(--cyan); font-size: 12px; font-weight: 500; }

.exp-row { cursor: pointer; user-select: none; }
.exp-toggle-icon {
  color: var(--text-dim); font-size: 10px; display: inline-block;
  transition: transform .2s; margin-left: 6px; vertical-align: middle;
}
.exp-row.open .exp-toggle-icon { transform: rotate(90deg); }

.exp-details-row td { padding: 0; background: rgba(14, 22, 32, 0.7); }
.exp-details-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}
.exp-details-row.open .exp-details-content { grid-template-rows: 1fr; }
.exp-details-inner { overflow: hidden; }
.exp-bullet-list {
  list-style: none;
  padding: 14px 16px 14px 32px;
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--border);
}
.exp-bullet-list li {
  display: flex; gap: 10px;
  font-size: 12px; color: var(--text-mid); line-height: 1.65;
}
.exp-bullet-list li::before { content: '▸'; color: var(--cyan); flex-shrink: 0; margin-top: 1px; }
.exp-bullet-list li strong { color: var(--text); font-weight: 500; }

/* ════════════════════════════════════════════════════════════
   PROJECTS  (mobile: 1 col → tablet: 2 → desktop: 3)
   ════════════════════════════════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .projects-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
  background: var(--bg2);
  transition: border-color .2s, transform .2s, box-shadow .2s;
  display: flex; flex-direction: column; gap: 10px;
  text-decoration: none; color: inherit;
  /* better tap target on mobile */
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 768px) { .project-card { padding: 20px; } }
@media (hover: hover) {
  .project-card:hover {
    border-color: var(--cyan);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,212,255,.08);
  }
}
.project-icon { font-size: 22px; line-height: 1; }
.project-name { font-size: 15px; font-weight: 600; color: #fff; }
.project-desc { font-size: 12px; color: var(--text-mid); line-height: 1.7; }
.project-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.project-links { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.project-link { font-size: 11px; color: var(--cyan); text-decoration: none; letter-spacing: 0.04em; }
.project-link:hover { text-decoration: underline; }
.project-live {
  color: var(--green);
  display: inline-flex; align-items: center; gap: 5px;
}
.project-live::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--green);
  animation: blink 2s ease-in-out infinite;
  flex-shrink: 0;
}
.project-live:hover { color: #fff; }

/* ════════════════════════════════════════════════════════════
   CONTACTS  (mobile: 1 col → tablet: 2 → desktop: 3)
   ════════════════════════════════════════════════════════════ */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 480px) {
  .contacts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .contacts-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

.contact-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  background: var(--bg2);
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
  transition: border-color .2s, box-shadow .2s;
  min-height: 64px;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 768px) { .contact-item { padding: 16px 20px; } }
@media (hover: hover) {
  .contact-item:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(0,212,255,.07);
  }
}
.contact-icon {
  width: 36px; height: 36px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  flex-shrink: 0;
}
.contact-label { font-size: 10px; color: var(--text-dim); letter-spacing: 0.06em; margin-bottom: 2px; }
.contact-value { font-size: 12px; font-weight: 500; color: var(--text); }
@media (min-width: 768px) { .contact-value { font-size: 13px; } }

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.04em;
  position: relative; z-index: 1;
}
footer span { color: var(--cyan); }

/* ════════════════════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════════════════════ */
.fade-in { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.fade-in.visible { opacity: 1; transform: none; }

/* Disable animations on devices that prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
  .hero-badge::before, .hero-name .cursor { animation: none; }
}
