:root {
  --bg: #0a0b12;
  --bg-alt: #0e1019;
  --surface: #141725;
  --surface-2: #1a1e30;
  --border: #242a40;
  --text: #e7e9f2;
  --text-dim: #9aa0b8;
  --muted: #6b7090;
  --accent-1: #22d3ee; /* cyan */
  --accent-2: #a855f7; /* violet */
  --accent-grad: linear-gradient(120deg, #22d3ee 0%, #818cf8 50%, #a855f7 100%);
  --radius: 14px;
  --maxw: 1100px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: rgba(10, 11, 18, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__brand { display: flex; align-items: center; gap: 0.55rem; font-family: var(--mono); font-weight: 700; }
.nav__logo {
  font-size: 1.2rem;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav__name { letter-spacing: 0.02em; }
.nav__links { display: flex; align-items: center; gap: 1.4rem; font-size: 0.92rem; }
.nav__links a { color: var(--text-dim); transition: color 0.2s; }
.nav__links a:hover { color: var(--text); }
.nav__cta {
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
}
.nav__cta:hover { border-color: var(--accent-1); }

/* Hamburger toggle — hidden on desktop, shown on small screens */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav--open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav--open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav--open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 7rem 1.5rem 5rem;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(1200px 500px at 70% -10%, rgba(168, 85, 247, 0.16), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(34, 211, 238, 0.12), transparent 55%);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.5; }
.hero__inner { position: relative; max-width: var(--maxw); margin: 0 auto; }
.hero__eyebrow {
  font-family: var(--mono);
  color: var(--accent-1);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  margin: 0 0 0.6rem;
}
.hero__title {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero__role { font-size: 1.2rem; color: var(--text); margin: 0.7rem 0 0.2rem; font-weight: 600; }
.hero__tagline {
  font-family: var(--mono);
  font-size: 0.95rem;
  margin: 0.2rem 0 1.2rem;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__pitch { max-width: 640px; color: var(--text-dim); font-size: 1.02rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent-1); }
.btn--primary { background: var(--accent-grad); border: none; color: #0a0b12; font-weight: 700; }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; }

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 4.5rem 1.5rem; }
.section--alt { max-width: none; background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section--alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section__head { margin-bottom: 2.2rem; }
.section__title { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0; letter-spacing: -0.01em; }
.section__sub { color: var(--text-dim); margin: 0.4rem 0 0; }

/* ---------- Project grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.3rem;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s, border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 18px 40px -20px rgba(34, 211, 238, 0.35);
}
.card--featured { border-color: rgba(168, 85, 247, 0.4); }
.card__main { padding: 1.5rem 1.5rem 1rem; flex: 1; position: relative; }
.card__badge {
  position: absolute;
  top: 1.1rem; right: 1.1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.16);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.35);
}
.card__title { font-size: 1.18rem; margin: 0 0 0.5rem; padding-right: 4rem; }
.card__summary { color: var(--text-dim); font-size: 0.94rem; margin: 0 0 1rem; }
.card__foot {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.card__links { margin-left: auto; display: flex; gap: 0.9rem; }
.card__links a { color: var(--accent-1); }
.card__links a:hover { text-decoration: underline; }

.stat { color: var(--text-dim); }
.stat--muted { color: var(--muted); font-style: italic; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; padding: 0; margin: 0; }
.tag {
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* ---------- Stack ---------- */
.stack { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 1.6rem; }
.stack__group {}
.stack__label {
  font-family: var(--mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-1);
  margin: 0 0 0.8rem;
}

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl { display: grid; grid-template-columns: 24px 1fr; gap: 1.2rem; padding-bottom: 2rem; }
.tl:last-child { padding-bottom: 0; }
.tl__marker {
  width: 14px; height: 14px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent-grad);
  position: relative;
}
.tl__marker::after {
  content: "";
  position: absolute;
  left: 50%; top: 18px;
  transform: translateX(-50%);
  width: 2px; height: calc(100% + 1.4rem);
  background: var(--border);
}
.tl:last-child .tl__marker::after { display: none; }
.tl__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.6rem; }
.tl__role { margin: 0; font-size: 1.1rem; }
.tl__company { color: var(--accent-1); font-weight: 600; }
.tl__period { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-left: auto; }
.tl__points { margin: 0; padding-left: 1.1rem; color: var(--text-dim); }
.tl__points li { margin-bottom: 0.35rem; }

/* ---------- Contact ---------- */
.contact { text-align: center; padding: 1rem 0; }
.contact__sub { color: var(--text-dim); margin: 0.5rem 0 1.6rem; }
.contact__links { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }

/* ---------- Project detail ---------- */
.detail { max-width: 820px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
.detail__back { font-family: var(--mono); font-size: 0.85rem; color: var(--text-dim); }
.detail__back:hover { color: var(--accent-1); }
.detail__head { margin: 1.4rem 0 2rem; position: relative; }
.detail__title { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0.6rem 0 0.6rem; letter-spacing: -0.01em; }
.detail__summary { color: var(--text-dim); font-size: 1.08rem; margin: 0 0 1.2rem; }
.detail__meta { display: flex; gap: 1.1rem; flex-wrap: wrap; font-family: var(--mono); font-size: 0.82rem; color: var(--text-dim); margin: 1.1rem 0; }
.detail__actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.2rem; }
.detail__cover { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin: 1.5rem 0; }

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 4rem 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.empty__title { font-size: 1.2rem; font-weight: 600; margin: 0 0 0.4rem; }
.empty__sub { color: var(--text-dim); margin: 0; }

/* ---------- Facts (free-form extra fields) ---------- */
.facts {
  margin: 0 0 1.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.facts__row { display: flex; gap: 1rem; padding: 0.7rem 1.1rem; border-top: 1px solid var(--border); }
.facts__row:first-child { border-top: none; }
.facts dt { font-family: var(--mono); font-size: 0.82rem; color: var(--accent-1); min-width: 130px; }
.facts dd { margin: 0; color: var(--text-dim); }

/* ---------- Prose ---------- */
.prose { color: var(--text); font-size: 1.02rem; }
.prose h2, .prose h3 { margin-top: 2rem; letter-spacing: -0.01em; }
.prose p { color: var(--text-dim); }
.prose strong { color: var(--text); }
.prose ul { color: var(--text-dim); padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  color: var(--accent-1);
}
.prose a { color: var(--accent-1); text-decoration: underline; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-alt); }
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.6rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.footer__links { display: flex; gap: 1.2rem; }
.footer__links a:hover { color: var(--accent-1); }

/* ---------- Responsive ---------- */

/* Tablet */
@media (max-width: 900px) {
  .section { padding: 3.5rem 1.25rem; }
  .section--alt { padding-left: 1.25rem; padding-right: 1.25rem; }
  .hero { padding: 5.5rem 1.25rem 4rem; }
}

/* Phone — collapsible nav */
@media (max-width: 720px) {
  .nav { padding: 0.7rem 1rem; flex-wrap: wrap; }
  .nav__toggle { display: flex; }

  .nav__links {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.3s ease;
  }
  .nav--open .nav__links {
    max-height: 70vh;
    opacity: 1;
    margin-top: 0.7rem;
  }
  .nav__links a {
    padding: 0.85rem 0.4rem;
    font-size: 1rem;
    border-top: 1px solid var(--border);
  }
  .nav__cta {
    border: 1px solid var(--border) !important;
    border-radius: 10px;
    text-align: center;
    margin-top: 0.6rem;
  }

  .hero { padding: 3rem 1.1rem 3rem; }
  .hero__actions { gap: 0.6rem; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }

  .section { padding: 3rem 1.1rem; }
  .section--alt { padding-left: 1.1rem; padding-right: 1.1rem; }

  .card__title { padding-right: 0; }
  .card__badge { position: static; display: inline-block; margin-bottom: 0.6rem; }

  .detail { padding: 2rem 1.1rem 3.5rem; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* Small phone */
@media (max-width: 380px) {
  .hero__title { font-size: 2.3rem; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
  .contact__links { flex-direction: column; }
  .contact__links .btn { width: 100%; justify-content: center; }
  .tag { font-size: 0.7rem; }
}