/* --- GLOBAL THEME & RESET --- */
:root {
  --bg: #ffffff;
  --text-main: #1a1a1a;
  --text-muted: #888888;
  --accent: #000000;
  --border: #f0f0f0;
  --mono: "JetBrains Mono", monospace;
  --sidebar-width: 350px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
}

/* --- SCROLLABLE FIXED SIDEBAR --- */
aside.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 4rem 2.5rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: #fff;
  z-index: 10;

  overflow-y: auto;
  scrollbar-width: none;
}

aside.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-top h2 {
  font-family: var(--mono);
  font-size: 0.8rem;
  margin-bottom: 2rem;
}

.sidebar-top em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}

.sidebar-top h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0.5rem 0 1rem;
  line-height: 1.1;
}

.sidebar-top p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- SUBTLE ACTION BUTTONS --- */
.action-btns {
  margin: 1.5rem 0 2.5rem;
  display: flex;
  gap: 24px;
  align-items: center;
}

.action-btns a {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.05em;
  position: relative;
  transition: color 0.2s ease;
  padding: 4px 0;
}

.btn-primary {
  color: var(--text-main);
}

.btn-primary::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--accent);
  transform: scaleX(1);
  transform-origin: bottom right;
  transition: transform 0.3s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.btn-primary:hover::after {
  transform: scaleX(0);
  transform-origin: bottom left;
}

.btn-secondary {
  color: var(--text-muted);
}

.btn-secondary:hover {
  color: var(--text-main);
}

.btn-secondary::after {
  content: " ↗";
  font-size: 0.6rem;
  opacity: 0;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  display: inline-block;
  transform: translate(-3px, 3px);
}

.btn-secondary:hover::after {
  opacity: 1;
  transform: translate(0, 0);
}

.sidebar-top p {
  margin-bottom: 0.5rem;
}

/* --- SKILLS DIRECTORY --- */
.skills-directory {
  margin-top: 1rem;
  font-family: var(--mono);
}

.skill-folder {
  margin-bottom: 2px;
}

summary {
  list-style: none;
  padding: 10px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 4px;
  transition: background 0.2s;
}

summary:hover {
  background: #f4f4f4;
}
summary::-webkit-details-marker {
  display: none;
}

.status-icon::before {
  content: "[+]";
  font-size: 0.7rem;
  color: var(--text-muted);
}

details[open] .status-icon::before {
  content: "[-]";
  color: var(--accent);
}

.skill-folder:first-child .status-icon::before {
  animation: hint-pulse 2s infinite;
}

@keyframes hint-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}

.folder-grid {
  border-left: 1px solid var(--border);
  margin-left: 14px;
  padding: 8px 0 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.folder-grid span {
  font-size: 0.65rem;
  color: var(--text-muted);
  position: relative;
}

.folder-grid span::before {
  content: "•";
  position: absolute;
  left: -12px;
  color: #ddd;
}

/* --- SIDEBAR NAV --- */
nav {
  margin-top: auto;
  padding-top: 2rem;
}
nav ul {
  list-style: none;
}
nav a {
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- MAIN WORK GRID --- */
main#work {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 5rem 3rem;
}

section {
  display: flex;
  flex-direction: column;
}

/* --- GIF CONTAINER: no forced aspect ratio cropping --- */
.video-container {
  width: 100%;
  background: #fcfcfc;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-gif {
  width: 100%;
  height: auto;           /* Let height follow the GIF's natural ratio */
  display: block;

  /* Crisp rendering — no browser smoothing/downsampling */
  image-rendering: -webkit-optimize-contrast; /* Safari */
  image-rendering: crisp-edges;               /* Firefox */
  -ms-interpolation-mode: nearest-neighbor;   /* IE fallback */
}

/* Profile image */
.me {
  width: 80px;
  height: 80px;
  border-radius: 100%;
  object-fit: cover;
  border: 1px solid var(--border);
}

section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
section p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin-bottom: 1.5rem;
}

.tech-list li {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 2px;
}

.btns a {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
  text-transform: uppercase;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  width: fit-content;
}

/* --- RESPONSIVE --- */
@media (max-width: 1000px) {
  body {
    flex-direction: column;
  }
  aside.sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 3rem 2rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-y: visible;
  }
  main#work {
    margin-left: 0;
    padding: 3rem 2rem;
    grid-template-columns: 1fr;
  }
}