/* ===== Design tokens (Slate & Sage Green Light Mode) ===== */
:root {
  --bg: #F4F6F5;
  --bg-alt: #E9ECEA;
  --surface: #FFFFFF;
  --surface-soft: #F7F9F8;
  --border: #E1E6E3;
  --border-strong: #C8D1CC;
  --text: #232B27;
  --text-soft: #5A625E;
  --text-mute: #8A938E;
  --accent: #5C7C64;
  --accent-2: #6B7F82;
  --accent-3: #A3B8A9;
  --accent-4: #C8D1CC;
  --prompt: #3D6146;
  --user-bubble: #E4ECE4;
  --user-text: #2D3B30;
  --link: #3D6146;
  --link-hover: #2A4331;
  --shadow-sm: 0 1px 2px rgba(30, 40, 35, 0.05), 0 1px 3px rgba(30, 40, 35, 0.07);
  --shadow-md: 0 4px 12px rgba(30, 40, 35, 0.07), 0 2px 6px rgba(30, 40, 35, 0.05);
  --shadow-lg: 0 12px 32px rgba(30, 40, 35, 0.09), 0 4px 12px rgba(30, 40, 35, 0.06);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
}

/* ===== Dark Mode Overrides ===== */
body.dark-mode {
  --bg: #15191A;
  --bg-alt: #1E2324;
  --surface: #1B2021;
  --surface-soft: #171C1D;
  --border: #2C3334;
  --border-strong: #3F4748;
  --text: #E2E8E4;
  --text-soft: #A9B3AE;
  --text-mute: #7A847F;
  --accent: #7CA88A;
  --accent-2: #8FA3A6;
  --accent-3: #A3B8A9;
  --accent-4: #3F4748;
  --prompt: #9DC2A8;
  --user-bubble: #2A3B30;
  --user-text: #D4E4D9;
  --link: #9DC2A8;
  --link-hover: #B6D4BD;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  background-image:
  radial-gradient(circle at 12% 18%, rgba(92, 124, 100, 0.08) 0%, transparent 35%),
  radial-gradient(circle at 88% 12%, rgba(107, 127, 130, 0.08) 0%, transparent 38%),
  radial-gradient(circle at 50% 100%, rgba(163, 184, 169, 0.08) 0%, transparent 45%);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
  background-image:
  radial-gradient(circle at 12% 18%, rgba(124, 168, 138, 0.10) 0%, transparent 35%),
  radial-gradient(circle at 88% 12%, rgba(143, 163, 166, 0.10) 0%, transparent 38%),
  radial-gradient(circle at 50% 100%, rgba(163, 184, 169, 0.08) 0%, transparent 45%);
}

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 12px 18px; border-radius: 0 0 var(--radius-sm) 0; z-index: 100; text-decoration: none; color: var(--text); border: 1px solid var(--border); }
.skip-link:focus { left: 0; }

.hero { padding: 80px 0 40px; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text-soft); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.hero-name { font-size: clamp(38px, 7vw, 64px); font-weight: 700; letter-spacing: -0.02em; background: linear-gradient(120deg, var(--text) 0%, var(--accent) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 8px; }
.hero-role { font-size: clamp(16px, 2.5vw, 20px); color: var(--accent); font-weight: 500; margin-bottom: 14px; }
.hero-tagline { color: var(--text-soft); max-width: 960px; margin: 0 auto; font-size: 16px; }

.terminal-section { padding: 30px 0 60px; }
.terminal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; min-height: 420px; }
.terminal-header { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: var(--surface-soft); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.terminal-dots { display: flex; gap: 7px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: block; }
.dot-1 { background: #A3B8A9; }
.dot-2 { background: #6B7F82; }
.dot-3 { background: #5C7C64; }
.terminal-title { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-mute); flex: 1; text-align: center; }
.terminal-status { font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); background: var(--bg-alt); padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }

.terminal-body { flex: 1; overflow-y: auto; padding: 20px 22px; font-family: var(--font-mono); font-size: 14px; line-height: 1.65; scroll-behavior: smooth; background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%); }
.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

.msg { margin-bottom: 14px; animation: msgIn 0.3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.msg-row { display: flex; gap: 8px; align-items: flex-start; }
.msg-label { font-weight: 600; flex-shrink: 0; user-select: none; }
.msg-user .msg-label { color: var(--accent-2); }
.msg-ai .msg-label { color: var(--prompt); }
.msg-content { flex: 1; word-wrap: break-word; overflow-wrap: break-word; }
.msg-user .msg-content { color: var(--user-text); background: var(--user-bubble); padding: 4px 10px; border-radius: var(--radius-sm); display: inline-block; }
.msg-ai .msg-content { color: var(--text); }
.msg-content p { margin-bottom: 6px; }
.msg-content a { color: var(--link); text-decoration: none; border-bottom: 1px dashed var(--link); transition: color 0.15s; }
.msg-content a:hover { color: var(--link-hover); border-bottom-style: solid; }
.msg-content code { background: var(--bg-alt); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; color: var(--text); }
.msg-content ul { list-style: none; margin: 6px 0; padding: 0; }
.msg-content ul li { padding: 2px 0 2px 16px; position: relative; }
.msg-content ul li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }

.dl-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dl-link { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-soft); border: 1px solid var(--border-strong); color: var(--text) !important; padding: 5px 11px; border-radius: var(--radius-sm); font-size: 12.5px; text-decoration: none !important; border-bottom: 1px solid var(--border-strong) !important; transition: all 0.15s; }
.dl-link:hover { background: var(--accent); color: var(--surface) !important; border-color: var(--accent) !important; transform: translateY(-1px); }

