/* Omair Saleh — Candidate Experience */
/* Zero frameworks. Pure CSS. Every line intentional. */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #FAFAF8;
  --bg-warm: #F3F1EC;
  --text: #0f0f0f;
  --secondary: #374151;
  --muted: #6B7280;
  --subtle: #9CA3AF;
  --border: #E5E5E0;
  --accent: #1a1a2e;
  --link: #374151;
  --link-hover: #0f0f0f;
  --quote-bg: #EDEAE4;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  opacity: 0;
  animation: pageIn 0.5s ease 0.05s forwards;
}

@keyframes pageIn { to { opacity: 1; } }

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
  text-decoration-skip-ink: auto;
}

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

a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── NAV ─── */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.nav-brand {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-brand:hover { color: var(--text); }

.nav-links {
  display: flex;
  gap: 1.75rem;
}

.nav-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--subtle);
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
  position: relative;
}

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

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

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
}

/* ─── HERO ─── */

.hero {
  padding: 7rem 0 5rem;
}

.hero-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-portrait {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  filter: grayscale(1) contrast(1.05);
  display: block;
  margin-bottom: 2rem;
}

.hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(1.875rem, 4.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--secondary);
  max-width: 480px;
}

.scroll-indicator {
  display: flex;
  margin-top: 3.5rem;
}

.scroll-indicator svg {
  width: 18px;
  height: 18px;
  color: var(--border);
  animation: drift 2.5s ease infinite;
}

@keyframes drift {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(5px); opacity: 0.8; }
}

/* ─── SECTIONS ─── */

section {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}

.section-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 0.75rem;
}

.section-intro {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 3.5rem;
}

/* ─── FEATURED PROJECTS ─── */

article.project {
  padding-left: 0;
  margin-bottom: 0;
}

.project-header {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.project-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--border);
  font-variant-numeric: tabular-nums;
  padding-top: 0.35rem;
  flex-shrink: 0;
  min-width: 1.25rem;
}

.project-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.project-meta {
  font-size: 0.75rem;
  color: var(--subtle);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.project-meta a {
  font-weight: 600;
  color: var(--muted);
}

.project-meta a:hover {
  color: var(--text);
}

.project-body {
  padding-left: 2.125rem;
}

.project-body > p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--secondary);
  margin-bottom: 0.875rem;
}

.project-body > p:last-child {
  margin-bottom: 0;
}

.project-body strong {
  color: var(--text);
  font-weight: 600;
}

/* ─── DECISION BLOCK ─── */

.decision {
  margin-top: 1.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--quote-bg);
  border-radius: 4px;
  position: relative;
}

.decision::before {
  content: '';
  position: absolute;
  top: 1.5rem;
  left: 0;
  width: 3px;
  height: calc(100% - 3rem);
  background: var(--text);
  border-radius: 2px;
  opacity: 0.12;
}

.decision-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 0.625rem;
}

.decision > p:last-child {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text);
}

/* ─── DIVIDER ─── */

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
  margin-left: 2.125rem;
}

/* ─── ALSO SHIPPED ─── */

.also-shipped {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.also-shipped-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 1.75rem;
}

.compact-project {
  margin-bottom: 1.75rem;
  padding-left: 2.125rem;
}

.compact-project:last-child {
  margin-bottom: 0;
}

.compact-header {
  margin-bottom: 0.3rem;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compact-header h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.compact-meta {
  font-size: 0.75rem;
  color: var(--subtle);
}

.compact-meta a {
  font-weight: 600;
  color: var(--muted);
}

.compact-project > p {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--muted);
}

/* ─── APPROACH ─── */

#approach {
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
}

.principle {
  margin-bottom: 2.25rem;
}

.principle:last-child {
  margin-bottom: 0;
}

.principle h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.375rem;
}

.principle p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--secondary);
}

/* ─── CONTACT ─── */

