/* ==========================================================================
   pinguiscodex — Portfolio Styles
   Strictly black & white. Terminal-inspired. Monospace throughout.
   ========================================================================== */

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

:root {
  /* Palette — strictly B&W + grayscale */
  --bg:          #000000;
  --bg-alt:      #0a0a0a;
  --bg-card:     #0d0d0d;
  --border:      #333333;
  --border-light:#222222;
  --text:        #ffffff;
  --text-alt:    #cccccc;
  --text-muted:  #777777;
  --text-dim:    #555555;
  --accent:      #ffffff;

  /* Typography */
  --font-mono: 'Consolas', 'Courier New', 'Lucida Console', monospace;

  /* Spacing */
  --section-pad: 5rem 0;
  --container: 60rem;
  --gutter: 1.5rem;

  /* Transitions */
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg);
}

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Skip Link (a11y) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 1rem;
  z-index: 1000;
  font-size: 0.85rem;
}

.skip-link:focus {
  top: 0;
}

/* --- Focus styles --- */
*:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* --- Selection --- */
::selection {
  background: var(--text);
  color: var(--bg);
}

/* --- Container --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- Links --- */
a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color var(--transition);
}

a:hover {
  border-bottom-color: var(--text);
}

.link-inline {
  display: inline-block;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 2px;
}

.link-inline:hover {
  border-bottom-style: solid;
}

/* ========== Navigation ========== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.nav-logo {
  font-size: 0.95rem;
  font-weight: 700;
  border-bottom: none;
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  border-bottom: none;
  opacity: 0.8;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.75rem;
}

.nav-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  border-bottom: none;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  transition: color var(--transition);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Hamburger toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========== Sections ========== */
.section {
  padding: var(--section-pad);
  border-bottom: 1px solid var(--border-light);
}

.section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  letter-spacing: -0.01em;
}

.section-number {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.9rem;
}

/* ========== Hero ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  border-bottom: none;
  padding-top: 3.5rem; /* offset for fixed nav */
}

.terminal-block {
  max-width: 48rem;
}

.terminal-prompt {
  font-size: clamp(1.2rem, 3.5vw, 2rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  min-height: 2.4em;
}

.prompt-symbol {
  color: var(--text-muted);
}

/* Blinking cursor */
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--text);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

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

.hero-subtitle {
  margin-top: 0.75rem;
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--text-muted);
  transition: opacity 0.4s ease;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  transition: opacity 0.4s ease;
}

.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.65rem 1.5rem;
  border: 1px solid var(--text);
  cursor: pointer;
  transition: all var(--transition);
  text-transform: lowercase;
  letter-spacing: 0.03em;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary:hover {
  background: transparent;
  color: var(--text);
  border-bottom-color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--text);
}

.btn-outline:hover {
  background: var(--text);
  color: var(--bg);
  border-bottom-color: var(--text);
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  animation: bounce 2s infinite;
}

.scroll-arrow {
  color: var(--text-dim);
  font-size: 1.2rem;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ========== About / Content Blocks ========== */
.content-block p {
  margin-bottom: 1.25rem;
  color: var(--text-alt);
  font-size: 0.95rem;
}

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

/* ========== Skills ========== */
.skill-group {
  margin-bottom: 2rem;
}

.skill-group-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.skill-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-card);
  letter-spacing: 0.02em;
  transition: all var(--transition);
}

.skill-badge:hover {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

/* Secondary / muted skills (C++, C#) */
.skill-group-secondary {
  opacity: 0.55;
}

.skill-list-muted .skill-badge-muted {
  border-style: dashed;
  border-color: var(--border-light);
  color: var(--text-dim);
  background: transparent;
}

.skill-badge-muted:hover {
  border-color: var(--text-muted);
  background: var(--bg-card);
  color: var(--text-muted);
}

.muted-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ========== Projects ========== */
.projects-loading,
.projects-error {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.projects-error {
  color: var(--text-alt);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* Repo card (injected by JS) */
.repo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 1.25rem;
  transition: border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.repo-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}

.repo-card a {
  border-bottom: none;
}

.repo-card a:hover {
  border-bottom: none;
}

.repo-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.repo-name:hover {
  color: var(--text-alt);
}

.repo-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex-grow: 1;
}

.repo-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  align-items: center;
}

.repo-lang {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.repo-lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}

.repo-stars {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.repo-link-arrow {
  font-size: 0.75rem;
  color: var(--text-dim);
  border-bottom: none;
  text-align: right;
}

.repo-link-arrow:hover {
  color: var(--text);
}

/* ========== Experience / Timeline ========== */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 1px solid var(--border-light);
}

.timeline-entry {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-entry:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2.35rem;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border: 2px solid var(--text-muted);
  background: var(--bg);
  border-radius: 50%;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.timeline-role {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.volunteer-tag {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 400;
  border: 1px solid var(--border-light);
  padding: 0.1rem 0.5rem;
  letter-spacing: 0.03em;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.timeline-org {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline-desc {
  font-size: 0.85rem;
  color: var(--text-alt);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.timeline-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.timeline-tech li {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

/* ========== Available for Hire ========== */
.hire-box {
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
}

.hire-box p {
  font-size: 0.9rem;
  color: var(--text-alt);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.hire-box strong {
  color: var(--text);
}

/* ========== Contact ========== */
.contact-list {
  list-style: none;
  margin-top: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  min-width: 6rem;
}

.contact-value {
  font-size: 0.9rem;
  color: var(--text-alt);
  border-bottom: none;
}

.contact-value:hover {
  color: var(--text);
}

/* ========== Footer ========== */
.footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border-light);
}

.footer p {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.footer-copy {
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* ========== Responsive: Tablet ========== */
@media (max-width: 48rem) {
  :root {
    --section-pad: 3.5rem 0;
  }

  .section-title {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Responsive: Mobile ========== */
@media (max-width: 36rem) {
  :root {
    --section-pad: 3rem 0;
    --gutter: 1.25rem;
  }

  /* Show hamburger */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 3.5rem;
    right: 0;
    bottom: 0;
    width: 14rem;
    flex-direction: column;
    background: var(--bg);
    border-left: 1px solid var(--border-light);
    padding: 2rem 1.5rem;
    gap: 1.25rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 99;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 0.9rem;
  }

  .hero {
    min-height: 90vh;
  }

  .terminal-prompt {
    font-size: 1.1rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    text-align: center;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-header {
    flex-direction: column;
  }

  .contact-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .contact-label {
    min-width: unset;
  }

  .scroll-hint {
    display: none;
  }
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .cursor {
    animation: none;
    opacity: 1;
  }
}

/* ========== Print ========== */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .nav,
  .scroll-hint,
  .nav-toggle {
    display: none;
  }

  .section {
    padding: 1.5rem 0;
    page-break-inside: avoid;
  }

  a {
    color: #000;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.75rem;
    color: #555;
  }
}
