/* =============================================
   CARL MASTERS PORTFOLIO — styles.css
   ============================================= */

/* ---- CSS Custom Properties ---- */
:root {
  --bg:        #0d0f14;
  --bg-alt:    #111318;
  --surface:   #181b22;
  --border:    #252933;
  --accent:    #6c63ff;
  --accent-2:  #00d4aa;
  --text:      #e8eaf0;
  --text-muted:#8b91a8;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius:    12px;
  --radius-sm: 6px;
  --shadow:    0 4px 30px rgba(0, 0, 0, 0.4);
  --transition:0.25s ease;
  --max-w:     1100px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; }

img { max-width: 100%; display: block; }

/* ---- Utility ---- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.accent { color: var(--accent); }

/* =============================================
   NAVIGATION
   ============================================= */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.1rem 0;
  transition: background var(--transition), backdrop-filter var(--transition), box-shadow var(--transition);
}

#navbar.scrolled {
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

#navbar.menu-open {
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  transition: none;
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  transition: color var(--transition);
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  border-radius: 99px;
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  padding: 0.45rem 1.1rem !important;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent) !important;
  transition: background var(--transition), color var(--transition) !important;
}
.nav-cta:hover {
  background: var(--accent);
  color: #fff !important;
}
.nav-cta::after { display: none !important; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 99px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#particleCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 1.5rem;
  max-width: 780px;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.2s forwards;
}

.hero-name {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #e8eaf0 20%, var(--accent) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  animation: fadeUp 0.7s 0.4s forwards;
}

.hero-tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 1rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.6s forwards;
}

.divider { color: var(--border); }

#rotating-role {
  color: var(--accent-2);
  font-weight: 500;
  transition: opacity 0.3s;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
  max-width: 480px;
  margin-left: auto; margin-right: auto;
  opacity: 0;
  animation: fadeUp 0.7s 0.8s forwards;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.25rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s 1s forwards;
}



/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  border: none;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.4);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(108, 99, 255, 0.6); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(108, 99, 255, 0.07);
}

.btn-full { width: 100%; }

/* =============================================
   SECTIONS — SHARED
   ============================================= */
.section { padding: 7rem 0; }
.section-alt { background: var(--bg-alt); }

.section-header {
  margin-bottom: 3.5rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -1px;
}

/* =============================================
   ABOUT
   ============================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 1.025rem;
}

.about-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2.25rem;
}

.stat {
  text-align: center;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  margin-bottom: 0 !important;
}

/* Code card */
.about-card {
  perspective: 800px;
}

.card-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card-inner:hover {
  border-color: rgba(108, 99, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(108, 99, 255, 0.25), 0 8px 32px rgba(108, 99, 255, 0.12);
}

.code-block {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.25);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.red    { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green  { background: #27c93f; }

.code-filename {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.code-block pre {
  padding: 1.35rem 1.5rem;
  overflow-x: auto;
  line-height: 1.75;
}

.code-block .kw  { color: #bd93f9; }
.code-block .cls { color: #50fa7b; }
.code-block .fn  { color: #8be9fd; }
.code-block .str { color: #f1fa8c; }

/* =============================================
   SKILLS
   ============================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.skill-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), transform var(--transition);
}

.skill-category:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.skill-cat-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid rgba(108, 99, 255, 0.2);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  transition: background var(--transition), border-color var(--transition);
}

.tag:hover {
  background: rgba(108, 99, 255, 0.2);
  border-color: var(--accent);
}

/* =============================================
   PROJECTS
   ============================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  opacity: 0;
  transform: translateY(20px);
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(108, 99, 255, 0.18);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-icon {
  font-size: 2rem;
  line-height: 1;
}

.project-links {
  display: flex;
  gap: 0.75rem;
}

.icon-link {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: color var(--transition);
}

.icon-link svg {
  width: 18px; height: 18px;
}

.icon-link:hover { color: var(--accent); }

.project-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
  line-height: 1.65;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.project-tech span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-2);
}

.project-tech span:not(:last-child)::after {
  content: ' ·';
  color: var(--text-muted);
}

/* =============================================
   EDUCATION / TIMELINE
   ============================================= */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-dot {
  position: absolute;
  left: -2.07rem;
  top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-alt);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.3);
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  transition: border-color var(--transition);
}

.timeline-content:hover { border-color: var(--accent); }

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.timeline-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.35rem 0 0.25rem;
}

.timeline-org {
  font-size: 0.85rem;
  color: var(--accent-2);
  margin-bottom: 0.6rem;
}

.timeline-content > p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.timeline-tags span {
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.25);
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
}

/* =============================================
   CONTACT
   ============================================= */
.contact-wrapper {
  max-width: 700px;
}

.contact-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.75;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.form-group input,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.form-status {
  font-size: 0.875rem;
  min-height: 1.2rem;
  text-align: center;
}

.form-status.success { color: var(--accent-2); }
.form-status.error   { color: #ff7b7b; }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.contact-pill svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
}

.contact-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-sub {
  font-size: 0.78rem;
  margin-top: 0.3rem;
  opacity: 0.6;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}



/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .about-grid    { grid-template-columns: 1fr; gap: 2.5rem; }
  .skills-grid   { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .container,
  .nav-container {
    padding: 0 1rem;
  }

  .nav-links { display: none; }

  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    align-items: center;
    justify-content: center;
    gap: 2rem;
    z-index: 1002;
    padding: 1.25rem;
  }

  .nav-links.mobile-open a {
    font-size: 1.2rem;
    text-align: center;
  }

  .nav-links.mobile-open a::after { display: none; }

  .hamburger { display: flex; z-index: 1003; }

  .hero {
    min-height: 92svh;
  }

  .hero-content {
    padding-top: 4rem;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .project-card,
  .skill-category,
  .timeline-content {
    padding: 1.2rem;
  }

  .timeline {
    padding-left: 1.8rem;
  }

  .timeline-dot {
    left: -1.55rem;
  }

  .code-block {
    font-size: 0.78rem;
  }

  .code-block pre {
    padding: 1rem;
    line-height: 1.6;
  }

  .form-row { grid-template-columns: 1fr; }

  .about-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
  }

  .stat p {
    font-size: 0.74rem;
  }

  .contact-links {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-pill {
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .section { padding: 4.5rem 0; }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .section {
    padding: 3.8rem 0;
  }

  .hero-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-description {
    font-size: 0.96rem;
  }

  .hero-tagline { flex-direction: column; gap: 0.25rem; }
  .divider { display: none; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; max-width: 320px; }

  .project-title {
    font-size: 1.05rem;
  }

  .project-desc,
  .timeline-content > p,
  .contact-lead {
    font-size: 0.88rem;
  }
}

@media (max-width: 360px) {
  .container,
  .nav-container {
    padding: 0 0.8rem;
  }

  .hero-name {
    letter-spacing: -1px;
  }

  .btn {
    padding: 0.68rem 1rem;
    font-size: 0.86rem;
  }

  .project-card,
  .skill-category,
  .timeline-content {
    padding: 1rem;
  }

  .contact-pill {
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
  }

  .section-title {
    font-size: 1.55rem;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  #navbar {
    padding: 0.65rem 0;
  }

  .hero {
    min-height: auto;
    padding: 5.2rem 0 2rem;
  }

  .hero-content {
    padding-top: 0;
  }

  .hero-greeting,
  .hero-tagline,
  .hero-description {
    margin-top: 0.45rem;
    margin-bottom: 0;
  }

  .hero-actions {
    margin-top: 1.2rem;
  }

  .section {
    padding: 3.2rem 0;
  }
}
