/* ============================================================
   Mohammad Hasbini — Personal Site
   Design system + global styles
   ============================================================ */

:root {
  /* Palette */
  --bg: #0b0c0f;
  --bg-elev: #14161b;
  --bg-elev-2: #1b1e24;
  --border: #2a2d33;
  --border-strong: #3a3e46;

  --text: #ececec;
  --text-muted: #9a9a9a;
  --text-dim: #6b6f78;

  --accent: #ff6b1a;
  --accent-hover: #ff8440;
  --accent-dim: rgba(255, 107, 26, 0.14);
  --accent-line: rgba(255, 107, 26, 0.35);

  --success: #6bd68f;

  /* Type */
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Spacing (8pt) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* Layout */
  --max-w: 1240px;
  --gutter: clamp(20px, 4vw, 48px);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Radius */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 16px;
}

/* ----- Reset ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--accent);
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
}

/* Focus states — visible and on-brand */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ----- Layout ----- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: var(--s-10) 0;
}

.section-tight {
  padding: var(--s-8) 0;
}

@media (max-width: 768px) {
  .section {
    padding: var(--s-8) 0;
  }
  .section-tight {
    padding: var(--s-7) 0;
  }
}

/* ----- Type ----- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
}

h1 {
  font-size: clamp(40px, 8vw, 96px);
}

h2 {
  font-size: clamp(32px, 4.5vw, 56px);
}

h3 {
  font-size: clamp(22px, 2.5vw, 30px);
  letter-spacing: -0.015em;
}

h4 {
  font-size: 18px;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
  color: var(--text-muted);
  max-width: 62ch;
}

p.lead {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--text);
  line-height: 1.55;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.muted {
  color: var(--text-muted);
}

.dim {
  color: var(--text-dim);
}

/* ----- Navigation ----- */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(11, 12, 15, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-muted);
  border-radius: var(--r-1);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-elev);
}

.nav-links a.active {
  color: var(--text);
}

.nav-links a.active::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--accent);
  margin-top: 4px;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  color: var(--text);
  transition: all 0.2s var(--ease);
}

.nav-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-1);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 1.5px;
  background: var(--text);
}

.nav-toggle span::before {
  top: -5px;
}

.nav-toggle span::after {
  top: 5px;
}

@media (max-width: 820px) {
  .nav-links,
  .nav-cta {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px var(--gutter) 20px;
  }
  .nav.open .nav-links a {
    padding: 14px 0;
    font-size: 18px;
    border-bottom: 1px solid var(--border);
  }
  .nav.open .nav-cta {
    display: inline-flex;
    margin-top: 12px;
  }
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--r-1);
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0b0c0f;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #0b0c0f;
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-link {
  color: var(--text-muted);
  font-size: 14px;
  padding: 14px 0;
}

.btn-link:hover {
  color: var(--accent);
}

.btn .arrow {
  transition: transform 0.2s var(--ease);
}

.btn:hover .arrow {
  transform: translateX(3px);
}

/* ----- Hero ----- */
.hero {
  position: relative;
  padding: var(--s-9) 0 var(--s-9);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255, 107, 26, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 82% 78%, rgba(255, 107, 26, 0.04) 0%, transparent 40%);
  opacity: 1;
}

.hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%);
}

.hero-inner {
  position: relative;
  max-width: 960px;
}

.hero-motto {
  font-size: clamp(44px, 8.4vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 500;
  margin: 24px 0 32px;
}

.hero-motto .highlight {
  color: var(--accent);
  position: relative;
  display: inline-block;
}

.hero-lead {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--text-muted);
  max-width: 56ch;
  line-height: 1.55;
}

.hero-ctas {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--accent);
  margin-left: 6px;
  transform: translateY(4px);
  animation: blink 1.1s steps(2) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ----- Metrics strip ----- */
.metrics {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--s-6) 0;
  background: linear-gradient(180deg, transparent, rgba(255, 107, 26, 0.02));
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
  align-items: center;
}

.metric .number {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
  font-weight: 500;
}

.metric .label {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: var(--s-5);
  }
}

