:root {
  --ink: #14171a;
  --muted: #62686f;
  --soft: #eef1eb;
  --line: #dce1d8;
  --paper: #f7f8f3;
  --surface: #ffffff;
  --dark: #101214;
  --dark-2: #1b1f22;
  --accent: #c3f451;
  --accent-2: #7fa625;
  --shadow: 0 18px 45px rgba(20, 23, 26, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

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

button {
  color: inherit;
  font: inherit;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 4px;
}

.topbar {
  align-items: center;
  background: rgba(247, 248, 243, 0.88);
  border-bottom: 1px solid rgba(220, 225, 216, 0.78);
  display: flex;
  gap: 24px;
  min-height: 78px;
  padding: 18px clamp(18px, 4vw, 58px);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.wordmark {
  align-items: center;
  background: var(--dark);
  border-radius: 8px;
  color: #fff;
  display: grid;
  font-size: 28px;
  font-weight: 800;
  height: 46px;
  line-height: 1;
  place-items: center;
  width: 46px;
}

.wordmark span {
  color: var(--accent);
}

.top-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 18px;
  margin-left: auto;
}

.top-actions a,
.back-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: color 0.2s ease, transform 0.2s ease;
}

.top-actions a:hover,
.back-link:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.top-actions .contact-link {
  background: var(--dark);
  border-radius: 999px;
  color: #fff;
  padding: 10px 16px;
}

.top-actions .contact-link:hover {
  background: #2a2f34;
  color: #fff;
}

.hero {
  background:
    linear-gradient(115deg, rgba(16, 18, 20, 0.96), rgba(16, 18, 20, 0.88)),
    url("assets/camaras-epplus.png") center / cover;
  border-radius: var(--radius);
  color: #fff;
  display: grid;
  gap: clamp(24px, 5vw, 64px);
  grid-template-columns: 1.05fr 0.95fr;
  margin: 22px auto 0;
  max-width: 1440px;
  min-height: 570px;
  overflow: hidden;
  padding: clamp(28px, 5vw, 70px);
  position: relative;
  width: calc(100% - 36px);
}

.hero::after {
  background: linear-gradient(90deg, rgba(195, 244, 81, 0.22), transparent 52%);
  bottom: 0;
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
}

.hero-copy {
  align-self: center;
  max-width: 720px;
}

.eyebrow,
.section-kicker {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 14px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1;
  margin-bottom: 22px;
}

.hero-text {
  color: #d8dde0;
  font-size: clamp(17px, 2vw, 22px);
  max-width: 640px;
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-action,
.secondary-action {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 15px;
  font-weight: 800;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-action {
  background: var(--accent);
  color: var(--ink);
}

.secondary-action {
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-2px);
}

.primary-action:hover {
  background: #d4ff70;
}

.secondary-action:hover {
  border-color: rgba(255, 255, 255, 0.48);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.hero-stats span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: #d8dde0;
  padding: 9px 13px;
}

.hero-stats strong {
  color: #fff;
  margin-right: 5px;
}

.hero-visual {
  align-self: center;
  display: grid;
  gap: 16px;
}

.profile-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  display: flex;
  gap: 14px;
  padding: 12px;
}

.profile-card img {
  border-radius: var(--radius);
  height: 72px;
  object-fit: cover;
  object-position: center 26%;
  width: 72px;
}

.profile-card strong,
.profile-card span {
  display: block;
}

.profile-card span {
  color: #cdd3d6;
  font-size: 14px;
}

.preview-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-grid img {
  aspect-ratio: 4 / 5;
  background: #0b0d0f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.projects {
  margin: 0 auto;
  max-width: 1440px;
  padding: clamp(44px, 7vw, 86px) clamp(18px, 4vw, 58px) 72px;
}

.section-head {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-head h2,
.detail h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  margin-bottom: 0;
}

.section-note {
  color: var(--muted);
  margin-bottom: 4px;
  max-width: 300px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.filter-button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 16px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.filter-button:hover {
  transform: translateY(-1px);
}

.filter-button[aria-pressed="true"] {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

.project-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
  border-color: #c8d0c1;
  box-shadow: var(--shadow);
  transform: translateY(-5px);
}

.project-card[hidden] {
  display: none;
}

.thumbnail {
  align-items: center;
  aspect-ratio: 4 / 5;
  background:
    linear-gradient(145deg, rgba(16, 18, 20, 0.95), rgba(37, 43, 46, 0.95));
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  position: relative;
}

.thumbnail img {
  border-radius: 6px;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease;
  width: 100%;
}

.project-card:hover .thumbnail img {
  transform: scale(1.03);
}

.view-cue {
  background: var(--accent);
  border-radius: 999px;
  bottom: 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
  position: absolute;
  right: 12px;
}

.card-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
}

.category-badge {
  align-self: flex-start;
  background: var(--soft);
  border-radius: 999px;
  color: #3e464c;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.card-info h3 {
  font-size: 18px;
  line-height: 1.2;
  margin-bottom: 0;
}

.card-info p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0 auto;
  max-width: 1440px;
  padding: 28px clamp(18px, 4vw, 58px);
}

