:root {
  --bg: #000000;
  --panel: rgba(24, 24, 27, 0.55);
  --border: #27272a;
  --text: #e4e4e7;
  --text-dim: #a1a1aa;
  --accent: #dc143c;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  line-height: 1.65;
}

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

a:hover {
  text-decoration: underline;
}

code {
  color: var(--accent);
  background: var(--panel);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px 40px;
}

/* Cursor spotlight */
.spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle, rgba(220, 20, 60, 0.12) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.spotlight.active {
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  .spotlight {
    display: none;
  }
}

/* Left section rail */
.rail {
  position: fixed;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}

.rail a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text-dim);
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

@media (max-width: 900px) {
  .rail {
    display: none;
  }
}

/* Terminal hero */
.terminal {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(6px);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fade-up 0.5s ease both;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

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

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-path {
  margin-left: 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.terminal-body {
  padding: 28px 24px 32px;
}

.cmd {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 22px;
}

.cmd:first-child {
  margin-top: 0;
}

.cmd::before {
  content: "";
}

.typewriter {
  font-size: clamp(1.8rem, 5vw, 2.75rem);
  font-weight: 700;
  color: #fff;
  margin: 6px 0 4px;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid var(--accent);
  width: 21ch;
  animation: type 1.1s steps(21) 0.3s both, blink 0.8s step-end infinite;
}

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

.kv {
  margin-top: 4px;
}

.kv .sep {
  color: var(--text-dim);
  margin: 0 8px;
}

/* Interactive terminal prompt */
.term-output {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.term-entry {
  margin-top: 10px;
}

.term-typed {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.term-typed::before {
  content: attr(data-prompt);
}

.term-response {
  color: var(--text);
  font-size: 0.9rem;
  white-space: pre-wrap;
  margin-top: 4px;
}

.term-response a {
  color: var(--accent);
}

.term-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.term-prompt {
  color: var(--text-dim);
  font-size: 0.9rem;
  white-space: nowrap;
  cursor: text;
}

.term-prompt #term-path {
  color: var(--accent);
}

.term-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  caret-color: var(--accent);
}

/* Directory sections */
section {
  scroll-margin-top: 24px;
  margin-top: 28px;
}

.dir {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(6px);
  border-radius: var(--radius);
}

.dir summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}

.dir summary::-webkit-details-marker {
  display: none;
}

.dir-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.dir-name::before {
  content: "";
}

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

.dir[open] .dir-toggle::before {
  content: "▾ ";
}

.dir:not([open]) .dir-toggle::before {
  content: "▸ ";
}

.dir-body {
  padding: 0 24px 28px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.lede {
  color: var(--text-dim);
  max-width: 60ch;
  margin-bottom: 20px;
}

/* Grid cards (skills, contact) */
.grid {
  display: grid;
  gap: 16px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

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

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--accent);
}

.card h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Skills */
.skill-category {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.skill-category + .skill-category {
  margin-top: 16px;
}

.skill-category h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 14px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.skill-grid span {
  display: block;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 8px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.skill-grid span:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* Experience */
.experiences {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.experience {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.2s ease;
}

.experience:hover {
  border-color: var(--accent);
}

.exp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.exp-head h3 {
  color: #fff;
  font-size: 1.1rem;
}

.exp-role {
  color: var(--accent);
  font-size: 0.85rem;
  white-space: nowrap;
}

.exp-team {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 4px 0 14px;
}

.exp-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exp-points li {
  position: relative;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.exp-points li::before {
  content: "\203a";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Projects */
.projects {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.project-text {
  padding: 22px;
}

.project-text h3 {
  color: #fff;
  font-size: 1.15rem;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.gh {
  font-size: 0.75rem;
  font-weight: 400;
}

.tech {
  color: var(--accent);
  font-size: 0.8rem;
  margin: 6px 0 10px;
}

.project-text p:not(.tech) {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.project-img {
  min-height: 180px;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.2);
}

/* Bio (education) */
.bio {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}

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

.bio-img img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: cover;
}

.bio-text h3 {
  color: #fff;
  margin-bottom: 8px;
}

.bio-text .degree {
  color: var(--text-dim);
  margin-bottom: 16px;
}

.honours {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.honours li {
  position: relative;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.honours li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.honours li.highlight {
  color: var(--accent);
  font-weight: 700;
}

/* Footer */
footer {
  text-align: center;
  padding: 50px 24px 60px;
  color: var(--text-dim);
}

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

footer .motto {
  margin: 4px 0 14px;
  font-size: 0.85rem;
}

footer .sep {
  margin: 0 8px;
  color: var(--text-dim);
}

/* Animations */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes type {
  from { width: 0; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .typewriter {
    animation: none;
    width: auto;
    border-right: none;
  }
  .terminal {
    animation: none;
  }
}
