/* ==========================================================
   USMAN AMIR — DEVELOPER PORTFOLIO (Editor / IDE theme)
   ========================================================== */

:root {
  --bg: #0b0e14;
  --bg-elevated: #10141d;
  --bg-panel: #0e1119;
  --surface: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #cbccc6;
  --text-bright: #f2f3ee;
  --muted: #6c7380;

  --amber: #ffb454;
  --teal: #5ccfe6;
  --pink: #f07178;
  --green: #7fd88f;
  --purple: #b39eea;

  --gradient: linear-gradient(120deg, var(--amber), #ff9d5c 45%, var(--pink));

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --sidebar-w: 250px;
  --tabbar-h: 56px;
  --statusbar-h: 30px;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { 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 {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; color: var(--text-bright); }
a { text-decoration: none; color: inherit; }
strong { color: var(--text-bright); font-weight: 600; }
::selection { background: rgba(255, 180, 84, 0.25); color: var(--text-bright); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- syntax token colors (reused everywhere) ---------- */
.kw { color: var(--purple); }
.str { color: var(--green); }
.fn { color: var(--teal); }
.op { color: var(--muted); }

/* ---------- ambient background ---------- */
.grid-overlay {
  position: fixed; inset: 0; z-index: 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: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.ambient-glow { position: fixed; z-index: 0; pointer-events: none; border-radius: 50%; filter: blur(130px); opacity: 0.16; animation: drift 22s infinite ease-in-out; }
.glow-1 { width: 480px; height: 480px; background: var(--amber); top: -12%; left: 10%; }
.glow-2 { width: 420px; height: 420px; background: var(--teal); bottom: -10%; right: 0; animation-delay: -11s; }
@keyframes drift { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-25px) scale(1.08); } }

/* ---------- boot loader ---------- */
.boot-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
.boot-loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-window { width: min(420px, 86vw); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.boot-dots { display: flex; gap: 6px; padding: 14px 16px; background: #0d101a; }
.boot-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.boot-lines { font-family: var(--font-mono); font-size: 12.5px; padding: 18px 20px 24px; min-height: 120px; color: var(--muted); }
.boot-lines .line { margin-bottom: 8px; opacity: 0; animation: fadeIn 0.25s forwards; }
.boot-lines .line.ok { color: var(--green); }
@keyframes fadeIn { to { opacity: 1; } }

/* ---------- shell layout ---------- */
.editor-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* Sidebar */
.file-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 200;
  padding: 20px 16px;
  transition: transform 0.35s var(--ease);
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--gradient); color: #0b0e14; font-family: var(--font-display); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.brand-name { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--text-bright); }
.brand-name span { color: var(--amber); }
.sidebar-close { display: none; background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; }

.sidebar-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 10px; padding-left: 4px; }
.file-tree { display: flex; flex-direction: column; gap: 2px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; color: var(--muted);
  padding: 9px 10px; border-radius: var(--radius-sm);
  transition: 0.2s; border-left: 2px solid transparent;
}
.file-item i { width: 14px; font-size: 12px; opacity: 0.8; }
.file-item:hover { background: var(--surface); color: var(--text); }
.file-item.active { background: rgba(255,180,84,0.08); color: var(--amber); border-left-color: var(--amber); }

.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); }
.sidebar-socials { display: flex; gap: 8px; margin-bottom: 14px; }
.sidebar-socials a { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); transition: 0.25s; }
.sidebar-socials a:hover { border-color: var(--amber); color: var(--amber); transform: translateY(-2px); }
.available-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-family: var(--font-mono); color: var(--green); background: rgba(127,216,143,0.08); border: 1px solid rgba(127,216,143,0.25); padding: 6px 11px; border-radius: 999px; }
.available-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(127,216,143,0.5); } 50% { box-shadow: 0 0 0 5px rgba(127,216,143,0); } }

.sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 190; backdrop-filter: blur(2px); }

/* Main column */
.editor-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }

.tab-bar {
  height: var(--tabbar-h); position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 4px;
  background: rgba(11,14,20,0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
}
.menu-btn { display: none; background: none; border: 1px solid var(--border); color: var(--text); width: 36px; height: 36px; border-radius: var(--radius-sm); cursor: pointer; font-size: 15px; flex-shrink: 0; margin-right: 8px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
  padding: 9px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  white-space: nowrap; border-bottom: 2px solid transparent; transition: 0.2s;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.active { color: var(--amber); border-bottom-color: var(--amber); background: var(--surface); }
.tab-cta { flex-shrink: 0; margin-left: 10px; background: var(--gradient); color: #0b0e14; font-weight: 700; font-size: 12.5px; padding: 9px 16px; border-radius: 999px; transition: 0.25s; }
.tab-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(255,180,84,0.25); }

.editor-content { flex: 1; }

/* Panels */
.panel { position: relative; padding: 90px 48px; border-bottom: 1px solid var(--border); }
.panel-alt { background: rgba(255,255,255,0.015); }
.panel-inner { max-width: 1080px; margin: 0 auto; position: relative; }
.file-breadcrumb {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  max-width: 1080px; margin: 0 auto 34px; display: flex; align-items: center; gap: 8px;
}
.file-breadcrumb i { color: var(--amber); }

.gutter { display: none; }

/* ---------- Hero ---------- */
.hero-panel { padding-top: 60px; min-height: calc(100vh - var(--tabbar-h) - var(--statusbar-h)); display: flex; flex-direction: column; justify-content: center; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 60px; align-items: center; max-width: 1160px; margin: 0 auto; width: 100%; }
.code-comment { font-family: var(--font-mono); color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.hero-title { font-size: clamp(30px, 4vw, 44px); line-height: 1.3; margin-bottom: 18px; font-family: var(--font-mono); font-weight: 600; }
.hero-role { font-family: var(--font-mono); font-size: clamp(16px, 2vw, 19px); color: var(--text); margin-bottom: 22px; min-height: 30px; font-weight: 400; }
.hero-role .op { color: var(--amber); }
.role-text { color: var(--teal); font-weight: 600; }
.type-cursor { color: var(--amber); animation: blink 0.9s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.hero-desc { color: var(--muted); max-width: 500px; font-size: 15.5px; margin-bottom: 30px; }
.hero-btns { display: flex; gap: 12px; margin-bottom: 34px; flex-wrap: wrap; }
.btn { padding: 13px 22px; border-radius: 999px; font-weight: 700; font-size: 13px; transition: 0.25s var(--ease); border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-body); }
.btn-primary { background: var(--gradient); color: #0b0e14; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(255,157,92,0.28); }
.btn-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-3px); }
.hero-stats { display: flex; gap: 34px; }
.h-stat span.counter { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--amber); display: block; }
.h-stat small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* IDE card */
.hero-visual { display: flex; justify-content: center; }
.ide-card { width: 100%; max-width: 440px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.55); transform: perspective(1200px) rotateY(-4deg) rotateX(2deg); transition: transform 0.5s var(--ease); }
.ide-card:hover { transform: perspective(1200px) rotateY(0deg) rotateX(0deg); }
.ide-titlebar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.ide-titlebar .dots { display: flex; gap: 6px; }
.ide-titlebar .dots span { width: 10px; height: 10px; border-radius: 50%; }
.ide-titlebar .dots span:nth-child(1) { background: #ff5f57; }
.ide-titlebar .dots span:nth-child(2) { background: #febc2e; }
.ide-titlebar .dots span:nth-child(3) { background: #28c840; }
.ide-filename { font-family: var(--font-mono); font-size: 12px; color: var(--muted); flex: 1; }
.ide-titlebar i { color: var(--muted); font-size: 13px; }
.ide-body { display: flex; padding: 20px 0; }
.ide-gutter { display: flex; flex-direction: column; gap: 2px; padding: 0 14px; font-family: var(--font-mono); font-size: 12.5px; color: rgba(255,255,255,0.18); text-align: right; line-height: 2; }
.ide-code { font-family: var(--font-mono); font-size: 12.5px; line-height: 2; padding-right: 20px; color: var(--text); flex: 1; }
.ide-code .in1 { padding-left: 20px; }
.ide-code .in2 { padding-left: 40px; }
.ide-run { margin-top: 10px; color: var(--teal); }
.ide-run i { font-size: 10px; margin-right: 6px; }
.blinker { animation: blink 0.9s infinite; }

.scroll-indicator { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; animation: bounce 2.2s infinite; }
@keyframes bounce { 0%,100% { transform: translate(-50%,0); } 50% { transform: translate(-50%,7px); } }

/* ---------- About ---------- */
.about-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 54px; }
.md-preview { font-size: 15px; color: var(--muted); }
.md-h1 { font-family: var(--font-display); font-size: 26px; color: var(--text-bright); font-weight: 700; margin-bottom: 16px; }
.md-preview p { margin-bottom: 15px; }
.text-link { color: var(--amber); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; }
.text-link i { transition: 0.25s; }
.text-link:hover i { transform: translateX(4px); }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: start; }
.stat-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 20px; transition: 0.3s; background: var(--surface); }
.stat-card:hover { border-color: var(--amber); transform: translateY(-4px); }
.stat-card h3 { font-size: 27px; color: var(--amber); font-family: var(--font-display); }
.stat-card p { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Skills ---------- */
.json-open, .json-close { font-family: var(--font-mono); color: var(--muted); font-size: 15px; }
.json-close { margin-top: 4px; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 18px 0 18px 22px; }
.skill-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: 0.3s; }
.skill-card:hover { transform: translateY(-5px); border-color: var(--amber); }
.skill-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.skill-top i { font-size: 20px; }
.skill-top h3 { font-size: 13.5px; font-weight: 600; font-family: var(--font-body); color: var(--text-bright); }
.skill-bar { height: 5px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden; }
.skill-fill { height: 100%; background: var(--gradient); border-radius: 3px; width: 0; transition: width 1.3s var(--ease); }
.skill-pct { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-top: 8px; display: block; }

