﻿/* ===== BOOT SCREEN ===== */
#boot-screen {
  position: fixed; inset: 0; z-index: 99999;
  background: #0a0a0a;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 2rem;
  font-family: 'Fira Code', monospace;
  transition: opacity 0.5s ease;
}
#boot-screen.boot-done { opacity: 0; pointer-events: none; }
#boot-log {
  flex: 1; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  font-size: clamp(0.65rem, 1.2vw, 0.8rem);
  line-height: 1.7;
  color: #aaa;
  mask-image: linear-gradient(to bottom, transparent 0%, black 30%);
}
#boot-log div { white-space: pre; }
#boot-log div.ok { color: #4ade80; }
#boot-log div.ok::after { content: ' ✓'; }
#boot-bar-wrap {
  display: flex; align-items: center; gap: 0.75rem;
  margin-top: 1.2rem;
  font-size: 0.75rem; color: #555;
}
#boot-bar {
  flex: 1; height: 3px; background: #1a1a1a; border-radius: 2px; overflow: hidden;
}
#boot-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #f97316, #fb923c);
  box-shadow: 0 0 8px #f97316;
  transition: width 0.1s linear;
  border-radius: 2px;
}
#boot-bar-pct { color: #f97316; min-width: 3ch; }


/* ===== LIGHT THEME ===== */
body.light {
  --bg:        #f5f0eb;
  --bg2:       #ede8e2;
  --surface:   rgba(180,100,20,0.06);
  --surface2:  rgba(180,100,20,0.12);
  --border:    rgba(180,100,20,0.22);
  --border-h:  rgba(180,100,20,0.5);
  --purple:    #c2410c;
  --purple-l:  #ea580c;
  --cyan:      #92400e;
  --green-ok:  #15803d;
  --text:      #1c1410;
  --text-dim:  #78716c;
  --text-mid:  #44403c;
  --glow:      rgba(194,65,12,0.2);
}

