/* ============================================================
   Portfolio stylesheet — Mantas Santockis
   AI Automation Engineer / Backend Developer
   ============================================================ */

/* ── TOKENS ── */
:root {
  --bg:        #FDFCF5;
  --paper:     #FFFFFF;
  --ink:       #1C1C1C;
  --yellow:    #F5C800;
  --cyan:      #00B8B8;
  --lime:      #7DC900;
  --pink:      #FF6FC8;
  --border:    2px solid #1C1C1C;
  --sh:        4px 4px 0 #1C1C1C;
  --sh-lg:     7px 7px 0 #1C1C1C;
  --sh-sm:     2px 2px 0 #1C1C1C;
  --f-vt:      'VT323', monospace;
  --f-mono:    'Courier Prime', monospace;
  --f-body:    'Figtree', sans-serif;
  --pad-x:     clamp(20px, 5vw, 64px);
  --max:       1080px;
  --radius:    0px;
  --trans:     box-shadow .08s ease, transform .08s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* ── MOTION PREFERENCE ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ── BASE ── */
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpolygon points='2,1 2,16 6,12 9,19 11.5,18 8.5,11 14,11' fill='white' stroke='%231C1C1C' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 2 1, default;
}
a, button, [role="button"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M7 2v11l-2.5-2.5c-.8-.8-2-.3-2 .8v.2l5.5 8C9 21 11 22 13 22h2c2.8 0 5-2.2 5-5v-5c0-.8-.7-1.5-1.5-1.5S17 11.2 17 12v-1c0-.8-.7-1.5-1.5-1.5c-.4 0-.8.2-1.1.4C14.1 9.4 13.6 9 13 9c-.4 0-.8.1-1 .3V2c0-.8-.7-1.5-1.5-1.5S9 1.2 9 2z' fill='white' stroke='%231C1C1C' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 7 1, pointer;
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--ink); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ── LAYOUT ── */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad-x); }
.section { padding: 72px var(--pad-x); max-width: var(--max); margin: 0 auto; }
.section-border { border-bottom: var(--border); }

