/* =========================================================
   Noel Merheb — Developer Portfolio
   Design system: "IDE" theme — deep slate editor background,
   teal/amber syntax-inspired accents, mono utility face for
   structure, tab-bar navigation that mirrors an open editor.
   ========================================================= */

:root {
  /* Color tokens */
  --bg: #0f172a;
  --bg-soft: #111d33;
  --surface: #16213e;
  --surface-glass: rgba(22, 33, 62, 0.6);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);

  --text: #e7ecf3;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  --accent: #5eead4;       /* teal — "string" */
  --accent-dim: #2dd4bf;
  --accent-2: #fbbf24;     /* amber — "keyword" */
  --accent-2-dim: #f59e0b;
  --danger: #f87171;
  --ok: #4ade80;

  /* Type */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --max-w: 1120px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

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

body::before {
  /* faint grid, like an editor's guide lines */
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent); color: #0f172a; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.eyebrow::before { content: "//"; color: var(--text-faint); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.section-sub {
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 44px;
  font-size: 0.98rem;
}

section { position: relative; z-index: 1; padding: 100px 0; }

/* ============ TAB-BAR NAVIGATION (signature element) ============ */
.tabbar-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.tabbar {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }

.tabbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 14px 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.tabbar .brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.tab {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  position: relative;
  transition: color 0.2s ease, background 0.2s ease;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.tab .file-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }

.tab.active { color: var(--text); background: var(--surface); }
.tab.active .file-dot { background: var(--accent-2); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.tabbar .cta-mini {
  margin-left: auto;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--bg);
  background: var(--accent);
  padding: 7px 14px;
  border-radius: 6px;
  white-space: nowrap;
  font-weight: 600;
}

.tabbar .nav-toggle {
  display: none;
}

/* ============ HERO / TERMINAL ============ */
.hero {
  padding: 90px 0 110px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  min-height: calc(100vh - 49px);
}

.hero-copy .kicker {
  font-family: var(--font-mono);
  color: var(--accent-2);
  font-size: 0.85rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-copy .kicker .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.hero-copy h1 span { color: var(--accent); }

.hero-copy .role {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 22px;
}
.hero-copy .role .cursor {
  display: inline-block;
  width: 9px; height: 1.1em;
  background: var(--accent-2);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-copy p.intro {
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 34px;
  font-size: 1rem;
}

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #06251f; }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(94, 234, 212, 0.25); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { padding: 9px 16px; font-size: 0.78rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(248,113,113,0.4); }
.btn-danger:hover { background: rgba(248,113,113,0.08); }

/* terminal window */
.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glass);
  overflow: hidden;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
.terminal-bar .tdot { width: 11px; height: 11px; border-radius: 50%; }
.tdot.red { background: #f87171; }
.tdot.yellow { background: #fbbf24; }
.tdot.green { background: #4ade80; }
.terminal-bar .tname {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-faint);
}
.terminal-body {
  padding: 22px 22px 26px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  min-height: 260px;
}
.terminal-body .line { margin-bottom: 14px; }
.terminal-body .prompt { color: var(--accent-2); }
.terminal-body .path { color: var(--accent); }
.terminal-body .out { color: var(--text-muted); padding-left: 2px; }
.terminal-body .out strong { color: var(--text); font-weight: 600; }
.typed-cursor {
  display: inline-block; width: 8px; height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 0.9s steps(1) infinite;
}

/* ============ ABOUT ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-card {
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(6px);
}
.about-card p { color: var(--text-muted); margin-bottom: 14px; }
.about-card p:last-child { margin-bottom: 0; }
.about-facts {
  display: grid;
  gap: 14px;
}
.fact {
  display: flex;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.fact .k {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.78rem;
  min-width: 88px;
}
.fact .v { color: var(--text-muted); font-size: 0.9rem; }

/* ============ SKILLS ============ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.skill-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.skill-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.skill-head .name { font-weight: 600; font-size: 0.98rem; }
.skill-head .pct { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); }
.skill-bar-track {
  height: 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  width: 0%;
  transition: width 1.1s cubic-bezier(.2,.8,.2,1);
}
.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 10px;
  display: block;
}

/* ============ PROJECTS ============ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.project-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.project-file-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}
.project-file-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }
.project-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.project-body h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 10px;
}
.project-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 18px;
  flex: 1;
}
.tech-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.25);
  padding: 4px 9px;
  border-radius: 20px;
}
.project-actions { display: flex; gap: 10px; }
.project-actions .btn { flex: 1; }

/* ============ CONTACT ============ */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
}
.contact-info { display: flex; flex-direction: column; gap: 16px; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.92rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.contact-link:hover { border-color: var(--accent); color: var(--accent); }
.contact-link .ico { font-family: var(--font-mono); color: var(--accent-2); }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
}
.form-card .terminal-bar { margin: -30px -30px 22px; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.field label::before { content: "> "; color: var(--text-faint); }
.field input, .field textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: border-color 0.2s ease;
}
.field input:focus, .field textarea:focus {
  border-color: var(--accent);
  outline: none;
}
.field textarea { resize: vertical; min-height: 110px; }
.form-status {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  min-height: 1.2em;
}
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }

/* ============ FOOTER ============ */
footer {
  padding: 34px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 50px; min-height: auto; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .form-card .terminal-bar { margin: -30px -30px 22px; }
}

@media (max-width: 560px) {
  section { padding: 70px 0; }
  .tabbar .brand span.full { display: none; }
  .btn-row { width: 100%; }
  .btn-row .btn { flex: 1; justify-content: center; }
  .projects-grid { grid-template-columns: 1fr; }
  .form-card { padding: 22px; }
  .form-card .terminal-bar { margin: -22px -22px 20px; }
  .terminal-body { padding: 18px; font-size: 0.82rem; }
  .hero { padding-top: 36px; }
}
