/* ============================================
   Kyle Blenkinsop - Portfolio
   ============================================ */

/* 1. Custom Properties */
:root {
  --color-bg-primary: #0a0a0a;
  --color-bg-secondary: #111111;
  --color-bg-tertiary: #1a1a1a;
  --color-bg-card: #141414;
  --color-bg-card-hover: #1e1e1e;

  --color-accent: #00cc6a;
  --color-accent-dim: #0C351D;
  --color-accent-hover: #00e676;
  --color-accent-glow: rgba(0, 204, 106, 0.15);

  --color-text-primary: #e8e8e8;
  --color-text-secondary: #a0a0a0;
  --color-text-muted: #666666;

  --color-border: #222222;
  --color-border-hover: #333333;

  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Consolas', 'Fira Code', monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 2rem;
  --fs-4xl: 2.5rem;
  --fs-5xl: 3.5rem;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-section: 6rem;

  --max-width: 1100px;
  --nav-height: 72px;
  --border-radius: 8px;
  --border-radius-lg: 12px;

  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 0 20px var(--color-accent-glow);
}

/* 2. Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  margin: 0;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-accent);
  color: var(--color-bg-primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius);
  font-weight: var(--fw-semibold);
  z-index: 9999;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-md);
}

/* 3. Typography */
h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.2;
  font-weight: var(--fw-bold);
}

p {
  margin: 0 0 var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

/* 4. Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-section) 0;
}

.section--alt {
  background: var(--color-bg-secondary);
}

.section__title {
  font-size: var(--fs-3xl);
  margin-bottom: var(--space-3xl);
  position: relative;
  display: inline-block;
}

.section__title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* 5. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
}

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

.btn--primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  box-shadow: var(--shadow-accent);
}

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

.btn--outline:hover {
  background: var(--color-accent-glow);
  border-color: var(--color-accent-hover);
  color: var(--color-accent-hover);
}

/* 6. Navigation */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-height);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition: border-color var(--transition-base), background var(--transition-base);
}

.nav--scrolled {
  border-bottom-color: var(--color-border);
  background: rgba(10, 10, 10, 0.95);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__logo {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--color-accent);
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

.nav__list {
  display: flex;
  gap: var(--space-xl);
}

.nav__link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
  position: relative;
  padding: var(--space-xs) 0;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

.nav__link:hover,
.nav__link--active {
  color: var(--color-text-primary);
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  z-index: 1001;
}

.nav__hamburger,
.nav__hamburger::before,
.nav__hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.nav__hamburger {
  position: relative;
}

.nav__hamburger::before,
.nav__hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.nav__hamburger::before { top: -7px; }
.nav__hamburger::after { top: 7px; }

/* Hamburger open state */
.nav__toggle[aria-expanded="true"] .nav__hamburger {
  background: transparent;
}

.nav__toggle[aria-expanded="true"] .nav__hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav__toggle[aria-expanded="true"] .nav__hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* 7. Hero */
.hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background:
    radial-gradient(ellipse at 50% 50%, var(--color-accent-glow) 0%, transparent 70%),
    var(--color-bg-primary);
  padding-top: var(--nav-height);
}

.hero__content {
  text-align: center;
}

.hero__greeting {
  font-size: var(--fs-lg);
  color: var(--color-accent);
  font-weight: var(--fw-medium);
  margin-bottom: var(--space-md);
  font-family: var(--font-mono);
}

.hero__name {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-lg);
  letter-spacing: -1px;
}

.hero__title {
  font-size: var(--fs-2xl);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  min-height: 2.4rem;
}

.typing-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--color-accent);
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero__location {
  font-size: var(--fs-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2xl);
}

