/* ===========================================================
   Cyfrowa Wizytówka — style.css
   Motyw: edytorski / rzemieślniczy — bez gradientów AI-slop.
   =========================================================== */

:root {
  --accent: #B5502D;
  --accent-ink: #ffffff;

  --bg: #F4EFE6;
  --bg-alt: #ECE4D4;
  --ink: #211E19;
  --ink-soft: #5B5548;
  --line: rgba(33, 30, 25, 0.12);
  --surface: #FBF8F2;
  --shadow: 0 1px 0 rgba(33,30,25,0.06);

  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 28px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #17140F;
  --bg-alt: #1E1A13;
  --ink: #F2ECDF;
  --ink-soft: #B8AF9C;
  --line: rgba(242, 236, 223, 0.12);
  --surface: #1E1A13;
  --shadow: 0 1px 0 rgba(0,0,0,0.4);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17140F;
    --bg-alt: #1E1A13;
    --ink: #F2ECDF;
    --ink-soft: #B8AF9C;
    --line: rgba(242, 236, 223, 0.12);
    --surface: #1E1A13;
    --shadow: 0 1px 0 rgba(0,0,0,0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100svh;
  transition: background-color .35s ease, color .35s ease;
}

/* subtle paper-grain texture, not a gradient */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- layout shell ---------- */

.card {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  padding: clamp(20px, 6vw, 32px) clamp(18px, 6vw, 28px) 40px;
}

section { margin-top: clamp(22px, 5vw, 32px); }
section:first-of-type { margin-top: 8px; }

/* ---------- reveal-on-scroll ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- top controls (język + motyw) ---------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.top-controls {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 26px 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: right 12px center, right 7px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.theme-toggle i { font-size: 15px; grid-area: 1/1; }
.theme-toggle .fa-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .fa-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .fa-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .fa-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .fa-moon { display: block; }
}
.theme-toggle { display: grid; }

/* ---------- brand ---------- */

.brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 0;
}

.brand__logo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.brand__logo span { color: var(--accent); }

.brand__slogan {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.hero__avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--bg-alt);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.hero__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 9vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.hero__role {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
}

/* ---------- status ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: fit-content;
}

.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8a8a80;
  flex-shrink: 0;
}
.status--available .status__dot { background: #4C8B5A; box-shadow: 0 0 0 3px rgba(76,139,90,0.18); }
.status--away .status__dot { background: #C08A2E; box-shadow: 0 0 0 3px rgba(192,138,46,0.18); }

/* ---------- actions ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 13px 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, border-color .2s ease;
}
.btn:active { transform: scale(0.96); }
.btn i { font-size: 15px; }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- QR panel ---------- */

.qr-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 26px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
}
.qr-panel[hidden] { display: none; }

.qr-panel__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 13px;
}
.qr-panel__close:hover { color: var(--accent); border-color: var(--accent); }

.qr-panel__code {
  background: #fff;
  padding: 12px;
  border-radius: var(--radius-md);
  line-height: 0;
}
.qr-panel__code img, .qr-panel__code canvas, .qr-panel__code table { image-rendering: pixelated; }
.qr-panel__caption {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- contact grid (kafelki 2×2, efekt uniesienia) ---------- */

.contact__grid {
  margin: 0;
  font-style: normal;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.contact__tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 15px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 10px 20px -14px rgba(33,30,25,0.35);
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s ease;
}
.contact__tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 14px 24px -14px rgba(33,30,25,0.4);
}
.contact__tile:active { transform: translateY(0); }

:root[data-theme="dark"] .contact__tile {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 10px 20px -14px rgba(0,0,0,0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .contact__tile {
    box-shadow:
      0 1px 0 rgba(255,255,255,0.04) inset,
      0 10px 20px -14px rgba(0,0,0,0.6);
  }
}

.contact__tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.contact__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-alt);
  display: grid;
  place-items: center;
  color: var(--accent);
  flex-shrink: 0;
  font-size: 14px;
}

.contact__label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.contact__value {
  font-size: 14.5px;
  font-weight: 500;
  word-break: break-word;
  line-height: 1.3;
}

.contact__go { color: var(--ink-soft); font-size: 12px; }

.contact__copy {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 12.5px;
}
.contact__copy:hover { color: var(--accent); background: var(--bg-alt); }

/* ---------- social ---------- */

.social__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social__list a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  transition: transform .15s ease, border-color .2s ease, color .2s ease;
}
.social__list a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- event CTA ---------- */

.event-cta-wrap { display: flex; }
.event-cta-wrap[hidden] { display: none; }
.event-cta { width: 100%; justify-content: center; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 20;
  max-width: 90vw;
  text-align: center;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- tablet / desktop ---------- */

@media (min-width: 700px) {
  body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 56px 24px;
    background: var(--bg-alt);
  }
  .card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px -25px rgba(0,0,0,0.28), 0 1px 0 var(--line);
    padding: 44px 44px 40px;
    max-width: 520px;
  }
  .hero { flex-direction: row; align-items: center; }
  .hero__avatar { width: 96px; height: 96px; }
}

@media (min-width: 1024px) {
  .card { max-width: 600px; padding: 56px 56px 48px; }
  .hero__avatar { width: 108px; height: 108px; }
  .actions .btn:hover { transform: translateY(-1px); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
