html, body { height: 100%; margin: 0; }
body {
  background: var(--surface);
  background-image: url('bg-texture.png');
  background-size: cover;
  background-position: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
}

.author-page {
  flex: 1;
  padding: 24px 32px 48px;
  display: flex;
  flex-direction: column;
}

.author-box {
  position: relative;
  border: 1px dashed var(--brand);
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.author-box .cm { position: absolute; width: 8px; height: 8px; border: 2px solid var(--brand); pointer-events: none; }
.author-box .cm.tl { top:-1px; left:-1px; border-right:0; border-bottom:0; }
.author-box .cm.tr { top:-1px; right:-1px; border-left:0; border-bottom:0; }
.author-box .cm.bl { bottom:-1px; left:-1px; border-right:0; border-top:0; }
.author-box .cm.br { bottom:-1px; right:-1px; border-left:0; border-top:0; }

/* ── TITLEBAR ── */
.author-titlebar {
  height: 28px; min-height: 28px;
  border-bottom: 1px solid var(--brand);
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px; flex-shrink: 0;
}
.author-titlebar-path { font: 400 12px/1 var(--font-mono); color: var(--slate-500); flex: 1; }
.author-titlebar-path span { color: var(--brand); }
.author-titlebar-path a { color: var(--brand); text-decoration: none; }
.author-titlebar-path a:hover { color: var(--brand); border-bottom: 1px dashed var(--brand);}
.author-back {
  font: 400 11px/1 var(--font-mono); color: var(--fg-muted);
  text-decoration: none; display: flex; align-items: center; gap: 4px;
  transition: color 60ms steps(1);
}
.author-back:hover { color: var(--brand); }
.author-back-icon {
  display: inline-block; width: 12px; height: 12px; background: currentColor;
  -webkit-mask-image: url('icons/chevron-left.svg'); mask-image: url('icons/chevron-left.svg');
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}

/* ── PROFILE ── */
.author-profile {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 32px 40px 32px;
  border-bottom: 1px dashed rgba(244,128,93,0.2);
}

.author-avatar-wrap {
  flex-shrink: 0;
  border: 1px dashed var(--brand);
  background: var(--bg-base);
  width: 108px;
  height: 108px;
  padding: 3px;
}

.author-avatar {
  display: block;
  width: 100px;
  height: 100px;
  object-fit: cover;
}

.author-avatar-placeholder {
  width: 108px;
  height: 108px;
  border: 1px dashed var(--brand);
  background: var(--bg-elevated);
  position: relative;
}
.author-avatar-placeholder::after {
  content: '?';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font: 700 32px/1 var(--font-mono); color: var(--fg-muted);
}

.author-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.author-name {
  font: 700 32px/1.1 var(--font-mono);
  color: var(--fg-primary);
  letter-spacing: -0.02em;
}

.author-bio {
  font: 400 13px/1.65 var(--font-mono);
  color: var(--fg-secondary);
  max-width: 580px;
}

.author-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.author-stats {
  display: flex;
  gap: 28px;
  padding-top: 4px;
}

.author-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.author-stat-val {
  font: 700 18px/1 var(--font-mono);
  color: var(--success);
}

.author-stat-lbl {
  font: 400 10px/1 var(--font-mono);
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

/* ── AUTHOR INDEX ── */
.author-index-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 32px 40px 24px;
  border-bottom: 1px dashed rgba(244,128,93,0.2);
}
.author-index-path { font: 400 11px/1 var(--font-mono); color: var(--fg-muted); letter-spacing: 0.04em; }
.author-index-path span { color: var(--brand); }
.author-index-path a { color: var(--brand); text-decoration: none; }
.author-index-path a:hover { color: var(--brand); border-bottom: 1px dashed var(--brand);}
.author-index-title { font: 700 24px/1.1 var(--font-mono); color: var(--fg-primary); }
.author-index-desc { font: 400 13px/1.6 var(--font-mono); color: var(--fg-secondary); }

.author-index-grid { padding: 24px 24px 48px; }

.author-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.author-card-avatar {
  flex-shrink: 0;
  border: 1px dashed var(--brand);
  background: var(--bg-evelated);
  width: 44px;
  height: 44px;
  padding: 2px;
  object-fit: cover;
}

.author-card-avatar img {
  width: 38px;
  height: 38px;
}

.author-card-identity { display: flex; flex-direction: column; gap: 5px; }

/* ── SKILLS SECTION ── */
.author-skills-section {
  padding: 28px 40px 48px;
}

.author-skills-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-label {
  font: 700 10px/1 var(--font-mono);
  color: var(--fg-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.author-skills-count {
  font: 400 11px/1 var(--font-mono);
  color: var(--fg-muted);
}

/* ── CARDS (from library.css) ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.tcard {
  border: 1px solid var(--bg-chip); background: var(--bg-elevated);
  display: flex; flex-direction: column; position: relative;
  cursor: pointer; transition: border-color 100ms steps(2), background 100ms steps(2);
  text-decoration: none;
}
.tcard:hover { border-color: var(--slate-600); background: rgba(244,128,93,0.04); }
.card-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font: 700 14px/1.35 var(--font-mono); color: var(--fg-primary); letter-spacing: 0.02em; }
.card-desc { font: 400 12px/1.55 var(--font-mono); color: var(--fg-muted); }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.card-connection { font: 400 10px/1 var(--font-mono); color: var(--fg-muted); padding-top: 2px; }
.card-connection span { color: var(--fg-secondary); }
.card-foot {
  border-top: 1px dashed rgba(244,128,93,0.2); padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card-meta { display: flex; align-items: center; gap: 10px; }
.card-author-avatar {
  display: block; width: 36px; height: 36px; object-fit: cover;
  border: 1px dashed var(--brand); background: var(--bg-elevated); flex-shrink: 0;
}
.card-author-info { display: flex; flex-direction: column; gap: 3px; }
.card-author-label { font: 400 10px/1 var(--font-mono); color: var(--fg-muted); }
.card-author-name { font: 700 11px/1 var(--font-mono); color: var(--fg-primary); }
.card-uses { font: 400 10px/1 var(--font-mono); color: var(--fg-muted); opacity: 0.7; }
.card-use-btn {
  font: 400 12px/1 var(--font-mono); color: var(--bg-base);
  background: var(--brand); border: none; padding: 5px 12px;
  cursor: pointer; flex-shrink: 0; transition: background 60ms steps(1);
  display: flex; align-items: center; gap: 4px;
}
.card-use-btn:hover { background: var(--orange-tint); }

/* ── TAGS (shared) ── */
.tag {
  font: 400 10px/1 var(--font-mono); color: var(--fg-secondary);
  border: 1px solid var(--bg-chip); background: var(--bg-chip-alt);
  padding: 3px 7px; letter-spacing: 0.02em;
  text-decoration: none;
}
.tag:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: rgba(57,41,29,0.6);
}
.tag.orange { color: var(--brand); border-color: var(--orange-ash); background: rgba(57,41,29,0.6); }
.tag.green  { color: var(--success); border-color: rgba(52,211,153,0.25); background: rgba(4,120,87,0.15); }
.tag.yellow { color: var(--hint); border-color: rgba(253,224,71,0.2); background: rgba(253,224,71,0.07); }
.tag.red { color: rgba(233,0,0,0.6); border-color: rgba(174,1,15,0.2); background: rgba(174,1,15,0.07); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--orange-ash); }
::-webkit-scrollbar-thumb:hover { background: var(--orange-500); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .author-page { padding: 16px; }
  .author-profile { padding: 24px; gap: 20px; }
  .author-skills-section { padding: 24px; }
  .card-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .author-page { padding: 12px; }
  .author-profile { flex-direction: column; padding: 20px; }
  .author-name { font-size: 22px; }
  .card-grid { grid-template-columns: 1fr; }
}
