/* =========================================
   Hussam Haroon — Portfolio
   Color hierarchy:
     - E6E8E6 (off-white) = 90% of text (body, names, roles)
     - DF2935 (red)        = numbers, stats, primary CTA, accents (~5% usage)
     - FDCA40 (yellow)     = cursor, hover highlights only (~2% usage)
     - 080708 (black)      = background
     - 3772FF (blue)       = reserved, not used
   ========================================= */

:root {
  --bg: #080708;
  --primary: #3772FF;       /* reserved */
  --accent: #DF2935;        /* red — numbers, stats, primary action */
  --highlight: #FDCA40;     /* yellow — cursor, hover */
  --text: #E6E8E6;          /* off-white */
  --muted: #b4b6b6;         /* dimmed text — WCAG AA on #080708, easy on the eye */
  --dim: #3d3f3e;           /* very dim — separators */
  --border: #1c1c1f;        /* hairline borders */
  --card: #0e0e10;          /* barely-lighter than bg */
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-size: 18px; /* ~12% larger than browser default 16px */
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  font-size: 1rem; /* baseline; most elements use rem so they scale together */
}

/* Paragraph / prose text — readable sans-serif. Headers, numbers, code stay mono. */
.hero-bio,
.hero-tag,
.contact-lead,
.project-desc,
.edu-detail,
.contact-value,
.avatar-name {
  font-family: var(--sans);
}

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

/* =========================================
   LAYOUT — single viewport, dashboard
   Eye-flow: Z-pattern
     topbar → hero (left) | work (right)
                  → skills + education (mid row)
                  → contact | footer
   ========================================= */
.layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.85fr;
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas:
    "topbar    topbar     topbar"
    "hero      work       skills"
    "contact   education  education"
    "foot      foot       foot";
  height: 100vh;
  height: 100dvh;
  width: 100%;
  position: relative;
  isolation: isolate;
}

/* Parallax background layer (blurred + heavily darkened for legibility) */
.layout::before {
  content: '';
  position: fixed;
  inset: -10% -5%;
  z-index: -1;
  background-image: url('assets/bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: multiply;
  background-color: rgba(8, 7, 8, 0.88);
  filter: blur(8px) saturate(0.25) brightness(0.45) contrast(0.85);
  transform: translate(var(--parallax-x, 0), var(--parallax-y, 0));
  will-change: transform;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Subtle red ambient glow over the parallax layer (tamed — no longer heavy wash) */
.layout::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 50% 35% at 18% 22%, rgba(223, 41, 53, 0.10), transparent 70%),
    radial-gradient(ellipse 45% 28% at 82% 80%, rgba(253, 202, 64, 0.04), transparent 70%);
  pointer-events: none;
}

/* =========================================
   TOPBAR
   ========================================= */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prompt { color: var(--text); }
.topbar-sep { color: var(--dim); }
.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.status-tag {
  font-family: var(--sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--highlight);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(223, 41, 53, 0.6);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(223, 41, 53, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(223, 41, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(223, 41, 53, 0); }
}
.topbar-meta { font-variant-numeric: tabular-nums; }

/* =========================================
   ZONES — shared
   ========================================= */
.zone {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.zone-hero     { grid-area: hero;     border-right: 1px solid var(--border); }
.zone-work      { grid-area: work;      border-bottom: 1px solid var(--border); }
.zone-skills    { grid-area: skills;    border-left:  1px solid var(--border); }
.zone-contact   { grid-area: contact;   border-right: 1px solid var(--border); }
.zone-education { grid-area: education; border-top:   1px solid var(--border); }
.zone-foot      { grid-area: foot; }

.zone-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: lowercase;
}
.zone-label { color: var(--text); }
.zone-count {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

/* =========================================
   HERO
   ========================================= */
.zone-hero { justify-content: space-between; }

.avatar-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-mono { letter-spacing: -1px; }
@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}
.avatar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.avatar-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.avatar-handle {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.hero { display: flex; flex-direction: column; }

.hero-body { margin-bottom: auto; }
.hero-bio {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 14px;
  max-width: 46ch;
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}

.hero-role {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.hero-line {
  font-family: var(--mono);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.line-prefix { color: var(--accent); }
.line-cmd { color: var(--text); }
.line-arg { color: var(--muted); }
.cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1em;
  background: var(--highlight);
  margin-left: 4px;
  align-self: stretch;
  animation: blink 1.05s steps(1) infinite;
}

.hero-tag {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
  max-width: 480px;
}
.tag-stat {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--accent);
  background: rgba(223, 41, 53, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.tag-link {
  color: var(--highlight);
  text-decoration: underline;
  text-decoration-color: rgba(253, 202, 64, 0.4);
  text-underline-offset: 2px;
  font-family: var(--mono);
  font-size: 0.85em;
  margin-left: 4px;
}
.tag-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.88rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--mono);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: var(--text);
}
.btn-primary:hover {
  background: var(--highlight);
  color: var(--bg);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--text);
}
@keyframes keypress {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}
.btn-press {
  animation: keypress 0.18s ease-out;
}
.btn-key {
  color: var(--muted);
  font-size: 0.75rem;
}
.btn-primary:hover .btn-key { color: var(--bg); }
.btn-ghost:hover .btn-key { color: var(--highlight); }

/* =========================================
   PROJECT LIST
   ========================================= */
.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.project-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 0.2s ease;
  position: relative;
}
.project-card:first-child { padding-top: 4px; }
.project-card:last-child { border-bottom: none; }
.project-card:hover { padding-left: 8px; }
.project-card::before {
  content: '';
  position: absolute;
  left: -2px; top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  background: var(--accent);
  transition: width 0.2s ease, height 0.2s ease;
}
.project-card:hover::before { width: 2px; height: 60%; }

