:root {
  --lilac: #E5D9F2;
  --lilac-light: #ede6f7;
  --lilac-mid: #b8a5d8;
  --dark: #2f2f2f;
  --text: #3d3050;
  --white: #faf9fd;
}

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

body {
  background: var(--white);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
}

/* ── HEADER ── */
header {
  background: var(--lilac);
  position: relative;
  padding: 2.5rem 2rem 4.5rem;
  text-align: center;
  overflow: hidden;
}

header p svg {
  height: 4rem;
}

header p {
  font-size: 1rem;
  color: var(--text);
  margin-top: 0.4rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* wavy bottom */
header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 60px;
  background: var(--white);
  clip-path: ellipse(55% 100% at 50% 100%);
}

/* ── GRID ── */
main, .about-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.masonry {
  columns: 3 320px;
  column-gap: 28px;
}

.card {
  break-inside: avoid;
  margin-bottom: 28px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--white);
}

.media {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: var(--lilac-mid);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.media video {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

/* placeholder gradient when no real asset */
.media .placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--lilac) 0%, var(--lilac-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media .placeholder svg {
  width: 48px;
  opacity: 0.5;
}

/* overlay on hover */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(42,31,61,0.0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.play-btn {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), opacity 0.3s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.play-btn svg { margin-left: 4px; }

.card:hover .overlay { background: rgba(42,31,61,0.35); }
.card:hover .play-btn { transform: scale(1); opacity: 1; }
.card:hover .media img,
.card:hover .media video { transform: scale(1.05); }

/* card label */
.label {
  padding: 0.75rem 1rem 0.9rem;
  background: var(--white);
}

.label h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dark);
}

.label span {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2em 0.7em;
  border-radius: 99px;
  display: inline-block;
  margin-top: 0.3rem;
}

.label span.type-animation {
  background: #ede6f7;
  color: #7c5cbf;
}

.label span.type-video {
  background: #e0f2ee;
  color: #2d8a72;
}

/* ── INFO BAND ── */
.info-band {
  background: var(--lilac);
  position: relative;
  margin-top: 3rem;
  padding: 3.5rem 0 4.5rem;
  overflow: hidden;
}

/* subtle dot pattern */
.info-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.25) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* wavy top */
.info-band-top {
  position: absolute;
  top: -2px; left: 0;
  width: 100%;
  height: 60px;
  background: var(--white);
  clip-path: ellipse(55% 100% at 50% 0%);
}

/* wavy bottom */
.info-band-bottom {
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%;
  height: 60px;
  background: var(--white);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.info-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: start;
  position: relative;
  z-index: 1;
}

.info-inner h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  color: var(--dark);
  margin-bottom: 1.1rem;
}

.about-text p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
}

.about-text p + p { margin-top: 0.9rem; }

/* contact links */
.contact-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.8rem;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55em 1.1em;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--dark);
  color: var(--white);
}

.contact-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(42,31,61,0.22);
}

.contact-link.outline {
  background: transparent;
  color: var(--dark);
  border: 1.5px solid var(--dark);
}

.contact-link svg { flex-shrink: 0; }

/* software logos grid */
.software-col h2 { margin-bottom: 1.1rem; }

.logo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.logo-tile {
  background: rgba(255,255,255,0.55);
  border-radius: 12px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.7);
  transition: transform 0.2s, background 0.2s;
}

.logo-tile:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,0.8);
}

.logo-tile img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.logo-tile span {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--dark);
  text-align: center;
  letter-spacing: 0.03em;
}

/* divider */
.section-divider {
  max-width: 1100px;
  margin: 3.5rem auto 0;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  color: var(--dark);
  white-space: nowrap;
}

.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--lilac);
}

/* legend */
.legend {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
}

.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.legend-dot.animation { background: #7c5cbf; }
.legend-dot.video     { background: #2d8a72; }

/* footer */
footer {
  background: var(--dark);
  color: rgba(255,255,255,0.5);
  text-align: center;
  font-size: 0.8rem;
  padding: 1.5rem;
  margin-top: 4rem;
}

@media (max-width: 700px) {
  .info-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .logo-grid { grid-template-columns: repeat(4, 1fr); }
  .legend { display: none; }
  main { padding: 1.5rem 1rem 3rem; }
  .about-section { flex-direction: column; }
}

/* ── MODAL ── */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(22,14,38,0.75);
  backdrop-filter: blur(6px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-bg.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: 20px;
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: popIn 0.3s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}

@keyframes popIn {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.modal-media {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--dark);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}

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

.modal-media .placeholder-lg {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #4a3870 0%, #c9b8e8 100%);
  display: flex; align-items: center; justify-content: center;
}

.modal-body {
  padding: 1.5rem 2rem 2rem;
}

.modal-body h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
}

.modal-body .tag {
  display: inline-block;
  background: var(--lilac-light);
  color: var(--lilac-mid);
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25em 0.8em;
  border-radius: 99px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.modal-body .tag.type-animation {
  background: #ede6f7;
  color: #7c5cbf;
}

.modal-body .tag.type-video {
  background: #e0f2ee;
  color: #2d8a72;
}

.modal-body p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
}

.close-btn {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--white);
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  z-index: 10;
}

/* Stil til ikonerne */
.kvalifikationer svg {
  width: 45px;
  height: 45px;
  transition: transform 0.2s ease;
}

.kvalifikationer svg:hover {
  transform: scale(1.1);
}

/* About section */
.about-section {
  max-width: 1200px;
  margin: 3.5rem auto 0;
  padding: 0 2rem;
  display: flex;
  gap: 1.5rem;
  flex-direction: row;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .about-section { flex-direction: column; }
}

/* ── MOBILE ── */
@media (max-width: 600px) {
  .masonry { columns: 1; }
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: 20px 20px 0 0;
    max-height: 95vh;
    animation: slideUp 0.35s ease;
  }
  .modal-media { border-radius: 20px 20px 0 0; }
  @keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
}

.signature path {
  fill: transparent;
  stroke: #2f2f2f;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 3000;
  stroke-dashoffset: 3000;
  animation:
    draw 1.2s ease-out forwards,
    fill 0.2s ease-in 0.4s forwards;
}

/* Forskudte starttider — tættere bogstaver = hurtigere skrivning */
.signature path:nth-child(1) { animation-delay: 0s,    0.4s; }
.signature path:nth-child(2) { animation-delay: 0.25s, 0.65s; }
.signature path:nth-child(3) { animation-delay: 0.5s,  0.9s; }
.signature path:nth-child(4) { animation-delay: 0.75s, 1.15s; }
.signature path:nth-child(5) { animation-delay: 1.0s,  1.4s; }
.signature path:nth-child(6) { animation-delay: 1.25s, 1.65s; }
.signature path:nth-child(7) { animation-delay: 1.5s,  1.9s; }

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@keyframes fill {
  to { fill: #2f2f2f; }
}

.footer {
  background-color: #E5D9F2;
  padding: 20px;
  margin-top: 50px;
}

.social-icons {
  display: flex;
  gap: 5px;
  justify-content: flex-start;
}

.social-icons img {
  width: 27px;
  height: 28px;
  object-fit: contain;
}

.social-icon:hover {
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
