/* karczewski.biz — jednostronicowa wizytówka
   Kierunek: „cicha powaga” — granat studyjnego tła portretu, mosiężny akcent,
   szeryfowy Fraunces w roli głosu, Karla jako tekst roboczy. */

:root {
  --ink:        #070B16;
  --ink-2:      #0C1225;
  --ink-3:      #131C36;
  --line:       #1F2A47;
  --paper:      #EEF1F8;
  --muted:      #96A3C2;
  --muted-dim:  #6B789A;
  --brass:      #D6A94B;
  --brass-soft: #F0CE85;
  --glow:       #2E4E9E;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --rhythm: clamp(3.5rem, 9vw, 7.5rem);

  --serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  "Karla", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.25vw, 1.08rem);
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Atmosfera: poświata jak na tle zdjęcia + delikatne ziarno ───────────── */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(70rem 48rem at 78% 12%, color-mix(in oklab, var(--glow) 42%, transparent), transparent 62%),
    radial-gradient(48rem 40rem at 4% 88%, color-mix(in oklab, var(--glow) 16%, transparent), transparent 65%);
}

body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

.shell { position: relative; z-index: 2; }

/* ── Typografia ──────────────────────────────────────────────────────────── */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 40;
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; max-width: var(--measure); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.eyebrow::after {
  content: "";
  height: 1px;
  flex: 1;
  max-width: 6rem;
  background: linear-gradient(90deg, color-mix(in oklab, var(--brass) 60%, transparent), transparent);
}

.lede {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 20, "WONK" 0, "opsz" 20;
  font-size: clamp(1.2rem, 1.02rem + 0.9vw, 1.65rem);
  line-height: 1.4;
  color: var(--paper);
  letter-spacing: -0.005em;
}

.dim { color: var(--muted); }

/* ── Nagłówek strony ─────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.4rem, 3vw, 2.4rem) var(--gutter);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.topbar .mark {
  font-family: var(--serif);
  font-variation-settings: "WONK" 1, "opsz" 14;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--paper);
  text-decoration: none;
}

.lang { display: flex; gap: 0.7rem; align-items: baseline; }
.lang a { text-decoration: none; color: var(--muted-dim); transition: color 0.25s ease; }
.lang a:hover, .lang a:focus-visible { color: var(--brass); }
.lang [aria-current="true"] { color: var(--paper); }
.lang .sep { color: var(--line); }

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(2rem, 5vw, 4rem) var(--gutter) var(--rhythm);
  min-height: min(84svh, 60rem);
}

.hero h1 {
  font-size: clamp(2.9rem, 1.6rem + 6.2vw, 6.2rem);
  margin-bottom: 1.5rem;
}
.hero h1 .given { display: block; color: var(--muted); font-size: 0.62em; letter-spacing: -0.005em; }
.hero h1 .family { display: block; }

.role {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
  color: var(--paper);
  border-left: 2px solid var(--brass);
  padding-left: 1.1rem;
  margin-bottom: 2rem;
  max-width: 34ch;
}

/* Portret — krawędzie rozpływają się w tle strony */
.portrait { position: relative; justify-self: center; width: 100%; max-width: 27rem; }
.portrait::before {
  content: "";
  position: absolute;
  inset: 6% 4% 10%;
  background: radial-gradient(circle at 50% 38%, color-mix(in oklab, var(--glow) 70%, transparent), transparent 68%);
  filter: blur(38px);
  z-index: -1;
}
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  /* trzy warstwy maski w przecięciu: owal + wygaszenie góry (nad włosami) + boki */
  --m-oval: radial-gradient(ellipse 72% 78% at 50% 44%, #000 30%, transparent 88%);
  --m-top:  linear-gradient(to bottom, transparent 0%, #000 9%);
  --m-side: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: var(--m-oval), var(--m-top), var(--m-side);
  -webkit-mask-composite: source-in;
          mask-image: var(--m-oval), var(--m-top), var(--m-side);
          mask-composite: intersect;
}

/* ── Przyciski ───────────────────────────────────────────────────────────── */

.actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.78rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  background: color-mix(in oklab, var(--ink-2) 70%, transparent);
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.btn svg { width: 1.05em; height: 1.05em; flex: none; }
.btn:hover, .btn:focus-visible {
  border-color: var(--brass);
  color: var(--brass-soft);
  transform: translateY(-2px);
}
.btn--primary {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--ink);
  font-weight: 600;
}
.btn--primary:hover, .btn--primary:focus-visible {
  background: var(--brass-soft);
  border-color: var(--brass-soft);
  color: var(--ink);
}

/* ── Sekcje ──────────────────────────────────────────────────────────────── */