/* Titles and headings */
body.light .section-title,
body.light .hero-name,
body.light .timeline-role,
body.light .project-title,
body.light .edu-school,
body.light .testi-name { color: #1c1410; }

body.light .gradient-text { color: #c2410c; }
body.light .section-title::after { background: #ea580c; }

/* Hero */
body.light .hero-bio { color: #44403c; }
body.light .stat-num { background: linear-gradient(135deg,#c2410c,#ea580c); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }

/* Cards */
body.light .skill-card,
body.light .project-card,
body.light .edu-card,
body.light .testi-card,
body.light .timeline-card { background: rgba(255,255,255,0.7); border-color: rgba(180,100,20,0.18); }

body.light .skill-card:hover,
body.light .project-card:hover,
body.light .edu-card:hover,
body.light .testi-card:hover,
body.light .timeline-card:hover { border-color: rgba(180,100,20,0.45); box-shadow: 0 0 24px rgba(194,65,12,0.15); }

/* Code windows */
body.light .code-window { background: #1e1a16; }
body.light .code-window::before { border-color: rgba(180,100,20,0.45); box-shadow: 0 0 8px rgba(180,100,20,0.25), inset 0 0 4px rgba(180,100,20,0.05); }
body.light .code-window::after  { border-color: rgba(180,100,20,0.12); }
body.light .window-bar { background: #2a2420; border-bottom-color: #3a302a; }
body.light .window-title { color: rgba(255,255,255,0.45); }
body.light .dot { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.4); }

/* Contact terminal */
body.light .contact-terminal { background: #1e1a16; }
body.light .contact-terminal::before { border-color: rgba(180,100,20,0.45); box-shadow: 0 0 8px rgba(180,100,20,0.25); }
body.light .contact-terminal::after  { border-color: rgba(180,100,20,0.12); }
body.light .contact-json { color: #ccc; }
body.light .j-str { color: #86efac; }
body.light .j-key { color: #fb923c; }

/* Flip display */
body.light .flip-char  { color: rgba(180,100,20,0.75); }
body.light .flip-cursor { color: rgba(180,100,20,0.65); }

/* Particle canvas — dimmed */
body.light #particle-canvas { opacity: 0.25; filter: hue-rotate(10deg) saturate(0.6); }

/* Tags */
body.light .tag { color: #57534e; border-color: rgba(180,100,20,0.2); background: rgba(180,100,20,0.05); }
body.light .tag.hot { color: #c2410c; border-color: rgba(194,65,12,0.35); background: rgba(194,65,12,0.08); }

/* Footer */
body.light .footer { border-top-color: rgba(180,100,20,0.2); }
body.light .footer-top { border-bottom-color: rgba(180,100,20,0.2); }
body.light .footer-logo { color: #1c1410; }
body.light .stats-bar { border-color: rgba(180,100,20,0.2); }

/* Buttons */
body.light .btn-ghost { color: #44403c; border-color: rgba(180,100,20,0.25); }
body.light .btn-ghost:hover { color: #c2410c; border-color: rgba(194,65,12,0.5); }

/* Logo & nav */
body.light .logo-fixed,
body.light .lang-toggle,
body.light #theme-toggle { color: #1c1410; border-color: rgba(180,100,20,0.25); }
body.light .logo-fixed:hover,
body.light .lang-toggle:hover,
body.light #theme-toggle:hover { color: #c2410c; border-color: #c2410c; }
body.light .logo-dot { color: #15803d; }
body.light .flip-display { border-color: rgba(180,100,20,0.25); }
body.light .logo-fixed { border-color: rgba(180,100,20,0.25); color: #1c1410; }
body.light .logo-fixed:hover { color: #c2410c; border-color: #c2410c; max-width: 24rem; }
body.light .logo-timestamp { color: rgba(180,100,20,0.75); }

/* Timeline dot */
body.light .timeline-dot { background: linear-gradient(135deg,#c2410c,#ea580c); }
body.light .timeline-line { background: linear-gradient(to bottom, rgba(194,65,12,0.4), transparent); }

/* Back to top */
body.light .back-to-top::before { border-top-color: #c2410c; border-right-color: rgba(194,65,12,0.3); }
body.light .back-to-top::after  { color: #c2410c; border-color: rgba(194,65,12,0.3); background: rgba(194,65,12,0.06); }

/* ===== RESET & VARIABLES ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0e0d0c;
  --bg2:       #141210;
  --surface:   rgba(251,146,60,0.05);
  --surface2:  rgba(251,146,60,0.1);
  --border:    rgba(251,146,60,0.18);
  --border-h:  rgba(251,146,60,0.45);
  --purple:    #f97316;
  --purple-l:  #fb923c;
  --cyan:      #fdba74;
  --green-ok:  #4ade80;
  --text:      #f1f0ee;
  --text-dim:  #6b6560;
  --text-mid:  #a89a8a;
  --font-mono: 'Fira Code', monospace;
  --font-ui:   'Inter', sans-serif;
  --radius:    8px;
  --radius-sm: 4px;
  --glow:      rgba(251,146,60,0.22);
  --glow-c:    rgba(253,186,116,0.18);
  --tr:        0.3s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===== GLOBAL UI ===== */
#cursor { display: none; }

.logo-fixed {
  position: fixed; top: 1.2rem; left: 1.4rem; z-index: 1000;
  font-family: var(--font-mono); font-size: 0.95rem; font-weight: 600;
  color: var(--text); text-decoration: none;
  border: 1.5px solid var(--border); padding: 0.3rem 0.75rem;
  letter-spacing: 0.04em; display: flex; align-items: center; gap: 0;
  overflow: hidden; white-space: nowrap; width: auto; min-width: 5.2rem; max-width: 5.2rem;
  transition: border-color 0.3s, color 0.3s, max-width 0.4s ease;
}
.logo-fixed:hover { color: #f97316; border-color: #f97316; max-width: 24rem; }
.logo-timestamp { font-size: 0.72rem; font-weight: 400; color: rgba(251,146,60,0.7); opacity: 0; transition: opacity 0.15s 0.25s; pointer-events: none; margin-left: 0.5rem; }
.logo-fixed:hover .logo-timestamp { opacity: 1; }

.logo-dot { color: #4ade80; }

.lang-toggle {
  position: fixed;
  top: 1.2rem;
  right: 1.4rem;
  z-index: 1000;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1.5px solid var(--border);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: border-color 0.2s, color 0.2s;
}
.lang-toggle:hover { color: #f97316; border-color: #f97316; }

/* ===== LAYOUT ===== */
.section {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 5rem 0 4rem;
}
.section-sm { min-height: auto; padding: 5rem 0; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-header { margin-bottom: 3rem; }

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.6rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  color: #f8f8f8;
  letter-spacing: -0.5px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0;
  width: 2.5rem; height: 2px;
  background: var(--purple-l);
  border-radius: 2px;
}

.gradient-text { color: #f8f8f8; background: none; -webkit-text-fill-color: unset; background-clip: text; }
.accent { color: var(--cyan); }
.status-on { color: var(--green-ok); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: var(--tr);
  border: 1px solid transparent;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.btn-primary { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; border-color: #f97316; }
.btn-primary:hover { background: linear-gradient(135deg, #fb923c, #f97316); box-shadow: 0 0 20px var(--glow); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-mid); border-color: var(--border); }
.btn-ghost:hover { color: var(--purple-l); border-color: var(--border-h); box-shadow: 0 0 14px var(--glow); }
.full-width { width: 100%; justify-content: center; }

/* ===== TERMINAL ===== */
.terminal-body { padding: 1.2rem 1.4rem; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.9; }
.t-prompt { color: var(--green-ok); margin-right: 6px; }
.t-cmd    { color: var(--cyan); }
.t-out    { color: var(--text-mid); padding-left: 1rem; }
.t-key    { color: var(--purple-l); display: inline-block; min-width: 90px; }
.t-val    { color: var(--text); }

/* ===== CODE WINDOW ===== */
.code-window {
  width: 100%;
  background: rgba(10,8,6,0.6);
  overflow: hidden;
  position: relative;
  border: none;
  box-shadow: none;
}
.code-window::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(251,146,60,0.5);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(251,146,60,0.4), 0 0 18px rgba(251,146,60,0.15), inset 0 0 6px rgba(251,146,60,0.05);
  z-index: 10;
}
.code-window::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(251,146,60,0.15);
  transform: translate(5px, 5px);
  pointer-events: none;
  z-index: 9;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 1rem;
  background: #2d2d2d;
  border-bottom: 1px solid #1a1a1a;
}
.dot { width: 20px; height: 20px; border-radius: 3px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.5); cursor: pointer; user-select: none; transition: background 0.15s; }
.dot:hover { background: rgba(255,255,255,0.15); }
.dot.red::after    { content: '✕'; }
.dot.yellow::after { content: '−'; }
.dot.green::after  { content: '□'; }
.window-title { font-family: var(--font-mono); font-size: 0.72rem; color: rgba(255,255,255,0.6); margin-left: auto; }

.code-body { padding: 1.5rem; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.hero-code { font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.9; color: var(--text-mid); width: 100%; }
.c-kw  { color: var(--purple-l); }
.c-cls { color: var(--cyan); }
.c-str { color: #86efac; }
.c-acc { color: var(--green-ok); }
.c-comment { color: #5a5248; font-style: italic; }

/* Tags */
.tag { font-family: var(--font-mono); font-size: 0.72rem; padding: 0.22rem 0.55rem; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-dim); background: rgba(99,102,241,0.04); transition: var(--tr); }
.tag.hot { border-color: rgba(99,102,241,0.35); color: var(--purple-l); background: rgba(99,102,241,0.1); }

/* Company/school links */
.company-link { color: rgba(236,72,153,0.5); text-decoration: none; font-size: 0.7rem; margin-left: 0.3rem; transition: color 0.2s; }
.company-link:hover { color: #ec4899; }

/* ===== REVEAL ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== KEYFRAMES ===== */
@keyframes blink       { 0%,100%{opacity:1} 50%{opacity:0} }
@keyframes spin        { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
@keyframes fadeInDown  { from{opacity:0;transform:translateY(-18px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeInUp    { from{opacity:0;transform:translateY(18px)}  to{opacity:1;transform:translateY(0)} }
@keyframes fadeIn      { from{opacity:0} to{opacity:1} }
@keyframes scrollPulse { 0%,100%{opacity:0.3} 50%{opacity:1} }
@keyframes orbit-spin  { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .hero-section { grid-template-columns: 1fr; padding: 6rem 2rem 4rem; text-align: center; }
  .hero-bio    { margin: 0 auto 2rem; }
  .hero-actions, .hero-socials { justify-content: center; }
  .about-grid, .contact-grid  { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
  .timeline-item { grid-template-columns: 20px 1fr; gap: 0.8rem; }
  .skills-grid, .projects-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .skills-grid, .projects-grid, .edu-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 0.5rem; }
  .stat { padding: 0.6rem 0.5rem; }
  .timeline-meta { flex-direction: column; align-items: flex-start; }
  .section { padding: 3rem 0 2rem; }
  .container { padding: 0 1.2rem; }
  .hero-section { padding: 3rem 1.2rem 2rem; }
}

/* ===== MOBILE (≤ 640px) ===== */
@media (max-width: 640px) {

  /* --- Boot screen --- */
  #boot-log { font-size: 0.6rem; }
  #boot-bar-wrap { font-size: 0.68rem; }

  /* --- Fixed UI --- */
  #kb-hint { display: none; }
  #lang-toggle { top: 0.8rem; right: 0.8rem; font-size: 0.72rem; padding: 0.35rem 0.7rem; }
  #theme-toggle { top: 0.8rem; right: 4rem; font-size: 0.72rem; padding: 0.35rem 0.7rem; }
  .logo-fixed { font-size: 1rem; top: 0.9rem; left: 0.9rem; }

  /* --- Hero --- */
  #hero-connector { display: none; }
  .hero-section { min-height: auto; padding: 5rem 1.2rem 2rem; gap: 1.5rem; }
  #hex-canvas { display: block; width: 80vw !important; max-width: 320px; height: auto; aspect-ratio: 1; margin: 0 auto; }
  .hero-name { font-size: clamp(1.4rem, 6vw, 2rem); }
  .hero-role { font-size: 0.88rem; }
  .hero-bio { font-size: 0.88rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-stats { flex-wrap: wrap; }
  .stat { min-width: calc(50% - 0.5rem); }

  /* --- About CMD window --- */
  .java-run-wrapper { grid-template-columns: 1fr; }
  .cmd-body { font-size: 0.65rem; max-height: 200px; overflow-y: auto; }

  /* --- Experience timeline --- */
  .timeline-item { grid-template-columns: 16px 1fr; gap: 0.6rem; }
  .timeline-card { padding: 1rem; }
  .timeline-role { font-size: 0.92rem; }
  .timeline-bullets li { font-size: 0.82rem; }
  .timeline-period { font-size: 0.65rem; }
  .timeline-tags { gap: 0.3rem; }

  /* --- Projects --- */
  .projects-grid { grid-template-columns: 1fr; }
  .project-card { width: 100%; }

  /* --- Contact --- */
  .contact-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .contact-json { font-size: 0.7rem; }
  .contact-link { font-size: 0.72rem; word-break: break-all; }
  .form-group input,
  .form-group textarea { font-size: 16px; } /* prevent iOS zoom on focus */

  /* --- Section headers --- */
  .section-header { margin-bottom: 1.8rem; }
  .section-title { font-size: clamp(1.5rem, 6vw, 2rem); }
}

/* ===== NAV DOTS ===== */
#nav-dots {
  position: fixed; left: 1.2rem; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 0.6rem; z-index: 1000;
}
.nav-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border-h); border: 1px solid var(--border-h);
  transition: var(--tr); position: relative;
}
.nav-dot::after {
  content: attr(title);
  position: absolute; left: 1.4rem; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-dim);
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.nav-dot:hover::after { opacity: 1; }
.nav-dot.active { background: var(--purple-l); box-shadow: 0 0 8px var(--glow); transform: scale(1.4); }
@media (max-width: 768px) { #nav-dots { display: none; } }

/* ===== AVAILABLE BADGE ===== */
.available-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--green-ok); border: 1px solid rgba(74,222,128,0.3);
  background: rgba(74,222,128,0.07); padding: 0.25rem 0.7rem;
  border-radius: 999px; margin-bottom: 0.75rem;
  animation: fadeInDown 0.5s ease both;
}
.avail-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green-ok);
  box-shadow: 0 0 6px var(--green-ok);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.6; }
}

/* ===== SKILL BARS ===== */
.skill-bars { margin-top: 0.9rem; display: flex; flex-direction: column; gap: 0.45rem; }
.skill-bar-row { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-dim); }
.skill-bar-row span:first-child { width: 90px; flex-shrink: 0; }
.skill-bar-row span:last-child  { width: 30px; text-align: right; color: var(--purple-l); }
.skill-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.skill-bar-fill { height: 100%; width: 0; border-radius: 2px; background: linear-gradient(90deg, #f97316, #fb923c); transition: width 1s cubic-bezier(.4,0,.2,1); }

/* ===== COPY EMAIL BUTTON ===== */
.copy-email-btn {
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: inherit; font-size: inherit; padding: 0; width: 100%;
}
.copy-email-btn:hover { color: var(--purple-l); }

/* ===== KEYBOARD SHORTCUT HINT ===== */
#kb-hint {
  position: fixed; bottom: 1.2rem; left: 1.2rem; z-index: 1000;
  font-size: 0.85rem; color: var(--text-mid); cursor: default;
  opacity: 0.8; transition: opacity 0.2s;
}
#kb-hint:hover { opacity: 1; color: var(--purple-l); }
#kb-hint .kb-tooltip {
  display: none; position: absolute; bottom: 1.6rem; left: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.5rem 0.75rem;
  font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-mid);
  white-space: nowrap; line-height: 1.8;
}
#kb-hint:hover .kb-tooltip { display: block; }

/* ===== PRINT STYLESHEET ===== */
@media print {
  #boot-screen, #nav-dots, #kb-hint, #cursor, .logo-fixed,
  #lang-toggle, #theme-toggle, #particle-canvas, .hero-actions,
  .hero-socials, .scroll-hint, .btn, .contact-form,
  .projects-carousel, .sphere-wrapper, #hero-connector { display: none !important; }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  .section { page-break-inside: avoid; padding: 1rem 0; }
  .timeline-card, .skill-card, .edu-card { border: 1px solid #ccc !important; box-shadow: none !important; background: #fff !important; }
  a { color: #000 !important; text-decoration: none; }
  .gradient-text { color: #f97316 !important; -webkit-text-fill-color: #f97316 !important; }
}
