/* =========================================================
   Joseph Johnson - Portfolio
   ========================================================= */

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

:root {
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --text: #1e293b;
  --muted: #64748b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e5e9f0;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.12);
  --radius: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Hero ---------- */
.hero {
  padding: 5rem 0;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 3.5rem;
}

.hero-text {
  flex: 1;
}

.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.hero-text h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.lead {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 480px;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-photo {
  flex-shrink: 0;
}

.photo-placeholder,
.hero-photo img {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid #fff;
  box-shadow: var(--shadow);
}

.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8edf7;
  color: var(--accent);
  font-size: 4rem;
  font-weight: 800;
}

/* ---------- Sections ---------- */
.section {
  padding: 5rem 0;
}

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

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.section-sub {
  text-align: center;
  color: var(--muted);
  margin-top: 0.75rem;
  margin-bottom: 3rem;
}

.section-title + .about-text,
.section-title + .skills-grid,
.section-title:last-child {
  margin-top: 3rem;
}

/* ---------- About ---------- */
.about-text {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.about-text p {
  color: var(--muted);
  margin-bottom: 1.1rem;
}

/* ---------- Skills / Tech stack ---------- */
.tech-cats {
  max-width: 860px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tech-cat {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.4rem 2rem;
}

.tech-cat + .tech-cat {
  border-top: 1px solid var(--border);
}

.tech-cat-label {
  flex: 0 0 140px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  letter-spacing: -0.01em;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  flex: 1;
}

.tech {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 62px;
  transition: transform 0.15s ease;
}

.tech:hover {
  transform: translateY(-4px);
}

.tech img {
  height: 38px;
  width: auto;
  max-width: 62px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(15, 23, 42, 0.12));
}

.tech span {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 620px) {
  .tech-cat {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.25rem;
  }
  .tech-cat-label {
    flex: none;
    text-align: left;
  }
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.project-thumb {
  height: 160px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Two-image cross-fade slideshow */
.project-thumb.slideshow {
  position: relative;
}

.slideshow img {
  position: absolute;
  inset: 0;
}

.slideshow img:nth-of-type(2) {
  animation: slideshow-swap 7s ease-in-out infinite;
}

@keyframes slideshow-swap {
  0%, 42% { opacity: 1; }
  50%, 92% { opacity: 0; }
  100% { opacity: 1; }
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.5rem;
}

.project-body h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.project-body p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.project-tags span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
  align-self: flex-start;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: #24292e;
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.2s ease;
}

.project-link:hover {
  background: #000;
  color: #fff;
}

.project-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

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

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 2rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, transform 0.15s;
}

.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
}

.connect-cta {
  margin-top: 1.75rem;
  text-align: center;
}

/* ---------- Experience timeline ---------- */
.timeline {
  max-width: 660px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 1.25rem;
  padding-bottom: 2rem;
}

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

.timeline-logo {
  position: relative;
  z-index: 1;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--accent);
}

.timeline-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-content {
  flex: 1;
  padding-top: 1px;
}

.timeline-date {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.timeline-role {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.timeline-company {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.timeline-place {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.timeline-desc {
  color: var(--muted);
  font-size: 0.93rem;
}

/* ---------- Footer ---------- */
.footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .nav-links {
    gap: 1.25rem;
  }
  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
    gap: 2.5rem;
  }
  .hero-text h1 {
    font-size: 2.4rem;
  }
  .lead {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .nav-links {
    display: none;
  }
  .photo-placeholder,
  .hero-photo img {
    width: 190px;
    height: 190px;
  }
  .hero-text h1 {
    font-size: 2rem;
  }
}