/* ---------- Projects ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: 0.35s var(--ease); display: flex; flex-direction: column; }
.project-card:hover { transform: translateY(-7px); border-color: var(--teal); box-shadow: 0 22px 50px rgba(0,0,0,0.4); }
.project-top { height: 130px; display: flex; align-items: center; justify-content: center; font-size: 46px; background: var(--bg-panel); color: var(--teal); position: relative; }
.project-ext { position: absolute; top: 12px; right: 14px; font-family: var(--font-mono); font-size: 10px; color: var(--muted); border: 1px solid var(--border); padding: 3px 7px; border-radius: 5px; }
.project-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.project-tags span { font-family: var(--font-mono); background: rgba(92,207,230,0.08); color: var(--teal); padding: 4px 9px; border-radius: 5px; font-size: 10px; font-weight: 600; }
.project-body h3 { margin-bottom: 8px; font-size: 17px; }
.project-body p { color: var(--muted); font-size: 13px; margin-bottom: 16px; flex: 1; }
.project-body a { color: var(--amber); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.project-body a i { transition: 0.25s; }
.project-body a:hover i { transform: translate(2px,-2px); }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.service-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: 0.3s; font-family: var(--font-mono); }
.service-card:hover { transform: translateY(-5px); border-color: var(--amber); }
.service-key { color: var(--purple); font-size: 12px; }
.service-icon { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; background: rgba(255,180,84,0.08); color: var(--amber); border-radius: 11px; font-size: 19px; margin: 14px 0 14px; }
.service-card h3 { margin-bottom: 8px; font-size: 16px; font-family: var(--font-body); }
.service-card p { color: var(--muted); font-size: 12.5px; font-family: var(--font-body); line-height: 1.6; }

/* ---------- Experience ---------- */
.terminal-log { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 28px; font-family: var(--font-mono); font-size: 13px; }
.log-line { color: var(--muted); margin-bottom: 20px; }
.log-line .prompt { color: var(--green); }
.log-line .path { color: var(--teal); margin: 0 6px; }
.log-line .op { color: var(--muted); margin-right: 8px; }
.log-entry { padding: 16px 0 16px 16px; border-left: 2px solid var(--border); margin-bottom: 4px; position: relative; }
.log-entry::before { content: ''; position: absolute; left: -6px; top: 22px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(255,180,84,0.15); }
.log-tag { color: var(--muted); font-size: 11px; }
.log-entry h3 { font-family: var(--font-body); font-size: 16px; margin: 6px 0 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.log-status { font-size: 10px; font-family: var(--font-mono); color: var(--muted); font-weight: 400; }
.log-status.live { color: var(--green); }
.log-entry p { color: var(--muted); font-family: var(--font-body); font-size: 13.5px; line-height: 1.7; }
.log-end { margin-top: 10px; margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact-head { text-align: center; max-width: 560px; margin: 0 auto 44px; }
.contact-head h2 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 12px; }
.accent-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.contact-head p { color: var(--muted); font-size: 14.5px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; max-width: 900px; margin: 0 auto; }
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 14px; transition: 0.3s; }
.contact-card:hover { border-color: var(--amber); transform: translateY(-4px); }
.contact-card > i:first-child { font-size: 21px; color: var(--amber); width: 24px; text-align: center; }
.contact-card small { display: block; color: var(--muted); font-size: 10px; }
.contact-card strong { font-size: 13px; }
.contact-card .go { margin-left: auto; color: var(--muted); font-size: 12px; opacity: 0; transition: 0.25s; }
.contact-card:hover .go { opacity: 1; color: var(--amber); }

/* ---------- Footer & status bar ---------- */
.footer { text-align: center; padding: 36px 20px; }
.footer p { color: var(--muted); font-size: 12px; font-family: var(--font-mono); }
.footer i { color: var(--pink); }

.status-bar {
  height: var(--statusbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  background: var(--amber); color: #0b0e14;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 0 16px;
}
.status-bar i { margin-right: 4px; }
.status-sep { width: 1px; height: 12px; background: rgba(11,14,20,0.25); }
.status-spacer { flex: 1; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.hero-inner .reveal { transition-delay: calc(var(--d, 0) * 90ms); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1000px) {
  .hero-inner, .about-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 420px; margin: 0 auto 10px; }
}

@media (max-width: 900px) {
  .file-sidebar { transform: translateX(-100%); box-shadow: 30px 0 60px rgba(0,0,0,0.4); }
  .file-sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-scrim.open { display: block; }
  .editor-main { margin-left: 0; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .tab-cta { display: none; }
  .panel { padding: 70px 22px; }
  .status-hide-sm { display: none; }
}

@media (max-width: 560px) {
  .hero-title { font-size: 26px; }
  .hero-btns { flex-direction: column; align-items: stretch; }
  .hero-btns .btn { justify-content: center; }
  .hero-stats { gap: 20px; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .ide-gutter { padding: 0 8px; }
  .ide-code { font-size: 11px; padding-right: 10px; }
  .contact-head h2 { font-size: 24px; }
}