/* ----- Section heading ----- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-5);
  margin-bottom: var(--s-7);
  flex-wrap: wrap;
}

.section-head .intro {
  max-width: 520px;
}

.section-head h2 {
  margin-top: 14px;
}

.section-head p {
  margin-top: 14px;
}

/* ----- Project cards ----- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

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

.project-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), border-color 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  color: inherit;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  color: inherit;
}

.project-media {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  background: var(--bg-elev-2);
}

.project-media svg {
  width: 100%;
  height: 100%;
  display: block;
}

.project-year {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: rgba(11, 12, 15, 0.75);
  border: 1px solid var(--accent-line);
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.project-status {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text);
  background: rgba(11, 12, 15, 0.75);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.project-body {
  padding: 24px 26px 28px;
}

.project-title {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.project-desc {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
}

.project-more {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.04em;
}

.project-more .arrow {
  transition: transform 0.2s var(--ease);
}

.project-card:hover .project-more .arrow {
  transform: translateX(4px);
}

/* ----- Process strip ----- */
.process-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.process-item {
  padding: 28px 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--bg-elev);
  transition: all 0.25s var(--ease);
}

.process-item:hover {
  border-color: var(--accent-line);
  background: var(--bg-elev-2);
}

.process-item .step {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.process-item h4 {
  margin: 10px 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
}

.process-item p {
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 820px) {
  .process-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .process-strip {
    grid-template-columns: 1fr;
  }
}

/* ----- Process page (detailed) ----- */
.process-blocks {
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
  max-width: 820px;
}

.process-block {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 32px;
  padding-bottom: var(--s-7);
  border-bottom: 1px solid var(--border);
}

.process-block:last-child {
  border-bottom: 0;
}

.process-num {
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 1;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.process-block h3 {
  margin: 6px 0 16px;
}

.process-block p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 58ch;
}

@media (max-width: 640px) {
  .process-block {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .process-num {
    font-size: 48px;
  }
}

/* ----- Services ----- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.service-card {
  padding: 36px 32px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, var(--accent-dim), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}

.service-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.service-card:hover::before {
  opacity: 1;
}

.service-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-1);
  border: 1px solid var(--accent-line);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  color: var(--accent);
}

.service-card h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.service-card p {
  font-size: 15px;
  line-height: 1.65;
}

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

/* ----- About ----- */
.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--s-8);
  align-items: start;
}

.about-layout .portrait {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  position: relative;
}

.about-blocks > * + * {
  margin-top: var(--s-6);
}

.about-block h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

.about-block p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.75;
  max-width: 58ch;
}

.about-block p + p {
  margin-top: 14px;
}

.about-chips {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--bg-elev);
}

.chip.accent {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.experience-grid {
  margin-top: var(--s-7);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.exp-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--bg-elev);
}

.exp-card .num {
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.exp-card .label {
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 6px;
}

.exp-card .sub {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .about-layout {
    grid-template-columns: 1fr;
  }
  .about-layout .portrait {
    max-width: 420px;
  }
  .experience-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- Contact ----- */
.contact-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s-8);
}

.contact-form {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 36px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-row label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev-2);
}

.form-row textarea {
  resize: vertical;
  min-height: 140px;
  font-family: var(--font-body);
}

.form-status {
  margin-top: 14px;
  font-size: 14px;
  color: var(--success);
  min-height: 20px;
}

.contact-side h3 {
  margin-bottom: 18px;
}

.contact-email {
  display: block;
  font-family: var(--font-mono);
  font-size: 17px;
  color: var(--accent);
  padding: 18px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-2);
  margin-bottom: 24px;
  word-break: break-all;
  transition: all 0.2s var(--ease);
}

.contact-email:hover {
  background: var(--accent-dim);
  color: var(--accent-hover);
}

.socials {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.social {
  width: 44px;
  height: 44px;
  border-radius: var(--r-1);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}

.social:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.call-block {
  padding: 26px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  margin-bottom: 24px;
}

.call-block h4 {
  font-family: var(--font-display);
  font-size: 20px;
  margin-bottom: 8px;
}

.call-block p {
  font-size: 14px;
  margin-bottom: 16px;
}

.hand-note {
  font-family: "Caveat", "Segoe Script", cursive;
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.4;
  transform: rotate(-0.8deg);
  display: inline-block;
}

@media (max-width: 900px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

/* ----- CTA Band ----- */
.cta-band {
  padding: var(--s-9) 0;
  text-align: left;
}

.cta-band h2 {
  max-width: 720px;
  margin-bottom: 28px;
}

.cta-band .btn {
  margin-top: 8px;
}

/* ----- Footer ----- */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--s-7) 0 var(--s-6);
  margin-top: var(--s-8);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.footer-brand h4 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 10px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  max-width: 38ch;
}