.typing { display: inline-flex; gap: 4px; padding: 2px 0; }
.typing span { width: 6px; height: 6px; background: var(--text-mute); border-radius: 50%; animation: bounce 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.terminal-input { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.prompt { font-family: var(--font-mono); color: var(--prompt); font-weight: 600; font-size: 16px; }
#chatInput { flex: 1; border: none; background: transparent; font-family: var(--font-mono); font-size: 14px; color: var(--text); outline: none; padding: 6px 0; }
#chatInput::placeholder { color: var(--text-mute); }
.send-btn { background: var(--text); color: var(--surface); border: none; padding: 7px 16px; border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.send-btn:hover { background: var(--accent); transform: translateY(-1px); }

.suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px 14px; border-top: 1px solid var(--border); background: var(--surface-soft); flex-shrink: 0; }
.chip { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-soft); padding: 4px 11px; border-radius: 999px; font-family: var(--font-mono); font-size: 12px; cursor: pointer; transition: all 0.15s; }
.chip:hover { background: var(--accent); color: var(--surface); border-color: var(--accent); transform: translateY(-1px); }

.projects-section { padding: 40px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(26px, 4vw, 34px); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.section-head p { color: var(--text-soft); font-size: 15px; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 22px; box-shadow: var(--shadow-sm); transition: all 0.2s ease; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.project-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)); opacity: 0; transition: opacity 0.2s; }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.project-card:hover::before { opacity: 1; }
.project-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.project-desc { color: var(--text-soft); font-size: 14px; margin-bottom: 16px; flex: 1; }
.project-links { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; text-decoration: none; transition: all 0.15s; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--text); color: var(--surface); }
.btn-primary:hover { background: var(--accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--accent); color: var(--link); }

.contact-section { padding: 40px 0 60px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.contact-link { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--border); padding: 12px 20px; border-radius: var(--radius-md); text-decoration: none; color: var(--text); font-weight: 500; font-size: 14px; box-shadow: var(--shadow-sm); transition: all 0.18s; }
.contact-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent); color: var(--link); }

/* ===== FOOTER ===== */
.footer { padding: 20px 0 50px; margin-top: 10px; }
.footer-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 32px; }
.footer-top { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 0; }
@media (max-width: 640px) { .footer-top { grid-template-columns: 1fr; gap: 28px; } }
.footer-block h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-mute); margin-bottom: 14px; font-weight: 600; }
.footer-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { display: inline-block; background: var(--bg-alt); border: 1px solid var(--border-strong); color: var(--text-soft); padding: 6px 12px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 12.5px; transition: all 0.2s; }
.fchip:hover { background: var(--accent); color: var(--surface); border-color: var(--accent); transform: translateY(-1px); }
.footer-asks { list-style: none; }
.footer-asks li { font-family: var(--font-mono); font-size: 13px; color: var(--text-mute); padding: 4px 0; transition: color 0.2s; cursor: default; }
.footer-asks li::before { content: '❯ '; color: var(--accent); margin-right: 4px; }
.footer-asks li:hover { color: var(--text); }
.footer-divider { height: 1px; background: var(--border); margin: 28px 0 20px; }
.footer-bottom { display: flex; justify-content: center; align-items: center; text-align: center; }
.footer-copy { font-size: 13px; color: var(--text-mute); }
.theme-toggle { background: none; border: none; color: var(--text-mute); font-family: var(--font-sans); font-size: 13px; cursor: pointer; padding: 0; text-decoration: underline; transition: color 0.2s; }
.theme-toggle:hover { color: var(--accent); }

button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
@media (max-width: 640px) { .hero { padding: 50px 0 30px; } .terminal { min-height: 60vh; max-height: 75vh; } .terminal-header { padding: 10px 14px; } .terminal-title { font-size: 11px; } .terminal-body { padding: 16px; font-size: 13px; } .terminal-input { padding: 10px 14px; } .suggestions { padding: 8px 14px 12px; } .container { padding: 0 18px; } }
.prompt::after { content: ''; display: inline-block; width: 8px; height: 14px; background: var(--prompt); margin-left: 2px; vertical-align: middle; animation: blink 1.1s steps(2) infinite; opacity: 0.6; }
@keyframes blink { 50% { opacity: 0; } }
/* ===== Pulse Dot Animation ===== */
.pulse-dot {
  display: inline-block;
  color: var(--accent);
  animation: pulseGlow 2.5s infinite ease-in-out;
  margin-right: 4px;
  transform-origin: center;
}

@keyframes pulseGlow {
  0%, 100% {
    text-shadow: 0 0 2px var(--accent), 0 0 5px var(--accent);
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    text-shadow: 0 0 4px var(--accent), 0 0 6px var(--accent);
    transform: scale(1.1);
    opacity: 1;
  }
}
