*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #1a1818;
  --bg-alt: #211e1e;
  --bg-card: #2a2626;
  --border: #3a3535;
  --border-light: #4b4646;
  --text: #f1ecec;
  --text-secondary: #b7b1b1;
  --text-muted: #7a7575;
  --accent: #cfcecd;
  --accent-dim: #656363;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.code, .mono { font-family: 'IBM Plex Mono', monospace; }

.container { max-width: 1060px; margin: 0 auto; padding: 0 28px; }

/* ─── Navigation ─── */
nav {
  position: fixed; top: 0; width: 100%;
  background: rgba(26, 24, 24, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

nav .container {
  display: flex; justify-content: space-between; align-items: center;
  height: 60px;
}

nav .logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 16px; color: var(--text); text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: -0.3px;
}

nav .logo svg { width: 28px; height: 28px; }

nav ul { display: flex; gap: 36px; list-style: none; align-items: center; }

nav a {
  color: var(--text-muted); text-decoration: none;
  font-size: 14px; font-weight: 500; transition: color 0.2s;
  letter-spacing: 0.2px;
}
nav a:hover { color: var(--text); }

nav .btn-nav {
  padding: 6px 16px; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-secondary);
  font-size: 13px; font-family: 'IBM Plex Mono', monospace;
}
nav .btn-nav:hover { border-color: var(--text-muted); color: var(--text); }

/* ─── Hero ─── */
.hero {
  padding: 140px 0 80px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute; top: -120px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(207,206,205,0.03) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  align-items: center;
}

.hero-photo-wrapper {
  position: relative;
  width: 280px; height: 280px;
}

.hero-photo-wrapper svg.geo {
  position: absolute;
  top: -12px; left: -12px;
  width: 304px; height: 304px;
  pointer-events: none;
  opacity: 0.3;
}

.hero-photo {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 30%;
  filter: grayscale(1) contrast(1.05) brightness(0.9);
  border: 2px solid var(--border);
  transition: filter 0.4s, border-color 0.3s;
}

.hero-photo:hover {
  filter: grayscale(0.3) contrast(1.05) brightness(1);
  border-color: var(--text-muted);
}

.hero .geo-corners {
  position: absolute;
  bottom: -8px; right: -8px;
  width: 48px; height: 48px;
  border-right: 2px solid var(--accent-dim);
  border-bottom: 2px solid var(--accent-dim);
  pointer-events: none;
}

.hero h1 {
  font-size: 52px;
  font-weight: 600;
  letter-spacing: -1.5px;
  line-height: 1.05;
  margin-bottom: 6px;
}

.hero .title-line {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  color: var(--text-muted);
}

.hero .title-line .tag {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.hero .title-line .dot { color: var(--accent-dim); }

.hero .tagline {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 400;
  max-width: 600px;
  line-height: 1.7;
}

.hero-contact {
  display: flex; flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 28px;
}

.hero-contact a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
  padding: 6px 0;
}
.hero-contact a:hover { color: var(--text); }

.hero-contact svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.6; }

/* ─── Geometric blocks (opencode style) ─── */
.geo-block {
  display: inline-flex;
  gap: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.geo-block span {
  display: block;
  width: 8px; height: 8px;
  background: var(--accent-dim);
}
.geo-block span:nth-child(2) { background: var(--text-muted); }

/* ─── Sections ─── */
section { padding: 80px 0; border-bottom: 1px solid var(--border); }

.section-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 48px;
}

.section-header .num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--accent-dim);
  font-weight: 500;
}

.section-header h2 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-header .line {
  flex: 1; height: 1px;
  background: var(--border);
}

/* ─── About ─── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.about-text {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.8;
}

.about-text strong { color: var(--text); font-weight: 500; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  align-content: start;
}

.about-stat {
  background: var(--bg-alt);
  padding: 24px 20px;
  text-align: center;
}

.about-stat .num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 28px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}

.about-stat .label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ─── Timeline ─── */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 56px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -40px; top: 8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  transition: border-color 0.3s;
}

.timeline-item:hover .timeline-dot { border-color: var(--accent); }

.timeline-dot-inner {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-dim);
  transition: background 0.3s;
}

.timeline-item:hover .timeline-dot-inner { background: var(--accent); }

.timeline-date {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(207,206,205,0.06);
  padding: 2px 12px;
  border-radius: 4px;
  margin-bottom: 10px;
  border: 1px solid rgba(207,206,205,0.08);
  letter-spacing: 0.3px;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 2px;
}

.timeline-logo {
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  transition: border-color 0.2s;
}

.timeline-item:hover .timeline-logo { border-color: var(--border-light); }

.timeline-logo svg,
.timeline-logo img { width: 100%; height: 100%; object-fit: contain; }

.timeline-company { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }

.timeline-company a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.timeline-company a:hover { color: var(--accent); }

.timeline-company a::after {
  content: ' ↗';
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s;
}

.timeline-company a:hover::after { opacity: 1; }

.timeline-role {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 14px;
  letter-spacing: 0.2px;
}

.timeline-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.timeline-desc ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
}

.timeline-desc li {
  position: relative;
  padding-left: 18px;
}

.timeline-desc li::before {
  content: '>';
  position: absolute left: 0;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent-dim);
  font-size: 12px;
}

@media (max-width: 700px) {
  .timeline-desc ul { grid-template-columns: 1fr; }
}