.footer-name {
  color: var(--ink);
  font-weight: 900;
  margin-right: auto;
}

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

.detail {
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 48px) 70px;
}

.detail-heading {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.detail-summary {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 0;
  max-width: 780px;
}

.detail-heading .tag-list {
  justify-content: flex-end;
  margin-top: 0;
  min-width: 220px;
}

.detail-visual {
  background: var(--dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: clamp(10px, 2vw, 18px);
}

.image-button {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  padding: 0;
  width: 100%;
}

.detail-visual img {
  background: #0b0d0f;
  border-radius: 6px;
  margin: 0 auto;
  max-height: 82vh;
  object-fit: contain;
  width: auto;
}

.detail-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 24px;
  padding: clamp(18px, 3vw, 28px);
}

.detail-panel h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

.detail-panel p {
  color: var(--muted);
  font-size: 17px;
  margin-bottom: 0;
  max-width: 840px;
}

.detail .secondary-action {
  border-color: var(--line);
  color: var(--ink);
}

.project-navigation {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 34px;
  padding-top: 20px;
}

.project-navigation a {
  color: var(--muted);
  font-weight: 900;
}

.project-navigation a:hover {
  color: var(--ink);
}

dialog {
  background: #0c0d0f;
  border: 0;
  border-radius: var(--radius);
  max-height: 94vh;
  max-width: 94vw;
  padding: 48px 14px 14px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.82);
}

dialog img {
  max-height: 82vh;
  object-fit: contain;
}

.close-viewer {
  background: #252a2e;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  height: 34px;
  position: absolute;
  right: 12px;
  top: 10px;
  width: 34px;
}

@media (max-width: 1180px) {
  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .top-actions {
    flex-basis: 100%;
    justify-content: flex-start;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual {
    order: -1;
  }

  .preview-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .section-head,
  .detail-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-heading .tag-list {
    justify-content: flex-start;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 14px;
    min-height: 70px;
  }

  .top-label {
    font-size: 12px;
  }

  .top-actions {
    gap: 12px;
  }

  .top-actions a:not(.contact-link) {
    font-size: 13px;
  }

  .hero {
    margin-top: 12px;
    padding: 22px;
    width: calc(100% - 20px);
  }

  h1 {
    font-size: clamp(34px, 12vw, 52px);
  }

  .preview-grid {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-stats span {
    width: 100%;
  }

  .projects {
    padding-left: 12px;
    padding-right: 12px;
  }

  .project-grid {
    gap: 14px;
  }

  .card-info {
    padding: 12px;
  }

  .card-info h3 {
    font-size: 15px;
  }

  .card-info p,
  .tag-list {
    display: none;
  }

  .thumbnail {
    padding: 6px;
  }

  .project-navigation {
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
