/* Updated: 2026-09-29 23:50 (Europe/Zurich) */
/* leolepori.ch, business card stylesheet (mobile first, two columns from 768px, light and dark) */

/* Oswald, self-hosted (SIL Open Font License, see fonts/OFL.txt) */
@font-face {
  font-family: "Oswald";
  src: url("fonts/oswald-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Oswald";
  src: url("fonts/oswald-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-1: #eef2f5;
  --bg-2: #f7efe9;
  --card: #fff;
  --glass: rgba(255, 255, 255, .8);
  --veil: rgba(244, 245, 247, .55); /* tint over the blurred photo backdrop */
  --text: #757575;
  --link: #212121;
  --accent: #d0213a; /* red of the shorts in leo.jpg */
  --accent-soft: rgba(208, 33, 58, .1);
  --hover: rgba(114, 115, 122, .1); /* hover row: grey of the hoodie in leo_2.jpg, translucent */
  --hover-icon: #72737a;
  --rule: rgba(0, 0, 0, .08);
  --tip-bg: #212121;
  --tip-text: #fff;
  --shadow: 0 2px 6px rgba(0, 0, 0, .06), 0 18px 48px rgba(30, 40, 60, .16);
  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font-display: "Oswald", "Arial Narrow", "Roboto Condensed", sans-serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-1: #101315;
    --bg-2: #1a1618;
    --card: #1d2023;
    --glass: rgba(29, 32, 35, .72);
    --veil: rgba(12, 14, 16, .6);
    --text: #a4abb1;
    --link: #eceff1;
    --accent: #ef5a6b;
    --accent-soft: rgba(239, 90, 107, .16);
    --hover: rgba(160, 162, 170, .12);
    --hover-icon: #8a8c94;
    --rule: rgba(255, 255, 255, .08);
    --tip-bg: #eceff1;
    --tip-text: #1d2023;
    --shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 18px 48px rgba(0, 0, 0, .5);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: grid;
  place-items: center;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px 12px;
  padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 100%) fixed;
  color: var(--text);
  font: 15px/1.5 Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* Film grain, above the backdrop and below the card */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: var(--grain);
  opacity: .35;
  pointer-events: none;
}

/* Blurred photo backdrop (layers added by script.js, one per slide) */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.backdrop__layer {
  position: absolute;
  inset: -80px;
  background: center / cover no-repeat;
  filter: blur(40px) saturate(1.3);
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 1.2s ease-in-out;
  will-change: opacity;
}

.backdrop__layer.is-active {
  opacity: 1;
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--veil);
}

/* Card */
.card {
  width: 100%;
  max-width: 444px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  /* Safari: keep rounded corners clipped during transforms */
  isolation: isolate;
}

/* Photo with name overlay */
.card__header {
  position: relative;
  margin: 0;
  overflow: hidden;
}

.card__header picture {
  display: block;
  height: 100%;
}

.card__header img {
  display: block;
  width: 100%;
  height: auto;
}

/* Slideshow: the first slide stays in flow and sets the height, the others fade in above it with a soft blur */
.slide {
  transform: scale(1);
}

.slide.is-zoom {
  transform: scale(1.06);
  transition: transform 7s linear;
}

.slide + .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  filter: blur(12px);
  transition: opacity 1.2s ease-in-out, filter 1.2s ease-in-out;
}

.slide + .slide.is-zoom {
  transition: opacity 1.2s ease-in-out, filter 1.2s ease-in-out, transform 7s linear;
}

.slide + .slide img {
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

.slide.is-active {
  opacity: 1;
  filter: none;
}

.card__header::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: 55%;
  background: linear-gradient(to top, rgba(0, 0, 0, .6), transparent);
  pointer-events: none;
}

/* Name: first name large, last name in spaced capitals, red rule underneath */
.card__name {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0;
  margin: 0;
  padding: 16px 20px 18px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

.card__first,
.card__last {
  display: block;
}

.card__first {
  font-size: 44px;
  font-size: clamp(36px, 11vw, 46px);
  font-weight: 500;
  letter-spacing: .02em;
}

.card__last {
  margin-top: 6px;
  font-size: 16px;
  letter-spacing: .24em;
  opacity: .92;
}

.card__name::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: 12px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: left;
}

/* Photo indicators (added by script.js) */
.dots {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 14px;
  display: flex;
}

.dots button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.dots button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .5);
  transition: width .3s var(--ease), background-color .3s;
}

.dots button[aria-current="true"]::before {
  width: 20px;
  background: #fff;
}

.dots button:hover::before {
  background: #fff;
}

