:root {
  --bg: #0b0f14;
  --panel: #11161d;
  --panel-header: #161d26;
  --border: #232b36;
  --text: #cbd5e1;
  --text-dim: #6b7785;
  --accent: #34d399;
  --accent-dim: #1f7a5c;
  --amber: #fbbf24;
  --red: #ef4444;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 8px;
  --max-width: 900px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.65;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; color: #f1f5f9; }

/* NAV */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topnav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  color: #f1f5f9;
  font-weight: 700;
}

.cursor-static {
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}

.commands {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.commands a {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.commands a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* LAYOUT */
main { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }

.hero { padding: 2.5rem 0 1rem; }

.section { padding: 2rem 0; }

/* TERMINAL WINDOW */
.term-window {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.term-window.pre-reveal {
  opacity: 0;
  transform: translateY(12px);
}

.term-window.pre-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.term-header {
  background: var(--panel-header);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #fbbf24; }
.dot.green { background: #34d399; }

.term-title {
  margin-left: 0.6rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.term-body {
  padding: 1.5rem;
}

.hero-body {
  min-height: 220px;
}

/* PROMPT LINES */
.prompt-line {
  color: var(--text-dim);
  margin: 0 0 1rem 0;
}

.prompt {
  color: var(--accent);
  margin-right: 0.4rem;
}

.comment {
  color: var(--text-dim);
  font-style: italic;
}

/* TYPED HERO */
.typed-lines .line {
  min-height: 1.6em;
  white-space: pre-wrap;
}

.typed-lines .name {
  color: #f1f5f9;
  font-weight: 700;
  font-size: 1.4rem;
}

.typed-lines .role {
  color: var(--accent);
}

.typed-lines .dim {
  color: var(--text-dim);
}

.cursor {
  display: inline-block;
  width: 0.55em;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.about-text p { margin: 0 0 1.15rem 0; line-height: 1.8; }
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: #f1f5f9; }

@media (max-width: 560px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { width: 140px; }
}

/* GALLERY */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.gallery-item {
  margin: 0;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.gallery-item figcaption {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
}

@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* SKILLS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem 2rem;
}

.skill-cat h3 {
  color: var(--amber);
  font-size: 0.85rem;
  margin-bottom: 0.65rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: #0d1319;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.3;
}

/* PROJECTS */
.project-title { font-size: 1.2rem; margin-bottom: 0.4rem; }

.project-tagline {
  color: var(--text-dim);
  margin: 0 0 1rem 0;
}

.status-badge {
  color: var(--accent);
  font-size: 0.8rem;
}

.project-links {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.term-btn {
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.term-btn:hover {
  background: var(--accent-dim);
  text-decoration: none;
}

.term-btn.small {
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  margin-left: 0.6rem;
}

.feature-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem 2rem;
}

.feature-group h4 {
  color: var(--amber);
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0 0 0.65rem;
}

.feature-group ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
}

.feature-group li {
  margin-bottom: 0.55rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.feature-group li strong {
  color: var(--text);
  font-weight: 500;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.impact-card {
  background: #0d1319;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.impact-card h4 {
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.impact-card p {
  margin: 0.15rem 0;
  font-size: 0.85rem;
}

.impact-card .k {
  color: var(--amber);
  margin-right: 0.4rem;
}

/* PUBLICATIONS */
.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.log-list li {
  margin-bottom: 1.25rem;
  padding-left: 0;
}

.log-tag {
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.4rem;
}

/* CONTACT */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.contact-links a {
  color: var(--text);
  font-size: 0.95rem;
}

.contact-links a:hover { color: var(--accent); }

.arrow { color: var(--text-dim); margin: 0 0.4rem; }

/* LIGHTBOX */
.lightbox-img {
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}

.lightbox-img:hover {
  opacity: 0.85;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 7, 10, 0.92);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.open {
  display: flex;
}

.lightbox-full {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 2.2rem;
  height: 2.2rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  cursor: pointer;
}

.lightbox-close:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

/* FOOTER */
.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 2rem 1.25rem 3rem;
}
