:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #1f2433;
  --muted: #5f6880;
  --line: #dfe5f0;
  --header: #1f2534;
  --accent: #2f59d9;

  --pink: #d94a8b;
  --mint: #1f9f88;
  --orange: #df8d2f;
  --blue: #3557cb;
  --purple: #6951d1;
  --green: #2f9d4a;
  --darkorange: #c96b24;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-shape { display: none; }

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header.shrink { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25); }

.header-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 1.35rem 1.5rem 1.45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
  text-align: center;
}

.header-title {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 800;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

nav a {
  text-decoration: none;
  color: #f8faff;
  font-size: 1.02rem;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: 0;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

nav a.active {
  background: #ffffff;
  color: #1f2534;
  border-color: #ffffff;
}

main {
  max-width: 1260px;
  margin: 0 auto;
  padding: 10.2rem 1.5rem 3rem;
}

.content-section { padding: 2rem 0 3rem; }
.content-section[hidden] { display: none !important; }

h2 {
  text-align: center;
  font-size: clamp(2rem, 2.5vw, 2.6rem);
  margin: 0.5rem 0 1.75rem;
}

.about-container,
.contact-container,
.modal-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 10px 26px rgba(18, 26, 44, 0.08);
}

.about-container {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: minmax(320px, 450px) 1fr;
  gap: 1.5rem;
  align-items: center;
}

.about-image img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  border-radius: 0;
}

.about-text {
  font-size: 1.16rem;
  line-height: 1.85;
}

.about-text p { margin-bottom: 1rem; }

.accent { font-weight: 800; }
.accent-pink { color: var(--pink); }
.accent-mint { color: var(--mint); }
.accent-orange { color: var(--orange); }
.accent-blue { color: var(--blue); }
.accent-red { color: #cf4a4a; }
.accent-purple { color: var(--purple); }
.accent-green { color: var(--green); }
.accent-darkorange { color: var(--darkorange); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 1.2rem;
}

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

.skills-container.grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tile {
  min-height: 185px;
  border-radius: 0;
  padding: 1.2rem;
  display: flex;
  align-items: flex-end;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(16, 20, 34, 0.14);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile-inner {
  min-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
}

.tile-copy {
  align-self: flex-end;
  max-width: 82%;
  text-align: right;
}

.tile-inner span {
  display: block;
  margin-bottom: 0.25rem;
  color: #ffffff;
  font-size: clamp(1.15rem, 1.5vw, 1.42rem);
  font-weight: 800;
  line-height: 1.05;
}

.tile-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 1.05rem;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(16, 20, 34, 0.16);
}

.tile-inner h3 {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.skill-tile {
  min-height: 185px;
  align-items: center;
}

.skill-tile-inner {
  width: 100%;
}

.skill-tile h3 {
  color: #fff;
  font-size: clamp(1.2rem, 1.6vw, 1.55rem);
  font-weight: 800;
  line-height: 1.08;
}

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  padding: 1.5rem;
}

.contact-info { color: var(--muted); line-height: 1.8; font-size: 1.06rem; }
.contact-info p { color: var(--text); font-weight: 600; margin-bottom: 0.75rem; font-size: 1.1rem; }
.contact-info ul { list-style: none; }
.contact-info li { margin: 0.65rem 0; }
.contact-info a { color: var(--accent); text-decoration: none; font-weight: 700; }

.contact-map iframe {
  width: 100%;
  min-height: 360px;
  border: 0;
  border-radius: 0;
}

.dynamic-project-details {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 20, 33, 0.65);
  padding: 1rem;
  z-index: 2000;
}

.dynamic-project-details.hidden { display: none; }

.modal-content {
  width: min(860px, 95vw);
  padding: 1.4rem;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}

.project-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  object-position: top center;
  background: #f4f6fa;
  border: 1px solid var(--line);
  border-radius: 0;
  margin-bottom: 1rem;
}

.project-title { font-size: 1.55rem; margin-bottom: 0.5rem; }
.project-description { color: var(--muted); line-height: 1.72; margin-bottom: 1.1rem; font-size: 1.06rem; }

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
}

.project-link,
.close-btn {
  border: none;
  border-radius: 0;
  padding: 0.72rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.98rem;
}

.project-link {
  display: inline-flex;
  align-self: flex-start;
  text-decoration: none;
  background: #2f9d4a;
  color: #fff;
}

.project-link:hover { background: #27823d; }
.project-link[aria-disabled] {
  pointer-events: none;
  background: #9aa5b8;
}

.close-btn {
  background: #cf4a4a;
  color: #ffffff;
}

.close-btn:hover { background: #b83d3d; }

@media (max-width: 900px) {
  main { padding-top: 9.6rem; }
  .about-container { grid-template-columns: 1fr; }
  .contact-container { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-title { font-size: 1.22rem; }
  nav a { font-size: 0.92rem; padding: 0.42rem 0.78rem; }

  main {
    padding-top: 9.3rem;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects-container.grid,
  .skills-container.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { min-height: 145px; }
  .about-text { font-size: 1.02rem; }
}
