:root {
  color-scheme: light dark;
  --background: light-dark(#f7f8f3, #151a17);
  --glow: light-dark(#e8efdb, #242e22);
  --surface: light-dark(#fff, #1e2521);
  --surface-hover: light-dark(#f1f5e9, #29332b);
  --text: light-dark(#222a24, #f2f5ec);
  --muted: light-dark(#526058, #b3beb3);
  --border: light-dark(#d8e0d4, #3c493e);
  --accent: light-dark(#d9ebbd, #c9e5a4);
  --on-accent: #202923;
  --icon-bg: light-dark(#e9f0e2, #324037);
  --icon-fg: light-dark(#33513b, #d5e7cf);
  --focus: light-dark(#476635, #c9e5a4);
  --radius: 0.9rem;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--background);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

[hidden], :root[lang="en"] [data-lang="cs"], :root[lang="cs"] [data-lang="en"] {
  display: none !important;
}

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

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: radial-gradient(ellipse 32rem 24rem at 50% 0, var(--glow), transparent);
  line-height: 1.5;
}

button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

svg { display: block; width: 1.25rem; height: 1.25rem; flex: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page {
  width: min(100% - 2.5rem, 28rem);
  margin: clamp(2.5rem, 11svh, 7rem) auto 0;
}

.profile { position: relative; text-align: center; }

.profile-photo {
  display: block;
  width: 5.5rem;
  height: auto;
  margin: 0 auto 1.15rem;
  border: 1px solid var(--border);
  border-radius: 1.35rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 10vw, 3.55rem);
  line-height: 1.08;
  letter-spacing: -0.065em;
  font-weight: 735;
  overflow-wrap: anywhere;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
}

.icon-button:hover { background: var(--surface-hover); }
.share-button { position: absolute; top: 0; right: 0; }
.contacts { margin-top: 2rem; }

.contacts h2 {
  margin: 0 0 0.55rem 0.2rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-list, .social-list, .share-options { list-style: none; padding: 0; margin: 0; }
.contact-list { display: grid; gap: 0.5rem; }

.contact {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 650;
  text-decoration: none;
}

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

.contact-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 0.6rem;
  background: var(--icon-bg);
  color: var(--icon-fg);
}

.follow {
  margin-top: 1rem;
  border-block: 1px solid var(--border);
}

.follow summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 0.5rem 0.875rem 0.75rem;
  border-radius: 0.35rem;
  list-style: none;
  font-weight: 620;
  cursor: pointer;
}

.follow summary:hover { background: var(--surface-hover); }
.follow summary::-webkit-details-marker { display: none; }
.follow[open] .expand, .follow:not([open]) .collapse { display: none; }

.social-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 0.5rem; padding: 0 0.5rem 0.5rem; }
.social-list a {
  display: flex;
  align-items: center;
  column-gap: 0.75rem;
  padding: 0.625rem 0.5rem;
  border-radius: 0.35rem;
  text-decoration: none;
}
.social-list a:hover { background: var(--surface-hover); }

.social-list svg, .share-options svg {
  width: 1.0625rem;
  height: 1.0625rem;
  color: var(--icon-fg);
}

.contact-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  background: var(--accent);
  color: var(--on-accent);
  text-align: center;
  text-decoration: none;
  font-weight: 650;
}

.contact-download[href]:hover { text-decoration: underline; }
.contact-download[aria-disabled="true"] { background: transparent; color: var(--muted); border-color: var(--border); }
.mobile-download { margin-top: 1.125rem; }
.mobile-download-status, .share-contact p { margin: 0.35rem 0 0; color: var(--muted); text-align: center; font-size: 0.875rem; }

.settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.375rem 0.75rem;
  margin-top: auto;
  padding: 1.5rem 1rem 1.125rem;
}

.settings button, .settings .for-light, .settings .for-dark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.settings button {
  min-height: 2.75rem;
  padding: 0.25rem 0.4rem;
  color: var(--muted);
  border: 0;
  border-radius: 0.3rem;
  background: transparent;
  font-size: 0.875rem;
}

.settings button:hover { color: var(--text); text-decoration: underline; }
.settings svg { width: 1rem; height: 1rem; }
.settings .for-dark, :root[data-theme="dark"] .for-light { display: none; }
:root[data-theme="dark"] .for-dark { display: inline-flex; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .for-light { display: none; }
  :root:not([data-theme]) .for-dark { display: inline-flex; }
}

.qr-card { display: none; }

@media (min-width: 60rem) and (hover: hover) and (pointer: fine) {
  .mobile-download, .mobile-download-status { display: none; }

  .qr-card {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    position: fixed;
    bottom: 1.5rem;
    margin: 0;
    padding: 0.625rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.875rem;
  }

  .qr-contact { left: 1.5rem; }
  .qr-page { right: 1.5rem; }
  .qr-card img {
    display: block;
    width: 7.5rem;
    height: 7.5rem;
    padding: 1rem;
    background: #fff;
  }
}

dialog {
  width: min(100% - 1.5rem, 27rem);
  max-height: calc(100% - 1.5rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1.25rem 4rem #0003;
}

dialog::backdrop { background: #1118119c; }
.share-panel { padding: 1.125rem; }
.share-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.share-header h2 { margin: 0; font-size: 1.4rem; letter-spacing: -0.035em; }
.copy-row { display: flex; gap: 0.4rem; margin-top: 1rem; }

.copy-row input, .copy-row button {
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.4rem 0.7rem;
}

.copy-row input { width: 100%; min-width: 0; color: var(--text); background: var(--background); }
.copy-row button { background: var(--accent); color: var(--on-accent); font-weight: 650; }
.copy-row button:hover { text-decoration: underline; }
.share-status { margin: 0.4rem 0; min-height: 1.35rem; color: var(--muted); font-size: 0.875rem; }
.share-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }

.share-options a, .share-options button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.35rem;
  background: var(--surface);
  font-weight: 620;
  text-decoration: none;
}

.share-options a:hover, .share-options button:hover { background: var(--surface-hover); }
#messenger-link { display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: 0.3rem; }
.share-contact { padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--border); }