.contact-title {
  font-size: clamp(1.375rem, 3.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.contact-quote {
  font-size: 0.9375rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 2rem;
}

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

.btn-primary-dark {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--text);
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.625rem 1.25rem;
  border-radius: 4px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.btn-primary-dark:hover {
  opacity: 0.85;
  color: #fff;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: transparent;
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.625rem 1.25rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-outline:hover {
  border-color: var(--secondary);
  color: var(--text);
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-row {
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  font-size: 0.875rem;
}

.contact-label {
  font-weight: 600;
  color: var(--text);
  min-width: 65px;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.contact-row a {
  font-weight: 500;
}

.contact-row > span:not(.contact-label) {
  color: var(--muted);
}

.availability {
  margin-top: 1.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--subtle);
  letter-spacing: 0.02em;
}

/* ─── FOOTER ─── */

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.6875rem;
  color: var(--subtle);
  letter-spacing: 0.02em;
}

/* ─── MOBILE ─── */

@media (max-width: 640px) {
  .hero {
    padding: 4.5rem 0 3.5rem;
  }

  .hero-portrait {
    width: 80px;
    height: 80px;
  }

  section {
    padding: 3.5rem 0;
  }

  .section-intro {
    margin-bottom: 2.5rem;
  }

  .project-header {
    flex-direction: column;
    gap: 0.25rem;
  }

  .project-num {
    padding-top: 0;
  }

  .project-body,
  .compact-project {
    padding-left: 0;
  }

  .divider {
    margin-left: 0;
  }

  .compact-header {
    flex-direction: column;
    gap: 0.125rem;
  }

  .contact-row {
    flex-direction: column;
    gap: 0.125rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-inner, .hero-inner, .section-inner, .footer-inner {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

@media (max-width: 400px) {
  .hero h1 {
    font-size: 1.625rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .hero-portrait {
    width: 72px;
    height: 72px;
  }
}

/* ─── TERMINAL PREVIEW ─── */

.terminal-preview {
  margin: 2rem 0;
  background: #0a0a0a;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #1a1a1a;
}

.terminal-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.terminal-preview:active {
  transform: translateY(0);
}

.terminal-preview-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #141414;
  border-bottom: 1px solid #1e1e1e;
}

.tp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.tp-r { background: #ff5f57; }
.tp-y { background: #febc2e; }
.tp-g { background: #28c840; }

.tp-label {
  flex: 1;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: #555;
  letter-spacing: 0.02em;
}

.terminal-preview-body {
  padding: 16px 18px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.tp-prompt { color: #00ff41; }
.tp-at { color: #61dafb; }
.tp-host { color: #ffd700; }
.tp-sep { color: #555; }
.tp-dir { color: #00ff41; }
.tp-dollar { color: #e0e0e0; margin-right: 8px; }
.tp-cmd { color: #00ff41; }

.tp-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: #00ff41;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1.1s step-start infinite;
}

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.terminal-preview-hint {
  padding: 0 18px 14px;
  font-size: 0.6875rem;
  color: #444;
  font-family: var(--font);
  letter-spacing: 0.02em;
}

/* ─── TERMINAL TAKEOVER ─── */

.terminal-takeover {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.terminal-takeover.active {
  pointer-events: all;
  visibility: visible;
  animation: takeoverIn 0.35s ease forwards;
}

@keyframes takeoverIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.takeover-content {
  max-width: 600px;
  padding: 0 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.8;
}

.takeover-line {
  color: #00ff41;
  opacity: 0;
  transform: translateY(4px);
  min-height: 1.5em;
}

.takeover-line.show {
  animation: lineIn 0.2s ease forwards;
}

@keyframes lineIn {
  to { opacity: 1; transform: translateY(0); }
}

.takeover-line.dim { color: #444; }
.takeover-line.gold { color: #ffd700; }
.takeover-line.blue { color: #61dafb; }

/* ─── SELECTION ─── */

::selection {
  background: rgba(15, 15, 15, 0.08);
  color: var(--text);
}
