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

:root {
  --bg: #ffffff;
  --surface: #f4f6f9;
  --surface2: #eaf0f6;
  --border: #d0d9e6;
  --accent: #1a6bbf;
  --accent2: #1a9940;
  --hw: #c47a0a;        /* hardware / orange accent */
  --hw-dim: rgba(196,122,10,0.10);
  --hw-border: rgba(196,122,10,0.22);
  --text: #1c2a3a;
  --muted: #4a5d72;
  --red: #c0392b;
  --yellow: #b8860b;
  --green: #1a9940;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.6;
  /* subtle PCB-style grid */
  background-image:
    linear-gradient(rgba(26,107,191,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,107,191,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── NAV ──────────────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--hw);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cesi-logo {
  height: 32px;
  width: auto;
  filter: brightness(0);
  opacity: 0.7;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--hw); }

.lang-toggle {
  background: var(--surface);
  color: var(--hw);
  border: 1px solid var(--hw-border);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lang-toggle:hover { background: var(--hw); color: var(--bg); }

/* ── HERO ─────────────────────────────────────────────────── */
#hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 57px);
  padding: 2rem;
}

.terminal-window {
  width: 100%;
  max-width: 680px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(232,168,62,0.06);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #e2e8f0;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.terminal-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.97rem;
}

.line {
  margin-bottom: 0.4rem;
}

.prompt { color: var(--accent2); margin-right: 0.5rem; }
.cmd    { color: var(--text); }

.output { color: var(--muted); padding-left: 1.2rem; }

.name-line {
  color: var(--accent) !important;
  font-size: 1.5rem;
  font-weight: 700;
  padding-left: 1.2rem;
}

.hw-orange {
  color: var(--hw) !important;
  font-weight: 600;
}

.tagline { color: var(--text) !important; font-style: italic; }

.blink {
  animation: blink 1s step-end infinite;
  color: var(--accent2);
}
@keyframes blink { 50% { opacity: 0; } }

/* ── SECTIONS ─────────────────────────────────────────────── */
section {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.section-title .prompt { color: var(--hw); }

.section-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* ── SKILLS SECTION ───────────────────────────────────────── */
#skills { border-top: 1px solid var(--border); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.skill-group-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--hw);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}

.skill-icon { font-size: 1rem; }

/* skill bars */
.skill-bars { display: flex; flex-direction: column; gap: 0.65rem; }

.skill-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.skill-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
  min-width: 110px;
}

.skill-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hw) 0%, #f0c060 100%);
  border-radius: 3px;
  transition: width 0.8s ease;
}

/* protocol / tool badges */
.protocol-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.proto-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--hw-dim);
  color: var(--hw);
  border: 1px solid var(--hw-border);
}

.proto-badge.hw {
  background: rgba(63,185,80,0.1);
  color: var(--accent2);
  border-color: rgba(63,185,80,0.2);
}

.proto-badge.tool {
  background: rgba(88,166,255,0.1);
  color: var(--accent);
  border-color: rgba(88,166,255,0.2);
}

/* ── PROJECT CARDS ────────────────────────────────────────── */
#projects { border-top: 1px solid var(--border); }

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(88,166,255,0.08);
}

/* hardware-focused card gets orange glow */
.card.card-hw:hover {
  border-color: var(--hw);
  box-shadow: 0 0 18px rgba(232,168,62,0.12);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(88,166,255,0.12);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-hw {
  background: var(--hw-dim);
  color: var(--hw);
  border: 1px solid var(--hw-border);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  flex: 1;
}

.card-arrow {
  font-size: 0.7rem;
  color: var(--muted);
  transition: transform 0.25s;
  flex-shrink: 0;
  margin-top: 3px;
}

.card.open .card-arrow { transform: rotate(180deg); }

.card-body {
  display: none;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}
.card.open .card-body { display: block; }

.card-body p { margin: 0.75rem 0; }

.card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }

.badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(63,185,80,0.1);
  color: var(--accent2);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(63,185,80,0.18);
}

/* ── ABOUT ────────────────────────────────────────────────── */
#about { border-top: 1px solid var(--border); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; }
}

.about-text p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.about-tags { display: flex; flex-direction: column; gap: 1rem; }

.tag-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }

.tag-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--hw);
  width: 100%;
  margin-bottom: 0.2rem;
}

.badge.link {
  text-decoration: none;
  color: var(--accent2);
  border-color: rgba(63,185,80,0.3);
  cursor: pointer;
}
.badge.link:hover { background: rgba(63,185,80,0.2); }

.soft-skills {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  height: fit-content;
}

.soft-skills ul {
  list-style: none;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.soft-skills li {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.accent-green { color: var(--accent2) !important; }

/* ── RESUME ───────────────────────────────────────────────── */
#resume { border-top: 1px solid var(--border); }

.resume-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  max-width: 480px;
}

.resume-block p { color: var(--muted); font-size: 0.9rem; }

.btn-download {
  display: inline-block;
  background: var(--hw);
  color: var(--bg);
  text-decoration: none;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}
.btn-download:hover { opacity: 0.85; }

.resume-note {
  font-size: 0.78rem !important;
  color: var(--muted);
  font-style: italic;
}
.resume-note code {
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

/* ── FOOTER ───────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-contact a {
  color: var(--muted);
  text-decoration: none;
}
.footer-contact a:hover { color: var(--hw); }
.accent { color: var(--hw); font-family: var(--font-mono); }

/* ── ILLUSTRATIONS ────────────────────────────────────────── */
.hero-illustrations {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  color: var(--hw);
  opacity: 0.65;
}

.illus-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.illus-wide {
  width: 100px;
}

.illus-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 2rem 2rem 0;
  color: var(--accent);
  opacity: 0.55;
  max-width: 960px;
  margin: 0 auto;
}

.illus-banner-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.illus-banner-wide {
  width: 110px;
}

@media (max-width: 600px) {
  .hero-illustrations { gap: 1rem; }
  .illus-icon { width: 40px; height: 40px; }
  .illus-wide { width: 70px; }
  .illus-banner { gap: 1.2rem; }
  .illus-banner-icon { width: 36px; height: 36px; }
  .illus-banner-wide { width: 72px; }
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 600px) {
  nav { padding: 0.75rem 1rem; }
  #hero { padding: 1rem; min-height: auto; padding-top: 3rem; }
  .terminal-body { font-size: 0.82rem; }
  section { padding: 3rem 1rem; }
  .skills-grid { grid-template-columns: 1fr; }
}