.dots button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
  border-radius: 6px;
}

/* Contact list */
.card__body {
  padding: 14px 20px 20px;
  font-style: normal;
}

.contact,
.social {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact li {
  margin: 2px 0;
}

.contact a {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 -10px;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--link);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color .2s, transform .2s var(--ease);
}

.contact a:hover {
  background: var(--hover);
}

.contact a:active,
.social a:active {
  transform: scale(.96);
}

.contact a:focus-visible,
.social a:focus-visible,
.save:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: background-color .2s, color .2s;
}

.contact a:hover .icon,
.social a:hover .icon {
  background: var(--hover-icon);
  color: #fff;
}

.card__body hr {
  margin: 12px 0 14px;
  border: 0;
  border-top: 1px solid var(--rule);
}

/* Social icons in a row, label shown as a tooltip */
.social {
  display: flex;
  gap: 10px;
}

.social a {
  position: relative;
  display: block;
  border-radius: 50%;
  transition: transform .2s var(--ease);
}

.social .icon {
  width: 44px;
  height: 44px;
  padding: 11px;
}

.tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--tip-bg);
  color: var(--tip-text);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s, transform .2s var(--ease);
  pointer-events: none;
}

.social a:hover .tip,
.social a:focus-visible .tip {
  opacity: 1;
  transform: none;
}

/* Add to contacts (vCard) */
.save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color .2s, transform .2s var(--ease);
}

.save:hover {
  background: var(--hover-icon);
}

.save:active {
  transform: scale(.98);
}

.save .icon {
  width: 22px;
  height: 22px;
  padding: 0;
  background: none;
  color: inherit;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Desktop: photo left, contacts right, frosted glass card */
@media (min-width: 768px) {
  body {
    padding: 32px;
    font-size: 16px;
  }

  .card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 880px;
  }

  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .card {
      background: var(--glass);
      -webkit-backdrop-filter: blur(24px) saturate(1.4);
      backdrop-filter: blur(24px) saturate(1.4);
    }
  }

  .card__header img {
    height: 100%;
    object-fit: cover;
    object-position: 0 50%;
  }

  .card__header .slide + .slide img {
    object-position: 50% 50%;
  }

  .card__name {
    padding: 24px 28px 26px;
  }

  .card__first {
    font-size: 56px;
  }

  .card__last {
    font-size: 18px;
  }

  .dots {
    right: 18px;
    bottom: 22px;
  }

  .card__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 48px;
  }

  .contact li {
    margin: 4px 0;
  }

  .card__body hr {
    margin: 16px 0 18px;
  }

  .save {
    align-self: flex-start;
    margin-top: 22px;
    padding: 11px 22px;
  }
}

@media (min-width: 1200px) {
  .card {
    max-width: 960px;
  }
}

/* Entrance animation (classes set by the inline script and script.js) */
.js .card {
  opacity: 0;
  transform: translateY(24px) scale(.98);
}

.js .card__header img {
  transform: scale(1.12);
}

.js .card__name,
.js .contact li,
.js .social li,
.js .save {
  opacity: 0;
}

.js .card__name {
  transform: translateY(12px);
}

.js .card__name::after {
  transform: scaleX(0);
}

.js .contact li,
.js .social li,
.js .save {
  transform: translateX(-12px);
}

.js .card__body hr {
  transform: scaleX(0);
  transform-origin: left;
}

.is-ready .card {
  opacity: 1;
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

.is-ready .card.is-tilt {
  transition: transform .25s ease-out;
}

.is-ready .card__header img {
  transform: none;
  transition: transform 1.6s var(--ease);
}

.is-ready .card__name {
  opacity: 1;
  transform: none;
  transition: opacity .7s var(--ease) .35s, transform .7s var(--ease) .35s;
}

.is-ready .card__name::after {
  transform: none;
  transition: transform .7s var(--ease) .9s;
}

.is-ready .contact li,
.is-ready .social li,
.is-ready .save {
  opacity: 1;
  transform: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease), background-color .2s;
  transition-delay: calc(.45s + var(--i, 0) * 70ms), calc(.45s + var(--i, 0) * 70ms), 0s;
}

.is-ready .card__body hr {
  transform: none;
  transition: transform .8s var(--ease) .6s;
}

/* After the entrance: no more stagger delay on the button press */
.is-done .save {
  transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  body {
    display: block;
    background: none;
    padding: 0;
  }

  body::before,
  .backdrop,
  .dots,
  .save {
    display: none;
  }

  .card {
    box-shadow: none;
  }
}
