@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e3e7f0;
  --text: #151a23;
  --text-dim: #5b6472;
  --blue: #2f6fed;
  --blue-dim: #e8eefd;
  --coral: #ff6b3d;
  --coral-dim: #ffe9e0;
  --green: #0ec28b;
  --green-dim: #e1faf3;
  --radius: 8px;
  --max-width: 1040px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ---- Header / Nav ---- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 247, 251, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
}
.brand span { color: var(--coral); }

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

.nav-links a {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.95rem;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
  border-bottom-color: var(--coral);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---- Hero (split layout) ---- */
.hero {
  padding: 4.5rem 0 4rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3rem);
  margin-bottom: 1.1rem;
}
.hero h1 .accent { color: var(--coral); }
.hero p {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 480px;
  margin-bottom: 1.8rem;
}

.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  background: var(--text);
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}
.btn:hover { background: var(--coral); text-decoration: none; transform: translateY(-1px); }
.btn.secondary {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn.secondary:hover { border-color: var(--blue); background: var(--blue-dim); }

/* ---- Terminal panel (hero decoration) ---- */
.term {
  background: #10141c;
  border-radius: 10px;
  overflow: hidden;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  box-shadow: 0 20px 50px -20px rgba(16, 20, 28, 0.35);
}
.term-bar {
  display: flex;
  gap: 6px;
  padding: 0.7rem 0.9rem;
  background: #171c26;
}
.term-bar span { width: 10px; height: 10px; border-radius: 50%; display: block; }
.term-bar span:nth-child(1) { background: #ff6b3d; }
.term-bar span:nth-child(2) { background: #e8c547; }
.term-bar span:nth-child(3) { background: #0ec28b; }
.term-body { padding: 1.1rem 1rem 1.3rem; color: #c7cedb; }
.term-body .ln { margin-bottom: 0.45rem; white-space: pre-wrap; }
.term-body .ok { color: #0ec28b; }
.term-body .path { color: #5b9dff; }
.term-body .dim { color: #7a8396; }
.term-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: #ff6b3d;
  vertical-align: middle;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---- Sections ---- */
section { padding: 3rem 0; }
section h2 { font-size: 1.65rem; margin-bottom: 0.4rem; }
.section-sub { color: var(--text-dim); margin-bottom: 2rem; max-width: 560px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}
.card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.card p { color: var(--text-dim); font-size: 0.95rem; }

/* ---- Project list (color-coded, not uniform cards) ---- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 1.9rem; }
.filter-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { color: var(--text); border-color: var(--blue); }
.filter-btn.active { background: var(--text); border-color: var(--text); color: #fff; }

.project-list { display: flex; flex-direction: column; gap: 0.85rem; }
.project-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.15s;
}
.project-row.cat-cloud { border-left-color: var(--blue); }
.project-row.cat-ai { border-left-color: var(--coral); }
.project-row.cat-web { border-left-color: var(--green); }
.project-row.hidden { display: none; }
.project-row h3 { font-size: 1.08rem; margin-bottom: 0.4rem; }
.project-row p { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 0.7rem; }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* ---- Skill chips (grouped, colored by domain) ---- */
.chip-group { margin-bottom: 1.8rem; }
.chip-group h3 {
  font-size: 1rem;
  margin-bottom: 0.7rem;
  color: var(--text-dim);
  font-weight: 500;
  font-family: 'IBM Plex Sans', sans-serif;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.chip.blue { background: var(--blue-dim); color: #1b4fc7; }
.chip.coral { background: var(--coral-dim); color: #c9401a; }
.chip.green { background: var(--green-dim); color: #0a8a65; }

/* ---- Contact form ---- */
form { max-width: 520px; }
.form-row { margin-bottom: 1rem; }
label { display: block; font-size: 0.9rem; margin-bottom: 0.4rem; color: var(--text-dim); font-weight: 500; }
input, textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.68rem 0.9rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
input:focus, textarea:focus { outline: none; border-color: var(--blue); }
textarea { min-height: 130px; resize: vertical; }
.form-status {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  display: none;
}
.form-status.show { display: block; }
.form-status.ok { background: var(--green-dim); border: 1px solid #9fe6cc; color: #0a7a5a; }
.form-status.err { background: var(--coral-dim); border: 1px solid #ffc4a8; color: #b8431a; }

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
}
footer a { color: var(--text-dim); margin: 0 0.5rem; }
footer a:hover { color: var(--blue); }

/* ---- 404 ---- */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.error-page .code {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3.5rem, 11vw, 6rem);
  font-weight: 700;
  color: var(--coral);
  line-height: 1;
}

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 1rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
}
