/* Readability: theme-aware text colors that clear WCAG AA (4.5:1) against
   the theme's backgrounds (white in light mode; #17191a page and #343a40
   timeline card in dark mode). Pages use these instead of fixed greys,
   which were ~2.5:1 on white. */
[data-theme="light"] {
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --accent-text: #1d4ed8;
}
[data-theme="dark"] {
  --text-secondary: #cbd5e1;
  --text-tertiary: #a3b1c6;
  --accent-text: #60a5fa;
}
[data-theme="dark"] .text-muted { color: var(--text-tertiary) !important; }

/* Wider layout on large screens: Bootstrap caps .container at 1140px, which
   left ~40% of a 1920px screen empty. Nested .container elements (landing
   sections) inherit the same caps. */
@media (min-width: 1400px) { .container { max-width: 1320px; } }
@media (min-width: 1700px) { .container { max-width: 1560px; } }

/* Resume: size the viewer to one letter page (8.5 x 11) with the PDF fit
   to width, instead of a wide grey box with a small page in the middle */
.resume-frame {
  max-width: 920px;
  margin: 0 auto 48px;
  aspect-ratio: 8.5 / 11;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.resume-frame iframe { width: 100%; height: 100%; border: none; display: block; }

/* Blog: three columns on wide screens (theme hard-codes col-lg-6) */
@media (min-width: 1400px) {
  .blog-list .card-group > .col-lg-6 { flex: 0 0 33.333%; max-width: 33.333%; }
}
/* Blog card text contrast. The theme's `.bg-dark *` rule forces white text
   onto badge-light tags (white on light grey), and white text on the info,
   success and warning fills is under 4.5:1, so darken those fills and use
   dark text on yellow. */
.post.card .badge.badge-light { color: #343a40 !important; }
.post.card.bg-info    { background-color: #117a8b !important; }
.post.card.bg-success { background-color: #1e7e34 !important; }
.post.card.bg-primary { background-color: #0062cc !important; }
.post.card.bg-warning,
.post.card.bg-warning * { color: #343a40 !important; }
.post.card.bg-warning .badge { color: #343a40 !important; background: rgba(255,255,255,0.7); }

/* Long-form prose (bio, posts, project pages): cap line length and loosen
   line spacing so paragraphs don't run ~110 characters wide */
.markdown-body > p,
.markdown-body > ul,
.markdown-body > ol,
.markdown-body > blockquote {
  max-width: 72ch;
  line-height: 1.75;
}
.markdown-body li { margin-bottom: 0.35em; }

/* Bio page: let the intro text use the full content width */
.bio-text p { max-width: none; line-height: 1.75; }

/* Company logo marker in the About timeline */
.timeline-body .timeline-item .timeline-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  position: absolute;
  left: -26px;
  top: -6px;
  z-index: 11;
  background-color: #f8f9fa;
  border: 4px solid #007bff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-body .timeline-item .timeline-logo img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.timeline-body .timeline-item .content .company {
  margin-top: -10px;
  margin-bottom: 10px;
  font-weight: 600;
}

.timeline-body .timeline-item .content h2 {
  font-size: 1.5rem;
  font-weight: 700;
}
.timeline-body .timeline-item .content .date {
  color: var(--text-tertiary);
}
.timeline-body .timeline-item .content p {
  line-height: 1.7;
}
.timeline-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.timeline-tech .badge,
.project.card .badge {
  font-size: 0.8rem;
  color: var(--accent-text) !important;
  border-color: var(--accent-text) !important;
}

/* About page skills: a vertical "Skills" side label (rotated text + gold
   accent bar) next to a 3D carousel: one rectangular tab per group (name +
   icon tiles), positioned as faces of a cylinder in 3D space. Dragging spins
   the cylinder around its vertical axis; it's a real circle so it spins
   indefinitely in either direction with no wrap-around seam. Real brand
   logos come from Simple Icons (downloaded locally to assets/icons/skills);
   skills with no brand mark (techniques, not products) fall back to a Font
   Awesome glyph in the site's accent blue. */
.skills-section {
  display: flex;
  align-items: stretch;
  gap: 32px;
  margin: 40px 0 64px;
}
.skills-side-label {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 56px;
  width: 56px; /* explicit width: flex can miscalculate the flex-basis of
                  vertical-rl text and collapse it to near-zero otherwise */
}
.skills-side-label .bar {
  align-self: stretch;
  width: 4px;
  flex-shrink: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, #f5b942, #f0a500);
}
.skills-side-label .label-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
[data-theme="light"] .skills-side-label .label-text { color: #1e293b; }
[data-theme="dark"] .skills-side-label .label-text {
  color: #f8fafc;
  text-shadow: 0 0 12px rgba(0,0,0,0.6);
}

.skills-carousel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 300px;
  perspective: 3000px; /* must match `perspective` in about/skills.html */
  cursor: grab;
  user-select: none;
}
.skills-carousel:active { cursor: grabbing; }
.skills-carousel-stage {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}
.skills-card {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  padding: 24px;
  border-radius: 14px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: opacity 0.5s ease;
}
.skills-card h3 { margin-bottom: 16px; }
[data-theme="light"] .skills-card {
  background: rgba(0,0,0,0.035);
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}
[data-theme="dark"] .skills-card {
  background: rgba(20,22,28,0.55);
  border: 1px solid rgba(128,128,128,0.25);
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.skills-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.skills-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.skills-dot.active { background: #3b82f6; }
[data-theme="light"] .skills-dot { background: rgba(0,0,0,0.15); }
[data-theme="dark"] .skills-dot { background: rgba(128,128,128,0.3); }

.skill-tile-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.skill-tile {
  width: 108px;
  padding: 14px 8px 10px;
  text-align: center;
  border-radius: 12px;
}
[data-theme="light"] .skill-tile {
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.12);
}
[data-theme="dark"] .skill-tile {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(128,128,128,0.15);
}
.skill-tile img,
.skill-tile i {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto 10px;
  font-size: 28px;
  line-height: 30px;
}
.skill-tile span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
[data-theme="light"] .skill-tile span { color: #475569; }
[data-theme="dark"] .skill-tile span { color: #94a3b8; }

@media (max-width: 600px) {
  .skills-section { flex-direction: column; }
  .skills-side-label { flex-direction: row; }
  .skills-side-label .bar { width: auto; height: 4px; align-self: auto; flex: 1 1 auto; }
  .skills-side-label .label-text { writing-mode: horizontal-tb; }
}

/* Project card hover: a tiny Factorio-style inserter-arm swipe instead of
   the theme's default lift + shadow */
.project.card {
  position: relative;
  overflow: visible;
}
.project.card:hover:not(.post) {
  transform: none;
  box-shadow: none;
}
.inserter-arm {
  position: absolute;
  top: -20px;
  left: 50%;
  width: 5px;
  height: 20px;
  margin-left: -2.5px;
  border-radius: 3px;
  transform-origin: top center;
  transform: rotate(-35deg);
  transition: transform 0.5s ease;
  pointer-events: none;
  z-index: 5;
}
[data-theme="light"] .inserter-arm { background: #475569; }
[data-theme="dark"] .inserter-arm { background: #cbd5e1; }
.inserter-arm::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: -4px;
  width: 13px;
  height: 8px;
  background: #f5a623;
  border-radius: 2px;
}
.project.card:hover .inserter-arm {
  animation: inserter-swing 0.6s ease-in-out;
}
@keyframes inserter-swing {
  0%   { transform: rotate(-35deg); }
  50%  { transform: rotate(35deg); }
  100% { transform: rotate(-35deg); }
}
