/* mohammadarab.dev — rules of the house:
   one accent, used for meaning. flat warm-dark surfaces, mono chrome, sans prose.
   project tabs re-theme the page: accent + background shift per project. */

:root {
  color-scheme: dark;
  --bg: #0e0c09;
  --surface: #16130f;
  --surface2: #1e1a15;
  --surface3: #26211a;
  --line: #2c261f;
  --line-strong: #3f3729;
  --text: #ece5da;
  --soft: #c9c0b0;
  --muted: #94897a;
  --accent: #e8a03d;
  --accent-ink: #191207;
  --r: 6px;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.25, 1);
}
body[data-theme="jinto"] { --accent: #e8574a; --bg: #150c0a; }
body[data-theme="yapstage"] { --accent: #6f8fd4; --bg: #0b0e16; }

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; }
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.5s ease;
  overflow-x: hidden;
}
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; transition: color 0.3s ease; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0.75; }

#frame {
  position: relative; z-index: 1;
  max-width: 880px; margin: 0 auto;
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 0 28px;
}

/* ---------- header / tabs ---------- */
#top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 0 18px;
}
#brand {
  font-family: var(--mono); font-weight: 800; font-size: 22px; color: var(--text);
}
#brand span { color: var(--accent); }
#brand:hover { text-decoration: none; }
#tabs { display: flex; gap: 4px; }
.tab {
  font-family: var(--mono); font-size: 12px; padding: 8px 12px;
  color: var(--muted); border-radius: var(--r);
  transition: color 0.2s ease;
}
.tab .n { color: var(--line-strong); margin-right: 5px; transition: color 0.2s ease; }
.tab:hover { color: var(--soft); }
.tab.on { color: var(--text); }
.tab.on .n { color: var(--accent); }
.tab.on { box-shadow: inset 0 -2px 0 var(--accent); border-radius: var(--r) var(--r) 0 0; }

/* ---------- view ---------- */
#view { flex: 1; padding: 34px 0 40px; }
.pane { animation: paneIn 0.24s var(--ease); }
@keyframes paneIn { from { opacity: 0; transform: translateY(10px); } }

h1 { font-family: var(--mono); font-size: clamp(30px, 5.5vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
h1 .dot { color: var(--accent); }
.pane h2 {
  font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted);
  margin: 26px 0 12px;
}
.pane h2::before { content: "# "; color: var(--accent); }
p { line-height: 1.65; color: var(--soft); }

/* ---------- hello ---------- */
.hero { display: flex; gap: 44px; align-items: flex-start; }
.hero-text { flex: 1; min-width: 0; }
.tagline { font-size: 17px; color: var(--soft); margin: 12px 0 4px; }
.locline { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 22px; }

.photo-wrap { position: relative; flex: none; margin-top: 6px; }
.photo-wrap::after {
  content: ""; position: absolute; inset: 0;
  transform: translate(10px, 10px);
  border: 1px solid var(--accent); border-radius: var(--r);
  z-index: -1; transition: border-color 0.3s ease;
}
.photo { width: 200px; height: 200px; object-fit: cover; border-radius: var(--r); display: block; border: 1px solid var(--line-strong); }

.spec {
  display: grid; grid-template-columns: 110px 1fr; gap: 9px 18px;
  padding: 18px; margin-top: 6px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--line); border-radius: var(--r);
}
.spec dt { font-family: var(--mono); font-size: 11px; color: var(--muted); padding-top: 2px; }
.spec dd { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.spec dd .sub { color: var(--muted); font-size: 13px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r);
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  background: var(--accent); color: var(--accent-ink);
  transition: background 0.3s ease;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn.ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--line-strong); font-weight: 500; }
.btn.ghost:hover { border-color: var(--muted); filter: none; }

/* ---------- experience ---------- */
.xp { border-left: 1px solid var(--line-strong); margin-left: 5px; padding-left: 22px; }
.xp-item { position: relative; padding-bottom: 26px; }
.xp-item:last-child { padding-bottom: 4px; }
.xp-item::before {
  content: ""; position: absolute; left: -26.5px; top: 7px; width: 8px; height: 8px;
  background: var(--accent); transform: rotate(45deg); border-radius: 1px;
  transition: background 0.3s ease;
}
.xp-item h3 { font-size: 16.5px; font-weight: 700; }
.xp-item h3 em { font-style: normal; color: var(--accent); }
.xp-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin: 4px 0 8px; }
.xp-item ul { list-style: none; }
.xp-item li { font-size: 14px; color: var(--soft); line-height: 1.6; padding-left: 16px; position: relative; margin-bottom: 4px; }
.xp-item li::before { content: "·"; position: absolute; left: 2px; color: var(--accent); }

