/* ============ Tokens ============ */
:root{
  --bg: #0A0E13;
  --panel: #10151C;
  --panel-2: #161C25;
  --line: rgba(237,239,242,0.09);
  --text: #EDEFF2;
  --muted: #7C8A99;

  --amber: #F2B84B;
  --amber-soft: rgba(242,184,75,0.12);
  --teal: #5FD4C0;
  --teal-soft: rgba(95,212,192,0.12);
  --danger: #E8735B;

  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;

  --radius: 16px;
}

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

body{
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  background-image:
    radial-gradient(circle at 85% 0%, rgba(242,184,75,0.05), transparent 40%),
    radial-gradient(circle at 10% 30%, rgba(95,212,192,0.04), transparent 45%);
}

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

/* ============ Light mode ============ */
body.light{
  --bg: #F5F3EE;
  --panel: #FFFFFF;
  --panel-2: #FBF9F5;
  --line: rgba(10,14,19,0.09);
  --text: #14181D;
  --muted: #6B7280;
  --amber-soft: rgba(242,184,75,0.18);
  --teal-soft: rgba(95,212,192,0.18);
}

/* ============ Nav ============ */
nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 18px 6%;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  display:flex;
  align-items:center;
  gap: 9px;
}

.logo-dot{
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}

.menu{
  display:flex;
  gap: 28px;
  font-size: 15px;
}

.menu a{
  color: var(--muted);
  transition: color .2s ease;
  position: relative;
}
.menu a:hover{ color: var(--text); }

#theme-toggle{
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  display:flex; align-items:center; justify-content:center;
  transition: border-color .2s ease;
}
#theme-toggle:hover{ border-color: var(--amber); }

.menu-toggle{
  display:none;
  flex-direction:column;
  gap:5px;
  background:none;
  border:none;
  cursor:pointer;
  padding: 6px;
}
.menu-toggle span{
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ============ Hero ============ */
.hero{
  padding: 90px 6% 70px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.hero-inner{ max-width: 720px; margin: 0 auto; }

.hero-query{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--teal);
  direction: ltr;
  background: var(--teal-soft);
  border: 1px solid rgba(95,212,192,0.25);
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 26px;
}

.hero h1{
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.hero .role{
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--amber);
  margin-bottom: 18px;
}
.hero .role .dot{ color: var(--muted); margin: 0 6px; }

.hero .tagline{
  color: var(--muted);
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto 34px;
}

.hero-actions{
  display:flex;
  gap: 14px;
  justify-content:center;
  flex-wrap: wrap;
}

.btn{
  padding: 13px 26px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  transition: transform .15s ease, filter .15s ease, border-color .15s ease;
}
.btn-primary{
  background: var(--amber);
  color: #14181D;
}
.btn-primary:hover{ filter: brightness(1.08); transform: translateY(-1px); }

.btn-ghost{
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover{ border-color: var(--teal); }

/* ============ Section shared ============ */
.section-head{
  max-width: 1100px;
  margin: 0 auto 30px;
  padding: 0 6%;
}

.eyebrow{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  direction: ltr;
  display:block;
  margin-bottom: 8px;
}

.section-head h2{
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

.skills, .projects{ padding: 60px 0; }

.cards{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 6%;
}

.card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover{
  transform: translateY(-4px);
  border-color: var(--amber);
}

.card-tag{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--teal);
  direction: ltr;
  display:inline-block;
  margin-bottom: 12px;
}

.card h3{
  font-family: var(--font-display);
  font-size: 19px;
  margin-bottom: 10px;
}

.card p{ color: var(--muted); font-size: 14.5px; }

.pills{ display:flex; flex-wrap:wrap; gap:8px; }
.pill{
  font-size: 12.5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--muted);
}

.project-card p{ line-height: 1.6; }

/* ============ Chat ============ */
.chat-container{
  padding: 60px 0 80px;
}

.chat-window{
  max-width: 900px;
  margin: 0 auto;
  padding: 0 6%;
}

#chat-box{
  height: 440px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display:flex;
  flex-direction: column;
  gap: 14px;
}

#chat-box::-webkit-scrollbar{ width:6px; }
#chat-box::-webkit-scrollbar-thumb{ background: var(--panel-2); border-radius:4px; }

.chat-empty{
  margin:auto;
  color: var(--muted);
  font-size: 14px;
  text-align:center;
}

.message-user, .message-ai{
  padding: 12px 16px;
  border-radius: 14px;
  width: fit-content;
  max-width: 78%;
  font-size: 15px;
  line-height: 1.6;
}

.message-user{
  background: var(--amber);
  color: #14181D;
  font-weight: 500;
  margin-inline-start: auto;
  border-bottom-left-radius: 4px;
}

.message-ai{
  background: var(--panel-2);
  border: 1px solid var(--line);
  margin-inline-end: auto;
  border-bottom-right-radius: 4px;
}

.loading{
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 4px 2px;
}

.input-area{
  display:flex;
  gap: 10px;
  margin-top: 18px;
}

.input-area input{
  flex:1;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 15px;
  outline: none;
  background: var(--panel);
  color: var(--text);
  caret-color: var(--amber);
  transition: border-color .15s ease;
}
.input-area input::placeholder{ color: var(--muted); }
.input-area input:focus{ border-color: var(--amber); }

.input-area button{
  padding: 14px 28px;
  background: var(--amber);
  border: none;
  color: #14181D;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: filter .15s ease;
}
.input-area button:hover{ filter: brightness(1.08); }

/* ============ Footer ============ */
footer{
  text-align:center;
  color: var(--muted);
  font-size: 14px;
  padding: 30px 0 50px;
  border-top: 1px solid var(--line);
}

/* ============ Responsive ============ */
@media (max-width: 760px){
  .menu{
    position: absolute;
    top: 100%;
    right: 0; left: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 16px 6%;
    display: none;
    gap: 16px;
  }
  .menu.open{ display: flex; }
  .menu-toggle{ display:flex; }

  .hero h1{ font-size: 34px; }
  .hero .tagline{ font-size: 14.5px; }

  .message-user, .message-ai{ max-width: 88%; }
}

@media (prefers-reduced-motion: reduce){
  .card, .btn{ transition: none; }
}