.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 14px;
  font-weight: 500;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 14px;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-bottom .signature {
  font-family: "Caveat", "Segoe Script", cursive;
  font-size: 16px;
  color: var(--text-muted);
  transform: rotate(-0.8deg);
  display: inline-block;
}

@media (max-width: 760px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* ----- Project detail page ----- */
.project-hero {
  padding: var(--s-8) 0 var(--s-6);
}

.project-hero .back {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-hero .back:hover {
  color: var(--accent);
}

.project-hero .meta {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.project-hero .meta span {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
}

.project-hero .meta .accent {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.project-hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  margin-bottom: 20px;
  max-width: 16ch;
}

.project-hero .lead {
  max-width: 60ch;
}

.project-visual {
  margin-top: var(--s-6);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
  aspect-ratio: 16 / 8;
}

.project-visual svg {
  width: 100%;
  height: 100%;
}

.project-content {
  padding: var(--s-7) 0 var(--s-9);
}

.project-content .layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--s-8);
  align-items: start;
}

.project-side {
  position: sticky;
  top: 100px;
}

.project-side h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 12px;
  font-weight: 500;
}

.project-side ul {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}

.project-side li {
  font-size: 14px;
  color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.project-body-text h3 {
  font-size: 24px;
  margin-bottom: 14px;
  margin-top: var(--s-6);
}

.project-body-text h3:first-child {
  margin-top: 0;
}

.project-body-text p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 16px;
  max-width: 62ch;
}

.project-body-text ul {
  padding-left: 22px;
  margin: 0 0 20px;
}

.project-body-text li {
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.65;
}

@media (max-width: 820px) {
  .project-content .layout {
    grid-template-columns: 1fr;
  }
  .project-side {
    position: static;
  }
}

/* ----- Reveal on scroll ----- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ----- Chatbot ----- */
.chat-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent);
  color: #0b0c0f;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(255, 107, 26, 0.35);
  z-index: 70;
  transition: transform 0.25s var(--ease);
}

.chat-toggle:hover {
  transform: scale(1.05);
}

.chat-toggle.pulsing::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 2.5s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.chat-window {
  position: fixed;
  right: 22px;
  bottom: 92px;
  width: 360px;
  max-width: calc(100vw - 44px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--bg-elev);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 70;
  transform-origin: bottom right;
  animation: chatIn 0.3s var(--ease-out);
}

.chat-window.open {
  display: flex;
}

@keyframes chatIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #0b0c0f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 14px;
}

.chat-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
}

.chat-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.chat-actions {
  display: flex;
  gap: 6px;
}

.chat-actions button {
  width: 30px;
  height: 30px;
  border-radius: var(--r-1);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s var(--ease);
}

.chat-actions button:hover {
  background: var(--bg);
  color: var(--text);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  animation: msgIn 0.25s var(--ease-out);
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg.bot {
  align-self: flex-start;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #0b0c0f;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.msg.typing {
  display: flex;
  gap: 4px;
  align-items: center;
}

.msg.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: bounce 1.4s infinite ease-in-out both;
}

.msg.typing span:nth-child(1) { animation-delay: -0.32s; }
.msg.typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-suggestions {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg-elev);
}

.chip-suggest {
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  font-family: var(--font-body);
}

.chip-suggest:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.chat-input {
  display: flex;
  border-top: 1px solid var(--border);
  padding: 10px;
  gap: 8px;
  background: var(--bg-elev-2);
}

.chat-input input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}

.chat-input input:focus {
  outline: none;
  border-color: var(--accent);
}

.chat-input button.send {
  width: 40px;
  height: 40px;
  border-radius: var(--r-1);
  background: var(--accent);
  color: #0b0c0f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease);
}

.chat-input button.send:hover {
  background: var(--accent-hover);
}

/* ----- Utilities ----- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .cursor {
    display: none;
  }
}

/* ----- Print-ish clean ----- */
::selection {
  background: var(--accent);
  color: #0b0c0f;
}
