/* ─── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Design tokens ─────────────────────────────────────────────── */
:root {
  --bg:        #0d0d0f;
  --surface:   #141416;
  --surface2:  #1c1c20;
  --border:    #2a2a30;
  --accent:    #04A2CC;
  --accent2:   #ff4d6d;
  --text:      #e8e8f0;
  --muted:     #5a5a6a;
  --mono:      'JetBrains Mono', monospace;
  --sans:      'Inter', sans-serif;
}

/* ─── Base ──────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Grid-line texture overlay (same pattern as KASPAR) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(4,162,204,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(4,162,204,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ─── Titlebar ──────────────────────────────────────────────────── */
.titlebar {
  height: 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 0 0 16px;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.titlebar-title {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.titlebar-dots {
  display: flex;
  gap: 6px;
}

.titlebar-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
}

.titlebar-dot.red   { background: #ff5f57; }
.titlebar-dot.yellow{ background: #ffbd2e; }
.titlebar-dot.green { background: #28c840; }

/* ─── Layout ────────────────────────────────────────────────────── */
.app {
  display: flex;
  flex: 1;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-name {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.sidebar-name span {
  color: var(--accent);
}

.sidebar-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-top: 6px;
  text-transform: uppercase;
}

/* nav */
.nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  user-select: none;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-item.active {
  color: var(--accent);
  background: rgba(4,162,204,0.08);
  border-color: rgba(4,162,204,0.2);
}

.nav-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

/* status dot */
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: pulse 2s infinite;
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ─── Main area ─────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* pages */
.page {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.page.active {
  display: flex;
}

/* topbar */
.topbar {
  padding: 24px 32px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-title span {
  color: var(--accent);
}

.page-subtitle {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-top: 6px;
  text-transform: uppercase;
}

/* ─── Category label (reused from KASPAR) ──────────────────────── */
.category-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-label:first-child {
  margin-top: 4px;
}

.category-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Scrollable content ────────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ─── Portfolio grid ────────────────────────────────────────────── */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* ─── Project card ──────────────────────────────────────────────── */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}

/* accent left bar (like KASPAR script cards) */
.project-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--border);
  transition: background 0.18s;
  border-radius: 10px 0 0 10px;
}

.project-card:hover {
  border-color: rgba(4,162,204,0.35);
  background: var(--surface2);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(4,162,204,0.06);
}

.project-card:hover::before {
  background: var(--accent);
}

/* image area */
.card-image {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.3s;
  filter: grayscale(15%) brightness(0.9);
}

.project-card:hover .card-image img {
  transform: scale(1.04);
  filter: grayscale(0%) brightness(1);
}

/* placeholder when no image supplied */
.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.card-placeholder::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  pointer-events: none;
}

/* card body */
.card-body {
  padding: 16px 18px 18px;
}

.card-index {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}

.card-desc {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.card-tag {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  background: rgba(4,162,204,0.1);
  color: var(--accent);
  border: 1px solid rgba(4,162,204,0.2);
}

/* ─── About page ────────────────────────────────────────────────── */
.about-content {
  max-width: 560px;
}

.about-content p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 18px;
}

.about-content p strong {
  color: var(--text);
  font-weight: 700;
}

.skill-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.skill-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  width: 100px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.skill-bar-wrap {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.skill-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--accent);
  animation: growBar 1s ease both;
}

@keyframes growBar {
  from { width: 0 !important; }
}

.skill-pct {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* ─── Status bar (bottom) ───────────────────────────────────────── */
.statusbar {
  height: 28px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.statusbar .sep {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.statusbar .hl {
  color: var(--accent);
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .content { padding: 20px; }
  .topbar { padding: 16px 20px; }
}

@media (max-width: 1200px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Project card as link ──────────────────────────────────────── */
a.project-card {
  text-decoration: none;
  display: block;
  color: inherit;
}

/* ─── Links list (About page) ───────────────────────────────────── */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s;
}

.link-row:hover {
  border-color: rgba(4,162,204,0.35);
  color: var(--accent);
  background: var(--surface2);
}

.link-icon {
  font-size: 13px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.link-label {
  flex: 1;
}

.link-arrow {
  font-size: 11px;
  color: var(--muted);
}

.link-row:hover .link-arrow {
  color: var(--accent);
}