.hero__cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* 8. About */
.about__content {
  max-width: 720px;
  font-size: var(--fs-lg);
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.about__content p {
  margin-bottom: var(--space-lg);
}

/* 9. Experience - Company Groups */
.company-group {
  margin-bottom: var(--space-3xl);
}

.company-group:last-child {
  margin-bottom: 0;
}

.company-group__header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.company-group__logo {
  flex-shrink: 0;
  width: 140px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.company-group__logo svg {
  width: 100%;
  height: 100%;
}

.company-group__name {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  margin: 0;
}

.company-group__meta {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin: var(--space-xs) 0 0;
}

.company-group__roles {
  position: relative;
  padding-left: 2rem;
}

.company-group__roles::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.role {
  position: relative;
  margin-bottom: var(--space-xl);
}

.role:last-child {
  margin-bottom: 0;
}

.role__dot {
  position: absolute;
  left: -2rem;
  top: var(--space-xs);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: var(--color-bg-primary);
  z-index: 1;
}

.section--alt .role__dot {
  background: var(--color-bg-secondary);
}

.role__content {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.role__content:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
}

.role__date {
  font-size: var(--fs-sm);
  color: var(--color-accent);
  font-weight: var(--fw-semibold);
  font-family: var(--font-mono);
}

.role__title {
  font-size: var(--fs-xl);
  margin: var(--space-sm) 0 var(--space-md);
}

.role__details {
  list-style: disc;
  padding-left: var(--space-lg);
  color: var(--color-text-secondary);
  font-size: var(--fs-base);
}

.role__details li {
  margin-bottom: var(--space-sm);
}

/* 9b. Education Timeline (reuses timeline pattern) */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline__item {
  position: relative;
  margin-bottom: var(--space-2xl);
}

.timeline__item:last-child {
  margin-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: -2rem;
  top: var(--space-lg);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: var(--color-bg-primary);
  z-index: 1;
}

.section--alt .timeline__dot {
  background: var(--color-bg-secondary);
}

.timeline__card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.timeline__card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
}

.timeline__date {
  font-size: var(--fs-sm);
  color: var(--color-accent);
  font-weight: var(--fw-semibold);
  font-family: var(--font-mono);
}

.timeline__role {
  font-size: var(--fs-xl);
  margin: var(--space-sm) 0;
}

.timeline__company {
  font-size: var(--fs-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.timeline__details {
  list-style: disc;
  padding-left: var(--space-lg);
  color: var(--color-text-secondary);
  font-size: var(--fs-base);
}

.timeline__details li {
  margin-bottom: var(--space-sm);
}

/* 10. Certifications */
.cert-group-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--color-text-secondary);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
}

.cert-group-title:first-of-type {
  margin-top: 0;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.cert-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  border-left: 3px solid var(--color-border);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.cert-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.cert-card--aws { border-left-color: #FF9900; }
.cert-card--microsoft { border-left-color: #00A4EF; }
.cert-card--google { border-left-color: #4285F4; }
.cert-card--linux { border-left-color: #FCC624; }
.cert-card--comptia { border-left-color: #C8202F; }
.cert-card--oracle { border-left-color: #F80000; }
.cert-card--docker { border-left-color: #2496ED; }
.cert-card--canonical { border-left-color: #E95420; }
.cert-card--finops { border-left-color: #00B388; }
.cert-card--anthropic { border-left-color: #D4A574; }
.cert-card--ai { border-left-color: #8B5CF6; }
.cert-card--github { border-left-color: #e8e8e8; }
.cert-card--cpanel { border-left-color: #FF6C2C; }
.cert-card--forage { border-left-color: #6366F1; }

.cert-card__provider {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.cert-card--aws .cert-card__provider { color: #FF9900; }
.cert-card--microsoft .cert-card__provider { color: #00A4EF; }
.cert-card--google .cert-card__provider { color: #4285F4; }
.cert-card--linux .cert-card__provider { color: #FCC624; }
.cert-card--comptia .cert-card__provider { color: #C8202F; }
.cert-card--oracle .cert-card__provider { color: #F80000; }
.cert-card--docker .cert-card__provider { color: #2496ED; }
.cert-card--canonical .cert-card__provider { color: #E95420; }
.cert-card--finops .cert-card__provider { color: #00B388; }
.cert-card--anthropic .cert-card__provider { color: #D4A574; }
.cert-card--ai .cert-card__provider { color: #8B5CF6; }
.cert-card--github .cert-card__provider { color: #e8e8e8; }
.cert-card--cpanel .cert-card__provider { color: #FF6C2C; }
.cert-card--forage .cert-card__provider { color: #6366F1; }

.cert-card__name {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-sm);
}

.cert-card__issuer {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* 11. Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-lg);
}

.skill-category {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  transition: border-color var(--transition-base);
}

.skill-category:hover {
  border-color: var(--color-border-hover);
}

.skill-category__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-md);
  color: var(--color-accent);
}

.skill-category__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.skill-tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--color-accent-dim);
  color: var(--color-text-primary);
  border-radius: 100px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  transition: background var(--transition-fast);
}

.skill-tag:hover {
  background: var(--color-accent-glow);
}

/* 12. Contact */
.contact {
  text-align: center;
}

.contact__text {
  font-size: var(--fs-lg);
  color: var(--color-text-secondary);
  max-width: 520px;
  margin: 0 auto var(--space-2xl);
}

.contact__links {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* 13. Footer */
.footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer__inner p {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.footer__built {
  font-size: var(--fs-xs);
}

/* 14. Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger grid children */
.cert-grid .reveal:nth-child(2),
.skills-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.cert-grid .reveal:nth-child(3),
.skills-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.cert-grid .reveal:nth-child(4),
.skills-grid .reveal:nth-child(4) { transition-delay: 0.3s; }
.cert-grid .reveal:nth-child(5),
.skills-grid .reveal:nth-child(5) { transition-delay: 0.4s; }
.cert-grid .reveal:nth-child(6),
.skills-grid .reveal:nth-child(6) { transition-delay: 0.5s; }
.cert-grid .reveal:nth-child(7),
.skills-grid .reveal:nth-child(7) { transition-delay: 0.6s; }
.cert-grid .reveal:nth-child(8),
.skills-grid .reveal:nth-child(8) { transition-delay: 0.7s; }

/* 15. Responsive */
@media (max-width: 768px) {
  :root {
    --space-section: 4rem;
  }

  .hero__name {
    font-size: var(--fs-3xl);
  }

  .hero__title {
    font-size: var(--fs-xl);
  }

  .section__title {
    font-size: var(--fs-2xl);
  }

  .nav__toggle {
    display: block;
  }

  .nav__menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-bg-secondary);
    padding: calc(var(--nav-height) + var(--space-xl)) var(--space-xl) var(--space-xl);
    transition: right var(--transition-base);
    border-left: 1px solid var(--color-border);
  }

  .nav__menu.nav-menu--open {
    right: 0;
  }

  .nav__list {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .nav__link {
    font-size: var(--fs-lg);
  }

  .about__content {
    font-size: var(--fs-base);
  }

  .container {
    padding: 0 var(--space-md);
  }

  .company-group__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .company-group__logo {
    width: 100px;
    height: 32px;
  }
}

@media (min-width: 1024px) {
  .company-group__roles {
    padding-left: 3rem;
  }

  .role__content {
    padding: var(--space-2xl);
  }

  .timeline {
    padding-left: 3rem;
  }

  .timeline__card {
    padding: var(--space-2xl);
  }
}

/* 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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Print */
@media print {
  .nav, .hero__cta, .contact__links, .footer { display: none; }
  body { background: white; color: black; }
  .section--alt { background: white; }
  .section { padding: 1rem 0; }
}
