:root {
  --font-body: "Sen", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-logo: "Reem Kufi Fun", "Sen", sans-serif;
  --color-text: #1d1d1f;
  --color-heading: #132e53;
  --color-muted: #5f6b7d;
  --color-surface: #ffffff;
  --color-overlay: rgba(19, 46, 83, 0.78);
  --gradient-main: linear-gradient(to right, #132e53, #619cca, #76a5b6);
  --gradient-about: linear-gradient(to right, #c0651c, #f9b43b, #83c583);
  --shadow-card: 0 2px 12px rgba(19, 46, 83, 0.15);
  --shadow-soft: 0 2px 6px rgba(0, 0, 0, 0.12);
  --radius-large: 20px;
  --radius-medium: 12px;
  --layout-max-width: 1000px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--page-background, #fafafa);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.page-home {
  --page-background: #fafafa;
}

body.page-about,
body.page-project {
  --page-background: #f4f4f4;
}

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

img,
video {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: var(--font-body);
  color: var(--color-heading);
}

h2 {
  padding: 20px;
  font-size: 1.8rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page-content {
  flex: 1;
  width: min(100%, 1280px);
  margin: 0 auto;
}

/* Header */
[data-site-header] {
  background: var(--header-background, var(--gradient-main));
  color: #ffffff;
  padding: 1.1rem 1.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-soft);
}

.site-header__item {
  text-align: center;
}

.logo_gcorretge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: var(--font-logo);
  font-weight: 600;
  font-size: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 40px;
  padding: 6px 18px 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}

.logo_gcorretge i {
  font-size: 1.1rem;
}

.site-header__link {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-header__link:hover,
.site-header__link:focus-visible {
  opacity: 0.8;
  transform: translateY(-1px);
}

.site-header__link.is-active {
  text-decoration: underline;
  text-decoration-thickness: 0.15em;
  text-underline-offset: 6px;
}

.site-header__social {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
}

.site-header__social a {
  font-size: 1.2rem;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header__social a:hover,
.site-header__social a:focus-visible {
  transform: translateY(-2px);
  opacity: 0.85;
}

/* Home grid */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 0 24px 40px;
}

.grid-item {
  display: flex;
  justify-content: center;
  text-align: center;
}

.img-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-soft);
  width: 100%;
}

.img-container img {
  width: 100%;
  height: auto;
  transition: transform 0.35s ease;
}

.img-container:hover img {
  transform: scale(1.02);
}

.overlay {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
  color: #ffffff;
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
  text-align: center;
}

.img-container:hover .overlay,
.img-container:focus-within .overlay {
  opacity: 1;
}

.project-title {
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.4;
}

.see-more {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #132e53;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.scroll-top:hover,
.scroll-top:focus-visible {
  transform: translateY(-3px);
  opacity: 0.9;
}

.scroll-top.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Carousel */
.carousel {
  position: relative;
  width: 100%;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  border-radius: var(--radius-medium);
  overflow: hidden;
  background: #000000;
  box-shadow: var(--shadow-card);
}

.carousel--light {
  background: transparent;
}

.carousel--fullheight {
  height: clamp(320px, 65vh, 520px);
}

.carousel--fullheight .carousel-track,
.carousel--fullheight .carousel-slide {
  height: 100%;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.carousel--light .carousel-slide {
  background: transparent;
}

.carousel-slide img,
.carousel-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel--autosize .carousel-slide img,
.carousel--autosize .carousel-slide video {
  width: auto;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}

.carousel-buttons {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  padding: 0 12px;
}

.carousel-buttons button {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: none;
  font-size: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.carousel-buttons button:hover,
.carousel-buttons button:focus-visible {
  background: rgba(0, 0, 0, 0.85);
  transform: translateY(-2px);
}

.carousel-buttons button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.carousel-description {
  max-width: var(--layout-max-width);
  margin: 32px auto 48px;
  padding: 24px;
  background: var(--color-surface);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
}

.carousel-description h3 {
  font-size: 1.35rem;
  margin-bottom: 12px;
}

.carousel-description p {
  color: var(--color-muted);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #132e53;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 1rem;
  margin-top: 24px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.back-button:hover,
.back-button:focus-visible {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* About page */
.about-card {
  max-width: var(--layout-max-width);
  margin: 32px auto 64px;
  background: var(--color-surface);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.about-card__inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px;
}

.about-card__sidebar {
  text-align: center;
}

.about-card__sidebar img {
  width: 220px;
  height: 290px;
  border-radius: 8%;
  object-fit: cover;
  margin: 0 0 20px;
  box-shadow: var(--shadow-soft);
}

.about-card__sidebar ul {
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  text-align: left;
}

.about-card__sidebar a {
  color: var(--color-heading);
  font-weight: 600;
}

.about-card__content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-card__content p {
  font-size: 1rem;
  color: var(--color-text);
}

.about-card__group h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.about-card__group ul {
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--color-muted);
}

@media (max-width: 640px) {
  .grid {
    padding: 0 16px 32px;
  }

  .scroll-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }

  h2 {
    font-size: 1.5rem;
    padding: 16px;
  }
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1040px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 720px) {
  .about-card__inner {
    flex-direction: row;
    align-items: flex-start;
  }

  .about-card__sidebar {
    flex: 1;
  }

  .about-card__content {
    flex: 2;
  }
}