section { padding: 0 var(--gutter) var(--rhythm); }

.section-head { margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.section-head h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.9rem); }

.rule { height: 1px; border: 0; margin: 0 var(--gutter) var(--rhythm);
        background: linear-gradient(90deg, var(--line), transparent 70%); }

/* Zakres doradztwa */
.scope { display: grid; gap: 1px; background: var(--line);
         border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
         grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }

.scope article {
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  padding: clamp(1.6rem, 3vw, 2.4rem);
  transition: background 0.35s ease;
}
.scope article:hover { background: linear-gradient(180deg, var(--ink-3), var(--ink-2)); }
.scope .num {
  font-family: var(--serif);
  font-variation-settings: "WONK" 1, "opsz" 14;
  color: var(--brass);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 1.5rem;
}
.scope h3 { font-size: 1.32rem; margin-bottom: 0.85rem; }
.scope p { color: var(--muted); font-size: 0.96rem; }

/* Sylwetka */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
         gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.facts { list-style: none; margin: 1.8rem 0 0; padding: 0; display: grid; gap: 0.9rem; }
.facts li { display: flex; gap: 0.9rem; align-items: baseline; color: var(--muted); font-size: 0.95rem; }
.facts li::before { content: "—"; color: var(--brass); flex: none; }

/* Kontakt */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
                gap: clamp(1.5rem, 3vw, 2.5rem); }
.contact-grid dt { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
                   color: var(--muted-dim); margin-bottom: 0.55rem; }
.contact-grid dd { margin: 0 0 1.6rem; font-size: 1.02rem; }
.contact-grid dd:last-child { margin-bottom: 0; }
.contact-grid a { color: var(--paper); text-decoration: none;
                  border-bottom: 1px solid color-mix(in oklab, var(--brass) 45%, transparent);
                  padding-bottom: 1px; transition: color 0.25s ease, border-color 0.25s ease; }
.contact-grid a:hover, .contact-grid a:focus-visible { color: var(--brass-soft); border-color: var(--brass); }

/* Linia z firmą pod opisem roli */
.org { color: var(--muted); font-size: 0.95rem; margin: -1rem 0 2rem; }
.org a { color: var(--paper); text-decoration: none;
         border-bottom: 1px solid color-mix(in oklab, var(--brass) 55%, transparent);
         transition: color 0.25s ease, border-color 0.25s ease; }
.org a:hover, .org a:focus-visible { color: var(--brass-soft); border-color: var(--brass); }

/* Stopka — kontakt + dane przedsiębiorcy (art. 5 UŚUDE) w jednym miejscu */
footer {
  border-top: 1px solid var(--line);
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter) clamp(2rem, 4vw, 3rem);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(1.75rem, 4vw, 3.5rem);
}
footer p { margin: 0 0 0.35rem; max-width: 40ch; }
footer address { font-style: normal; }
.foot-label {
  font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted-dim); margin-bottom: 0.7rem !important;
}
footer a { color: var(--paper); text-decoration: none;
           border-bottom: 1px solid color-mix(in oklab, var(--brass) 45%, transparent);
           transition: color 0.25s ease, border-color 0.25s ease; overflow-wrap: anywhere; }
footer a:hover, footer a:focus-visible { color: var(--brass-soft); border-color: var(--brass); }
.foot-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem;
  margin: clamp(2rem, 4vw, 3rem) 0 0 !important; padding-top: 1.4rem;
  border-top: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  font-size: 0.82rem; color: var(--muted-dim); max-width: none !important;
}

/* (EN — do czasu przepisania) */
footer .note { flex: 1 1 22rem; max-width: 42ch; color: var(--muted-dim); }

/* ── Dostępność ──────────────────────────────────────────────────────────── */

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--brass); color: var(--ink); padding: 0.7rem 1.1rem; text-decoration: none;
}
.skip:focus { left: var(--gutter); top: 0.6rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Wejście strony: jedno dobrze zestrojone otwarcie ────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
  .reveal:nth-child(1) { animation-delay: 0.05s; }
  .reveal:nth-child(2) { animation-delay: 0.14s; }
  .reveal:nth-child(3) { animation-delay: 0.23s; }
  .reveal:nth-child(4) { animation-delay: 0.32s; }
  .portrait { animation: fade 1.6s ease 0.15s both; }
}

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }

/* ── Układ mobilny ───────────────────────────────────────────────────────── */

@media (max-width: 62rem) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 1rem; }
  .hero .portrait { order: -1; max-width: 17rem; }
  .about { grid-template-columns: 1fr; }
}

@media (max-width: 34rem) {
  .actions .btn { flex: 1 1 100%; justify-content: center; }
}

@media print {
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
}