.project-name {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-card:hover .project-name { color: var(--highlight); }

.project-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}
.project-stars {
  color: var(--highlight);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.project-lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lang-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.lang-java { background: #b07219; }
.lang-typescript { background: #3178c6; }
.lang-javascript { background: #f1e05a; }
.lang-default { background: var(--muted); }

.project-desc {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

.project-skills {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.skill {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.project-skeleton {
  padding: 20px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  text-align: center;
}

/* =========================================
   CONTACT
   ========================================= */
.contact-lead {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 320px;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: auto;
}
.contact-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.85rem;
  transition: padding-left 0.2s ease, color 0.2s ease;
}
.contact-row:first-child { padding-top: 0; }
.contact-row:last-child { border-bottom: none; }
.contact-row:hover { padding-left: 6px; }
.contact-row:hover .contact-value { color: var(--highlight); }
.contact-row:hover .contact-arrow { color: var(--accent); transform: translateX(2px); }

.contact-key {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.contact-value {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}
.contact-arrow {
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

/* "now" widget — small, charming, human */
.now-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.72rem;
}
.now-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-out infinite;
}
.now-label {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.now-text {
  color: var(--muted);
}
.now-link {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-left: 4px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.now-link:hover {
  color: var(--highlight);
  border-color: var(--highlight);
}

/* =========================================
   FOOTER
   ========================================= */
.zone-foot {
  grid-column: 1 / -1;       /* span all three columns */
  padding: 18px 32px;
  justify-content: center;
  align-items: center;
  display: flex;
  border-top: 1px solid var(--border);
}
.copyright {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.4px;
}

/* =========================================
   SKILLS
   ========================================= */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.skill-group {}
.skill-group-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: lowercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.skill-group-label::before {
  content: '›';
  color: var(--accent);
  font-weight: 700;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  background: var(--card);
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--highlight);
  transform: translateY(-1px);
}
.chip-strong {
  border-color: var(--accent);
  color: var(--accent);
}

/* =========================================
   EDUCATION
   ========================================= */
.edu-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.edu-degree {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.edu-school {
  font-size: 0.82rem;
  color: var(--muted);
}
.edu-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--dim);
  text-transform: lowercase;
  letter-spacing: 0.5px;
}
.edu-meta .dot {
  width: 4px; height: 4px;
  background: var(--highlight);
  border-radius: 50%;
  display: inline-block;
}
.edu-detail {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.65;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1100px) {
  .layout {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "hero"
      "work"
      "skills"
      "education"
      "contact"
      "foot";
  }
  html, body { overflow: auto; }
  .zone { border-right: none !important; border-bottom: 1px solid var(--border); border-left: none !important; border-top: none !important; }
  .zone-foot { border-left: none; border-bottom: none; }
  .zone-education { border-top: 1px solid var(--border) !important; }
}

@media (max-width: 600px) {
  .zone { padding: 20px; }
  .topbar { padding: 10px 20px; font-size: 0.68rem; }
  .avatar { width: 48px; height: 48px; font-size: 1rem; }
  .hero-line { font-size: 1.4rem; }
  .contact-row { grid-template-columns: 70px 1fr auto; gap: 8px; font-size: 0.8rem; }
}

/* =========================================
   REDUCED MOTION
   ========================================= */
@media (prefers-reduced-motion: reduce) {
  .status-dot, .cursor, .now-dot { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
