/* ===================================================
   PAYTYN K. WILLIAMS — PORTFOLIO STYLESHEET
   =================================================== */

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

/* ===== DESIGN TOKENS ===== */
:root {
  --bg:            #F8FAFC;
  --bg-card:       #FFFFFF;
  --bg-alt:        #F1F5F9;
  --text:          #0F172A;
  --text-secondary:#64748B;
  --border:        #E2E8F0;
  --accent:        #10B981;
  --accent-hover:  #059669;
  --accent-light:  #D1FAE5;
  --nav-bg:        rgba(248, 250, 252, 0.88);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --radius:        14px;
  --radius-sm:     8px;
}

[data-theme="dark"] {
  --bg:            #0F172A;
  --bg-card:       #1E293B;
  --bg-alt:        #1E293B;
  --text:          #F1F5F9;
  --text-secondary:#94A3B8;
  --border:        #334155;
  --accent-light:  rgba(16, 185, 129, 0.15);
  --nav-bg:        rgba(15, 23, 42, 0.88);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.35);
}

/* ===== BASE ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; }

/* ===== LAYOUT ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s, border-color 0.3s;
}

.nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.2s;
}
.nav__logo:hover { color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav__links a {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.nav__links a:hover,
.nav__links a.active {
  color: var(--text);
  background: var(--border);
}
.nav__links a.active { color: var(--accent); }

/* Hamburger (mobile only) */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav__hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav__hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Dark mode toggle button */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--border);
  color: var(--text);
}

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

/* ===== HERO ===== */
.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 24px 72px;
  position: relative;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(16, 185, 129, 0.07) 0%, transparent 70%);
}

.hero__content {
  max-width: 760px;
}

.hero__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero__name {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 120%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .hero__name {
  background: linear-gradient(135deg, #F1F5F9 0%, #94A3B8 120%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero__tagline {
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 44px;
  letter-spacing: 0.01em;
}

.hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Scroll indicator */
.hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
}
.hero__scroll p {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.hero__scroll-mouse {
  width: 20px;
  height: 32px;
  border: 2px solid var(--text-secondary);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  padding-top: 5px;
}
.hero__scroll-mouse span {
  width: 3px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 2px;
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { transform: translateY(0); opacity: 1; }
  60%       { transform: translateY(7px); opacity: 0.2; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn--secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.btn--secondary:hover {
  background: var(--bg-alt);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ===== SECTIONS ===== */
.section {
  padding: 100px 0;
}
.section--alt {
  background: var(--bg-alt);
}

.section__title {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 8px;
}
.section__title--centered { text-align: center; }

.section__subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 60px;
}

/* ===== ABOUT ===== */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

.about__text .section__title {
  margin-bottom: 20px;
}

.about__summary {
  font-size: 17px;
  line-height: 1.78;
  color: var(--text-secondary);
}

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card__number {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}
.stat-card__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ===== CERTIFICATIONS ===== */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.cert-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.4);
}

/* Featured cert gets accent top bar */
.cert-card--featured {
  border-color: var(--accent);
  position: relative;
  overflow: hidden;
}
.cert-card--featured::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #34D399);
}

/* Trailhead spans full row */
.cert-card--trailhead {
  grid-column: 1 / -1;
}

.cert-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

/* Cert icon circle */
.cert-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cert-icon--salesforce { background: #00A1E0; }
.cert-icon--ibm        { background: #1F70C1; }
.cert-icon--ucdavis    { background: #022851; }
.cert-icon--cisco      { background: #049FD9; }
.cert-icon--trailhead  { background: #032D60; }

.cert-icon__text {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: white;
}

.cert-card__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.cert-card__issuer {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.cert-card__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
}

.cert-card__date {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Trailhead badge pills */
.trailhead-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.trailhead-badge {
  font-size: 12px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #032D60 0%, #00A1E0 100%);
  padding: 5px 12px;
  border-radius: 20px;
}

.trailhead-badge--more {
  background: linear-gradient(135deg, #334155 0%, #64748B 100%);
  color: white;
}

/* ===== SHARED PILLS ===== */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: default;
}
.pill:hover {
  background: var(--accent-light);
  border-color: rgba(16,185,129,0.4);
  color: var(--accent);
}
.pill--sm {
  font-size: 11px;
  padding: 3px 8px;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow 0.2s;
}
.skill-category:hover {
  box-shadow: var(--shadow-sm);
}

.skill-category__title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 16px;
}
.skill-category__title svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.4);
}
.project-card--wide {
  grid-column: 1 / -1;
}

.project-card__icon {
  width: 46px;
  height: 46px;
  background: var(--accent-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.project-card__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.project-card__meta {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: -8px;
}

.project-card__description {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  flex-grow: 1;
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  margin-top: 4px;
  transition: gap 0.2s;
  width: fit-content;
}
.project-card__link:hover { gap: 9px; }

/* ===== CONTACT ===== */
.contact__inner {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}
.contact__title {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 16px;
}
.contact__subtitle {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 40px;
}
.contact__links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== FOOTER ===== */
.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer p {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== SCROLL ANIMATIONS ===== */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays within grids */
.cert-grid   .fade-up:nth-child(2) { transition-delay: 0.08s; }
.cert-grid   .fade-up:nth-child(3) { transition-delay: 0.16s; }
.cert-grid   .fade-up:nth-child(4) { transition-delay: 0.24s; }
.cert-grid   .fade-up:nth-child(5) { transition-delay: 0.08s; }
.skills-grid .fade-up:nth-child(2) { transition-delay: 0.08s; }
.skills-grid .fade-up:nth-child(3) { transition-delay: 0.12s; }
.skills-grid .fade-up:nth-child(4) { transition-delay: 0.18s; }
.skills-grid .fade-up:nth-child(5) { transition-delay: 0.22s; }
.skills-grid .fade-up:nth-child(6) { transition-delay: 0.26s; }
.projects-grid .fade-up:nth-child(2) { transition-delay: 0.08s; }
.projects-grid .fade-up:nth-child(3) { transition-delay: 0.08s; }
.projects-grid .fade-up:nth-child(4) { transition-delay: 0.16s; }
.projects-grid .fade-up:nth-child(5) { transition-delay: 0.08s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; gap: 48px; }
  .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .section { padding: 72px 0; }

  /* Show hamburger, hide desktop links */
  .nav__hamburger { display: flex; }
  .nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px 16px;
    gap: 2px;
  }
  .nav__links.open { display: flex; }
  .nav__links li { width: 100%; }
  .nav__links a { width: 100%; padding: 10px 12px; }
  .nav__links .theme-toggle { margin-left: 12px; margin-top: 8px; }

  .cert-grid     { grid-template-columns: 1fr; }
  .cert-card--trailhead { grid-column: 1; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card--wide { grid-column: 1; }
}

@media (max-width: 520px) {
  .hero { padding: 80px 20px 64px; }
  .hero__cta { flex-direction: column; align-items: center; }
  .contact__links { flex-direction: column; align-items: center; }
  .about__stats { grid-template-columns: 1fr 1fr; }
}

/* ===== PRINT ===== */
@media print {
  .nav, .hero__scroll, .theme-toggle { display: none; }
  .fade-up { opacity: 1; transform: none; }
  .section { padding: 40px 0; }
}