/* ─── Skills ─── */
.skills-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.skills-category { margin-bottom: 36px; }

.skills-category:last-child { margin-bottom: 0; }

.skills-category h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 450;
  color: var(--text-secondary);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
  cursor: default;
}

.skill-tag svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

.skill-tag:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: var(--bg-card);
}

/* ─── Education ─── */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.edu-list { display: flex; flex-direction: column; gap: 28px; }

.edu-item {
  padding: 20px 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.edu-item:hover { border-color: var(--border-light); }

.edu-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}

.edu-institution {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.edu-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

.courses-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
}

.course-chip {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 450;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all 0.2s;
}

.course-chip:hover {
  color: var(--text-secondary);
  border-color: var(--border-light);
}

/* ─── CTA ─── */
.cta {
  text-align: center;
  padding: 100px 0;
  border-bottom: 1px solid var(--border);
}

.cta .code-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.cta .code-badge .blink {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #5a5;
  animation: blink 1.2s infinite;
}

@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.2; } }

.cta h2 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.cta p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto 36px;
}

.cta-group {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'IBM Plex Sans', sans-serif;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.btn svg { width: 16px; height: 16px; }

.btn:hover {
  border-color: var(--text-muted);
  background: var(--bg-card);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary:hover {
  background: var(--accent-hover, #fff);
  border-color: var(--accent-hover, #fff);
}

/* ─── Footer ─── */
footer {
  padding: 36px 0;
  color: var(--text-muted);
  font-size: 13px;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer .mono { font-family: 'IBM Plex Mono', monospace; }

/* ─── Projects ─── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-top: 24px;
}

.project-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.project-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  background: var(--bg-card);
}

.project-card:hover::before {
  opacity: 1;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.project-type {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--accent-dim);
  font-weight: 500;
}

.project-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
  color: var(--text);
}

.project-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.project-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(207,206,205,0.04);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
}

.project-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 4px;
}

/* ─── Immersive Demo Viewer Modal ─── */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(26, 24, 24, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 92%;
  height: 88%;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(10px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-container {
  transform: scale(1) translateY(0);
}

/* Browser Chrome (Top bar) */
.modal-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.modal-window-controls {
  display: flex;
  gap: 6px;
  width: 120px;
}

.modal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-light);
}
.modal-dot.close { background: #df5b56; }
.modal-dot.minimize { background: #e5bf41; }
.modal-dot.maximize { background: #57c04c; }

.modal-title-bar {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 4px 24px;
  border-radius: 6px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.modal-title-bar svg {
  width: 12px;
  height: 12px;
  color: var(--accent-dim);
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 120px;
  justify-content: flex-end;
}

.modal-action-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, opacity 0.2s;
  padding: 4px;
}

.modal-action-btn:hover {
  color: var(--text);
}

.modal-action-btn svg {
  width: 16px;
  height: 16px;
}

.modal-close-btn {
  color: var(--text-muted);
}
.modal-close-btn:hover {
  color: #df5b56;
}

/* Info Banner */
.modal-info-banner {
  background: rgba(207, 206, 205, 0.03);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-info-banner svg {
  width: 14px;
  height: 14px;
  color: var(--accent-dim);
  flex-shrink: 0;
}

/* Iframe viewport & spinner */
.modal-body {
  flex-grow: 1;
  position: relative;
  background: var(--bg);
}

.modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-iframe.loaded {
  opacity: 1;
}

.modal-loader {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: opacity 0.2s;
}

.modal-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: modal-spin 0.8s linear infinite;
}

.modal-loader span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

@keyframes modal-spin {
  to { transform: rotate(360deg); }
}

/* Prevent scrolling when modal is active */
body.modal-open {
  overflow: hidden;
}

@media (max-width: 860px) {
  .projects-grid { grid-template-columns: 1fr; gap: 20px; }
  .modal-container { width: 96%; height: 94%; }
  .modal-title-bar { max-width: 180px; padding: 4px 10px; }
  .modal-window-controls { width: auto; }
  .modal-dot.minimize, .modal-dot.maximize { display: none; }
  .modal-actions { width: auto; }
}

/* ─── Animations ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.anim { animation: fadeUp 0.6s ease-out forwards; opacity: 0; }
.anim-d1 { animation-delay: 0.1s; }
.anim-d2 { animation-delay: 0.2s; }
.anim-d3 { animation-delay: 0.3s; }
.anim-d4 { animation-delay: 0.4s; }
.anim-d5 { animation-delay: 0.5s; }
.anim-d6 { animation-delay: 0.6s; }

/* ─── Responsive ─── */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 32px; }
  .hero-photo-wrapper { margin: 0 auto; width: 200px; height: 200px; }
  .hero-photo-wrapper svg.geo { width: 224px; height: 224px; top: -12px; left: -12px; }
  .hero h1 { font-size: 36px; }
  .hero .title-line { justify-content: center; }
  .hero .tagline { margin: 0 auto; }
  .hero-contact { justify-content: center; }

  .about-grid,
  .skills-section,
  .edu-grid { grid-template-columns: 1fr; }

  nav ul { display: none; }
  .section-header h2 { font-size: 12px; }
  .timeline-company { font-size: 18px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 28px; }
  .hero-photo-wrapper { width: 160px; height: 160px; }
  .container { padding: 0 16px; }
  .about-stats { grid-template-columns: 1fr; }
}