/* ── TYPOGRAPHY ── */
.label {
  font-family: var(--f-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 3px; color: #999; text-transform: uppercase;
  margin-bottom: 24px; display: flex; align-items: center; gap: 10px;
}
.label::after { content: ''; flex: 1; height: 1px; background: #ddd; }
.display {
  font-family: var(--f-vt);
  font-size: clamp(44px, 5vw, 58px);
  line-height: 1.05; color: var(--ink);
}
.display-accent { color: var(--cyan); }
.eyebrow {
  font-family: var(--f-mono); font-size: 12px; font-weight: 700;
  letter-spacing: 3px; color: var(--cyan); text-transform: uppercase;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.eyebrow::before { content: ''; display: inline-block; width: 20px; height: 2px; background: var(--cyan); }

/* ── NAV ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--yellow); border-bottom: var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad-x); height: 48px; gap: 16px;
}
.nav-logo {
  font-family: var(--f-mono); font-weight: 700; font-size: 15px;
  color: var(--ink); text-decoration: none;
}
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
  font-family: var(--f-mono); font-size: 12px; font-weight: 700;
  color: var(--ink); text-decoration: none; padding: 4px 10px; border: var(--border);
  transition: background .08s, color .08s;
}
.nav-links a:hover, .nav-links a:focus-visible { background: var(--ink); color: var(--yellow); }
.nav-cta {
  font-family: var(--f-mono); font-size: 12px; font-weight: 700;
  color: var(--ink); text-decoration: none; background: var(--paper);
  border: var(--border); padding: 5px 14px;
  box-shadow: var(--sh); white-space: nowrap; transition: var(--trans);
}
.nav-cta:hover { box-shadow: var(--sh-sm); transform: translate(2px, 2px); }

/* ── BUTTONS ── */
.btn {
  font-family: var(--f-mono); font-size: 13px; font-weight: 700;
  padding: 11px 20px; border: var(--border); text-decoration: none;
  display: inline-block; box-shadow: var(--sh);
  background: var(--paper); color: var(--ink);
  transition: var(--trans);
}
.btn:hover { box-shadow: var(--sh-sm); transform: translate(2px, 2px); }
.btn--dark  { background: var(--ink);    color: var(--yellow); }
.btn--lime  { background: var(--lime);   color: var(--ink); }
.btn--sm    { font-size: 11px; padding: 4px 10px; box-shadow: var(--sh-sm); }

/* ── HERO ── */
.hero {
  padding: 72px var(--pad-x) 64px;
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 340px;
  gap: 48px; align-items: center;
  border-bottom: var(--border);
}
.hero-name {
  font-family: var(--f-vt);
  font-size: clamp(80px, 12vw, 134px);
  line-height: .88; color: var(--ink); margin-bottom: 20px;
  letter-spacing: -1px;
}
.hero-name-accent { color: var(--cyan); display: block; }
.hero-desc {
  font-size: 18px; line-height: 1.7; color: #3a3a3a;
  max-width: 480px; margin-bottom: 28px;
}
.hero-desc strong { color: var(--ink); }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── WIN98 WINDOW (hero right) ── */
.win {
  border: var(--border); box-shadow: var(--sh-lg);
  background: var(--paper); overflow: hidden;
}
.win-bar {
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  padding: 5px 8px; display: flex; align-items: center;
  justify-content: space-between; user-select: none;
}
.win-title {
  font-family: var(--f-mono); font-size: 11px; font-weight: 700;
  color: #fff; display: flex; align-items: center; gap: 6px;
}
.win-title::before { content: '💾'; font-size: 13px; }
.win-btns-bar { display: flex; gap: 2px; }
.win-btn-bar {
  width: 16px; height: 14px; background: #c0c0c0; border-top: 1.5px solid #fff;
  border-left: 1.5px solid #fff; border-right: 1.5px solid #444; border-bottom: 1.5px solid #444;
  font-family: var(--f-mono); font-size: 10px; font-weight: 700;
  color: #000; display: flex; align-items: center; justify-content: center;
}
.win-menu {
  background: #c0c0c0; border-bottom: 1px solid #888;
  padding: 2px 6px; display: flex; gap: 2px;
}
.win-menu-item {
  font-family: var(--f-mono); font-size: 11px; color: #000;
  padding: 1px 8px; text-decoration: underline;
}
.win-menu-item:first-child { text-decoration-style: dotted; }
.win-body { padding: 12px 14px; }
.win-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 3px;
  font-family: var(--f-mono); font-size: 13px; font-weight: 700;
  border: 1.5px solid transparent;
  transition: background .08s, border-color .08s;
}
.win-row:hover { background: #000080; color: #fff; border-color: #000080; }
.win-row:hover .win-row-sub { color: #adf; }
.win-row-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.win-row-text { flex: 1; }
.win-row-name { display: block; line-height: 1.2; }
.win-row-sub { font-size: 10px; color: #888; font-weight: 400; display: block; }
.win-status {
  background: #c0c0c0; border-top: 1px solid #888;
  padding: 3px 8px; display: flex; gap: 0;
}
.win-status-cell {
  font-family: var(--f-mono); font-size: 10px; color: #000;
  padding: 1px 10px; border-right: 1px solid #888; flex: 1;
}
.win-status-cell:last-child { border-right: none; }

/* ── STATUS INDICATOR ── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: #2ECC71; animation: pulse-dot 2s infinite; }
.dot-yellow { background: var(--yellow); }
.dot-gray   { background: #ccc; }
@keyframes pulse-dot { 0%,100%{box-shadow:0 0 0 2px #b8f5d8} 50%{box-shadow:0 0 0 5px rgba(46,204,113,0)} }

/* ── ABOUT ── */
.about-grid { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: start; }

/* Fact table */
.fact-box { border: var(--border); box-shadow: var(--sh); background: var(--paper); overflow: hidden; }
.fact-head {
  background: var(--ink); color: var(--yellow);
  font-family: var(--f-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 2px; padding: 7px 14px; text-transform: uppercase;
}
.fact-row { display: grid; grid-template-columns: 86px 1fr; border-bottom: 1px solid #eee; }
.fact-row:last-child { border-bottom: none; }
.fact-k {
  padding: 10px 12px; background: #f7f6f0;
  font-family: var(--f-mono); font-size: 11px; font-weight: 700; color: #777;
  border-right: 1px solid #eee; display: flex; align-items: center;
}
.fact-v {
  padding: 10px 12px; font-family: var(--f-mono); font-size: 13px; color: var(--ink);
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}
.tag {
  font-family: var(--f-mono); font-size: 11px; font-weight: 700;
  padding: 2px 7px; border: 1.5px solid var(--ink);
}
.tag-y { background: var(--yellow); }
.tag-c { background: #d4f5f5; }
.tag-l { background: #e8f9c8; }

/* About text */
.about-text-col {}
.about-text-col p { font-size: 16px; line-height: 1.78; color: #3a3a3a; margin-bottom: 14px; }
.about-text-col p:last-child { margin-bottom: 0; }
.about-text-col strong { color: var(--ink); }

/* Metrics strip */
.metrics {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--ink);
  border: var(--border); box-shadow: var(--sh);
  margin-top: 28px;
}
.metric {
  background: var(--paper); padding: 18px 16px; text-align: center;
}
.metric-num {
  font-family: var(--f-vt); font-size: 52px; line-height: 1;
  color: var(--ink); display: block;
}
.metric-label {
  font-family: var(--f-mono); font-size: 10px; font-weight: 700;
  color: #888; letter-spacing: 1px; text-transform: uppercase;
  display: block; margin-top: 4px;
}

/* ── SKILLS ── */
.skills-bg { background: var(--bg); border-top: var(--border); border-bottom: var(--border); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.skill-group {
  border: var(--border);
  background: var(--paper);
  box-shadow: var(--sh);
  padding: 16px 18px;
}
.skill-group-title {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── WORKS ── */
.works-bg { background: #F5F4EE; border-top: var(--border); border-bottom: var(--border); }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.wcard {
  border: var(--border); background: var(--paper); box-shadow: var(--sh);
  text-decoration: none; color: var(--ink); display: block;
  transition: var(--trans);
}
.wcard:hover { box-shadow: var(--sh-lg); transform: translate(-3px, -3px); }
.wcard-thumb {
  height: 96px; display: flex; align-items: center; justify-content: center;
  font-size: 48px; border-bottom: var(--border); position: relative; overflow: hidden;
}
.wcard-thumb--y { background: #FFFAE0; }
.wcard-thumb--c { background: #E0FFFE; }
.wcard-thumb--l { background: #EFFFDE; }
.wcard-thumb--p { background: #FFF0F8; }
.wcard-result {
  position: absolute; bottom: 0; right: 0;
  font-family: var(--f-mono); font-size: 10px; font-weight: 700;
  background: var(--ink); color: var(--yellow);
  padding: 3px 8px; letter-spacing: 1px;
}
.wcard-body { padding: 16px 18px; }
.wcard-meta {
  font-family: var(--f-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 2px; color: #999; text-transform: uppercase; margin-bottom: 5px;
}
.wcard-name { font-family: var(--f-vt); font-size: 27px; line-height: 1.1; margin-bottom: 8px; }
.wcard-desc { font-size: 14px; line-height: 1.6; color: #555; margin-bottom: 12px; }
.wcard-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.wtag { font-family: var(--f-mono); font-size: 10px; font-weight: 700; padding: 2px 6px; border: 1.5px solid #ccc; color: #666; }

/* ── CONTACT ── */
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.c-lede { font-size: 17px; line-height: 1.7; color: #3a3a3a; margin-bottom: 24px; }
.clinks { display: flex; flex-direction: column; gap: 8px; }
.clink {
  display: flex; align-items: center; gap: 14px;
  border: var(--border); background: var(--paper); box-shadow: var(--sh);
  padding: 13px 16px; text-decoration: none; color: var(--ink);
  transition: var(--trans), background .08s;
}
.clink:hover { background: var(--yellow); box-shadow: var(--sh-lg); transform: translate(-2px, -2px); }
.clink-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.clink-lbl { font-family: var(--f-mono); font-size: 10px; font-weight: 700; color: #888; letter-spacing: 1px; text-transform: uppercase; }
.clink-val { font-family: var(--f-mono); font-size: 14px; font-weight: 700; color: var(--ink); }

/* Form */
.cform { border: var(--border); box-shadow: var(--sh); background: var(--paper); overflow: hidden; }
.cform-head {
  background: var(--ink); color: var(--yellow);
  font-family: var(--f-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 2px; padding: 8px 14px; text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
}
.cform-win-btns { display: flex; gap: 4px; }
.cform-win-btn {
  width: 12px; height: 12px; border: 1.5px solid rgba(245,200,0,0.4);
  font-size: 7px; display: flex; align-items: center; justify-content: center;
  color: rgba(245,200,0,0.5); font-family: var(--f-mono);
}
.cform-body { padding: 20px; }
.fg { margin-bottom: 14px; }
.fg label {
  display: block; font-family: var(--f-mono); font-size: 11px; font-weight: 700;
  color: #888; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 5px;
}
.fg input, .fg textarea {
  width: 100%; font-family: var(--f-body); font-size: 15px;
  padding: 9px 11px; border: var(--border); background: var(--bg);
  color: var(--ink); outline: none; transition: border-color .08s, box-shadow .08s;
}
.fg input:focus, .fg textarea:focus { border-color: var(--cyan); box-shadow: 2px 2px 0 var(--cyan); }
.fg textarea { resize: vertical; min-height: 90px; }
.fg input.invalid, .fg textarea.invalid { border-color: #e00; }
.field-error {
  font-family: var(--f-mono); font-size: 11px; color: #e00;
  margin-top: 4px; display: none;
}
.field-error.show { display: block; }

/* ── FOOTER ── */
.footer {
  background: var(--ink); border-top: var(--border);
  padding: 20px var(--pad-x);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-name { font-family: var(--f-mono); font-size: 14px; font-weight: 700; color: var(--yellow); }
.footer-meta { font-family: var(--f-mono); font-size: 11px; color: #555; }
.footer-fun  { font-family: var(--f-mono); font-size: 10px; color: #444; }

/* ── SCROLL REVEAL ── */
.sr { transition: opacity .45s ease, transform .45s ease; }
.sr.hidden { opacity: 0; transform: translateY(18px); }
.sr.in     { opacity: 1; transform: none; }

/* ── PAGE LOAD ── */
@keyframes fu { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero-anim-1 { animation: fu .4s ease .05s both; }
.hero-anim-2 { animation: fu .4s ease .15s both; }
.hero-anim-3 { animation: fu .4s ease .25s both; }
.hero-anim-4 { animation: fu .4s ease .32s both; }
.hero-anim-r { animation: fu .4s ease .20s both; }

/* ── RESPONSIVE ── */
@media (max-width: 840px) {
  .hero            { grid-template-columns: 1fr; gap: 24px; }
  .hero-win-wrap   { display: none; }
  .about-grid      { grid-template-columns: 1fr; }
  .cgrid           { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nav-links       { display: none; }
  .hero-name       { font-size: 76px; }
  .metrics         { grid-template-columns: 1fr; }
}

/* ============================================================
   CHATBOT — multi-agent RAG widget (Win98 retro)
   ============================================================ */

/* Floating launcher */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 13px; font-weight: 700;
  padding: 11px 16px; border: var(--border); background: var(--yellow);
  color: var(--ink); box-shadow: var(--sh); cursor: pointer;
  transition: var(--trans);
}
.chat-fab:hover { box-shadow: var(--sh-sm); transform: translate(2px, 2px); }
.chat-fab-icon { font-size: 16px; }

/* Window */
.chat-win {
  position: fixed; right: 22px; bottom: 22px; z-index: 201;
  width: 360px; max-width: calc(100vw - 24px);
  height: 520px; max-height: calc(100vh - 24px);
  background: var(--paper); border: var(--border); box-shadow: var(--sh-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: chat-pop .18s ease both;
}
.chat-win[hidden] { display: none; }
@keyframes chat-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.chat-bar {
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  padding: 6px 8px; display: flex; align-items: center;
  justify-content: space-between; user-select: none;
}
.chat-title {
  font-family: var(--f-mono); font-size: 11px; font-weight: 700; color: #fff;
}
.chat-title::before { content: '🤖 '; }
.chat-bar-btns { display: flex; gap: 3px; }
.chat-bar-btn {
  width: 20px; height: 18px; background: #c0c0c0;
  border-top: 1.5px solid #fff; border-left: 1.5px solid #fff;
  border-right: 1.5px solid #444; border-bottom: 1.5px solid #444;
  font-family: var(--f-mono); font-size: 11px; font-weight: 700; color: #000;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.chat-bar-btn:active {
  border-top: 1.5px solid #444; border-left: 1.5px solid #444;
  border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff;
}

.chat-sub {
  background: #c0c0c0; border-bottom: 1px solid #888;
  padding: 4px 10px; font-family: var(--f-mono); font-size: 10px;
  color: #000; letter-spacing: 1px; text-transform: uppercase;
}

.chat-log {
  flex: 1; overflow-y: auto; padding: 12px;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--f-body); font-size: 14px; line-height: 1.5;
}
.chat-msg {
  padding: 8px 11px; border: 1.5px solid var(--ink); max-width: 88%;
  white-space: pre-wrap; word-wrap: break-word;
}
.chat-msg--bot  { background: var(--paper); align-self: flex-start; }
.chat-msg--user { background: var(--yellow); align-self: flex-end; }
.chat-msg--typing { background: var(--paper); align-self: flex-start; opacity: .7; font-style: italic; }

.chat-topics,
.chat-languages {
  display: flex; gap: 6px; padding: 10px 12px;
  background: #f7f6f0; border-top: 1px solid #ddd;
  flex-wrap: wrap;
}
.chat-topics[hidden],
.chat-languages[hidden] { display: none; }
.chat-topic {
  flex: 1; min-width: 90px;
  font-family: var(--f-mono); font-size: 11px; font-weight: 700;
  padding: 7px 10px; border: var(--border); background: var(--paper);
  color: var(--ink); box-shadow: var(--sh-sm); cursor: pointer;
  transition: var(--trans);
}
.chat-topic:hover { background: var(--cyan); color: #fff; }

.chat-form {
  display: flex; gap: 6px; padding: 10px;
  background: #c0c0c0; border-top: 1px solid #888;
}
.chat-form input {
  flex: 1; font-family: var(--f-body); font-size: 14px;
  padding: 8px 10px; border: var(--border); background: var(--paper);
  color: var(--ink); outline: none;
}
.chat-form input:focus { border-color: var(--cyan); box-shadow: 2px 2px 0 var(--cyan); }
.chat-form input:disabled { background: #eee; color: #888; }
.chat-send {
  font-family: var(--f-mono); font-size: 14px; font-weight: 700;
  padding: 0 14px; border: var(--border); background: var(--lime);
  color: var(--ink); box-shadow: var(--sh-sm); cursor: pointer;
  transition: var(--trans);
}
.chat-send:hover:not(:disabled) { box-shadow: none; transform: translate(2px, 2px); }
.chat-send:disabled { background: #ddd; cursor: not-allowed; }

@media (max-width: 480px) {
  .chat-win  { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 100px); }
  .chat-fab  { right: 12px; bottom: 12px; }
  .chat-fab-label { display: none; }
}
