/* ==========================================================================
   Julian Ruocco Portfolio — inspired by zemichaelgebeyehu.com layout
   ========================================================================== */

:root {
  --color-white: #ffffff;
  --color-bg: #f8f9fb;
  --color-sidebar: #d1e4ff;
  --color-accent: #0056d2;
  --color-accent-hover: #0044a8;
  --color-text: #1a1a1a;
  --color-text-muted: #555555;
  --color-border: #e0e0e0;
  --font-main: "Montserrat", "Segoe UI", Helvetica, Arial, sans-serif;
  --max-width: 1100px;
  --header-height: 72px;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-white);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* -------------------------------------------------------------------------- */
/* Header                                                                     */
/* -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand:hover {
  text-decoration: none;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: var(--color-border);
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.site-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* -------------------------------------------------------------------------- */
/* Hero carousel                                                              */
/* -------------------------------------------------------------------------- */

.hero-carousel {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  margin: 1.5rem auto 0;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 16 / 7;
  background: #2a3f5f;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slide-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e3a5f 0%, #4a7ab8 100%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 3rem;
  color: var(--color-white);
}

.hero-overlay h2 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  font-style: italic;
  line-height: 1.1;
  color: #c8e64a;
}

.hero-overlay p {
  margin: 0.35rem 0 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.btn-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(135deg, #c47a2c, #e8a045);
  color: var(--color-white);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  width: fit-content;
}

.btn-read-more:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn.prev {
  left: 1rem;
}

.carousel-btn.next {
  right: 1rem;
}

.carousel-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  padding: 0;
}

.carousel-dot.active {
  background: var(--color-white);
}

/* -------------------------------------------------------------------------- */
/* About section                                                              */
/* -------------------------------------------------------------------------- */

.about-section {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  margin-top: 2.5rem;
  min-height: 420px;
}

.about-sidebar {
  background: var(--color-sidebar);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-photo-wrap {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--color-white);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  background: #b8cfe8;
}

.profile-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.sidebar-divider {
  width: 40px;
  height: 2px;
  background: var(--color-text);
  margin: 0.5rem auto 0.75rem;
}

.sidebar-title {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0;
}

.about-content {
  padding: 2rem 2.5rem;
}

.about-content h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin: 0 0 1.25rem;
  line-height: 1;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.btn-primary,
.btn-outline {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--color-accent-hover);
  text-decoration: none;
}

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

.btn-outline:hover {
  background: var(--color-text);
  color: var(--color-white);
  text-decoration: none;
}

.about-bio p {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  max-width: 620px;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-links a {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* -------------------------------------------------------------------------- */
/* Section blocks                                                             */
/* -------------------------------------------------------------------------- */

.section {
  padding: 4rem 0;
}

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

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
}

.section-header p {
  margin: 0;
  color: var(--color-text-muted);
}

/* Education */
.education-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
}

.education-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.education-card .school {
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.education-card ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--color-text-muted);
}

/* Skills grid */
.skills-group {
  margin-bottom: 2rem;
}

.skills-group h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
}

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

.skill-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.section-alt .skill-item {
  background: var(--color-white);
}

/* Experience cards */
.experience-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.experience-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.experience-logo {
  width: 120px;
  height: 120px;
  border-radius: var(--radius);
  object-fit: contain;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.experience-logo.hidden {
  display: none;
}

.experience-org {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}

.experience-role {
  font-weight: 600;
  margin: 0.15rem 0;
}

.experience-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
}

.experience-card ul {
  margin: 0.75rem 0;
  padding-left: 1.25rem;
  color: var(--color-text-muted);
}

.experience-card li {
  margin-bottom: 0.35rem;
}

.top-skills {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.top-skills strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

/* -------------------------------------------------------------------------- */
/* Projects page                                                              */
/* -------------------------------------------------------------------------- */

.page-hero {
  padding: 3rem 0 1rem;
}

.page-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
}

.page-hero p {
  color: var(--color-text-muted);
  max-width: 680px;
  margin: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0 4rem;
}

.project-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
}

.project-thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #d1e4ff, #a8c8f0);
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.project-body h2 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.project-body p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* -------------------------------------------------------------------------- */
/* Research page                                                              */
/* -------------------------------------------------------------------------- */

.research-hero-image {
  width: 100%;
  max-width: var(--max-width);
  margin: 1.5rem auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 21 / 8;
  background: linear-gradient(135deg, #1e3a5f, #4a7ab8);
}

.research-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.research-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

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

.research-item.reverse {
  direction: rtl;
}

.research-item.reverse > * {
  direction: ltr;
}

.research-item-image {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--color-sidebar);
}

.research-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.research-item-text h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
}

.research-item-text p,
.research-item-text ul {
  color: var(--color-text-muted);
}

/* -------------------------------------------------------------------------- */
/* Coursework page                                                            */
/* -------------------------------------------------------------------------- */

.course-list {
  display: grid;
  gap: 1rem;
  padding: 2rem 0 4rem;
}

.course-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.course-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.course-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* -------------------------------------------------------------------------- */
/* Contact page                                                               */
/* -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding: 2rem 0 4rem;
}

.contact-info h2 {
  margin: 0 0 1rem;
}

.contact-detail {
  margin-bottom: 1rem;
}

.contact-detail strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}

.contact-detail a {
  font-size: 1.05rem;
  font-weight: 600;
}

.contact-form {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 2rem;
}

.contact-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form button {
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.contact-form button:hover {
  background: var(--color-accent-hover);
}

.contact-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.75rem;
}

/* -------------------------------------------------------------------------- */
/* Footer                                                                     */
/* -------------------------------------------------------------------------- */

.site-footer {
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.75);
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-social {
  display: flex;
  gap: 1.25rem;
}

.footer-social a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-social a:hover {
  color: var(--color-white);
}

/* -------------------------------------------------------------------------- */
/* Image placeholder helper (shown when file missing)                         */
/* -------------------------------------------------------------------------- */

.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: repeating-linear-gradient(
    -45deg,
    #d1e4ff,
    #d1e4ff 10px,
    #b8cfe8 10px,
    #b8cfe8 20px
  );
  color: #2a5080;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem;
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .about-section {
    grid-template-columns: 1fr;
  }

  .about-sidebar {
    padding: 2rem;
  }

  .about-content {
    padding: 2rem 1.5rem;
  }

  .research-item,
  .research-item.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }

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

@media (max-width: 768px) {
  .brand-subtitle {
    display: none;
  }

  .brand-divider {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem;
  }

  .site-nav.open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.75rem;
  }

  .header-inner {
    position: relative;
  }

  .hero-overlay {
    padding: 1.5rem;
  }

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