/* ---------- projects ---------- */
.proj-switch { display: flex; gap: 6px; margin-bottom: 22px; }
.proj-tab {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  padding: 9px 16px; border-radius: var(--r);
  color: var(--muted); border: 1px solid var(--line);
  transition: all 0.25s ease;
}
.proj-tab:hover { color: var(--soft); border-color: var(--line-strong); }
.proj-tab.on { color: var(--accent-ink); background: var(--accent); border-color: transparent; }

.proj {
  position: relative; overflow: hidden;
  padding: 30px 32px 28px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid var(--line); border-radius: var(--r);
  animation: paneIn 0.28s var(--ease);
}
.proj .motif { position: absolute; right: -30px; top: -30px; opacity: 0.1; pointer-events: none; }
.proj-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; }
.proj-head h3 { font-family: var(--mono); font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -0.02em; }
.pill {
  font-family: var(--mono); font-size: 11px; padding: 4px 10px; border-radius: 4px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.proj .lede { font-size: 17px; color: var(--text); margin: 10px 0 12px; }
.proj .desc { max-width: 60ch; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.chip {
  font-family: var(--mono); font-size: 11.5px; padding: 4px 10px; border-radius: 4px;
  background: var(--surface2); border: 1px solid var(--line); color: var(--soft);
}
.foot-note { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 18px; }

/* ---------- skills ---------- */
.skills-note { font-size: 13px; color: var(--muted); margin-top: 22px; }

/* ---------- footer ---------- */
#foot {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 16px 0 22px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}

/* ---------- mo.bot ---------- */
#chatfab {
  position: fixed; right: 22px; bottom: 22px; z-index: 100;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s var(--ease), background 0.3s ease;
}
#chatfab:hover { transform: scale(1.08); }
#chatfab svg { width: 30px; height: 30px; }

#chatpanel {
  position: fixed; right: 22px; bottom: 86px; z-index: 100;
  width: 340px; height: 480px; max-height: calc(100vh - 110px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: chatIn 0.2s var(--ease);
}
@keyframes chatIn { from { opacity: 0; transform: translateY(14px); } }
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: var(--surface2); border-bottom: 1px solid var(--line);
}
.chat-head .bot-ava { width: 30px; height: 30px; }
.chat-name { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.chat-status { font-family: var(--mono); font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.chat-status .dot { width: 6px; height: 6px; border-radius: 50%; background: #9db27a; }
.chat-close { margin-left: auto; color: var(--muted); width: 28px; height: 28px; border-radius: 4px; display: grid; place-items: center; }
.chat-close:hover { background: var(--surface3); color: var(--text); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 8px; max-width: 88%; }
.msg.bot { align-self: flex-start; }
.msg.me { align-self: flex-end; }
.msg .bot-ava { width: 22px; height: 22px; flex: none; align-self: flex-end; }
.bubble { padding: 8px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.55; }
.msg.bot .bubble { background: var(--surface2); border: 1px solid var(--line); color: var(--soft); border-bottom-left-radius: 3px; }
.msg.me .bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 3px; }
.bubble.typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.bubble.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: 0.2s; }
.bubble.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
.chip-tray { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 30px; }
.chatchip {
  font-family: var(--mono); font-size: 11px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--soft); background: var(--surface);
}
.chatchip:hover { border-color: var(--accent); color: var(--text); }
.chatchip.action { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-in {
  flex: 1; padding: 8px 12px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--line);
  color: var(--text); font: inherit; font-size: 13px; outline: none;
}
.chat-in:focus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.chat-send { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }

/* robot avatar eye blink */
.bot-ava .eye { animation: botblink 4.5s infinite; transform-origin: center; }
@keyframes botblink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.12); } }

/* ---------- responsive ---------- */
@media (max-width: 700px) {
  #frame { padding: 0 18px; }
  #top { flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 20px; }
  #tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tab { padding: 8px 9px; white-space: nowrap; }
  .hero { flex-direction: column-reverse; gap: 26px; }
  .photo { width: 152px; height: 152px; }
  .spec { grid-template-columns: 96px 1fr; }
  .proj { padding: 22px 18px; }
  #chatpanel { right: 10px; left: 10px; width: auto; bottom: 84px; }
  .foot-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
