:root {
  --bg: #ffffff;
  --bg-soft: #f6f5f1;
  --ink: #17181c;
  --ink-soft: #5b5e66;
  --line: #e4e2dc;
  --accent: #ffb612;
  --accent-ink: #17181c;
  --link: #8a5a00;
  --radius: 14px;
  --wrap: 60rem;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

/* Without JS there is no data-theme, so follow the system */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #131417;
    --bg-soft: #1c1d22;
    --ink: #f1f0ec;
    --ink-soft: #a3a6ae;
    --line: #2c2e35;
    --link: #ffc94d;
  }
}

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

:root[data-theme="dark"] {
  --bg: #131417;
  --bg-soft: #1c1d22;
  --ink: #f1f0ec;
  --ink-soft: #a3a6ae;
  --line: #2c2e35;
  --link: #ffc94d;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
}

/* Language switching: <html lang> decides which variant is visible */
html[lang="pl"] [lang="en"],
html[lang="en"] [lang="pl"] {
  display: none !important;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--ink);
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.5rem;
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.brand::before {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: var(--accent);
}

.nav {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--ink);
}

.lang,
.theme {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  flex-shrink: 0;
}

.lang button,
.theme button {
  font: 600 0.75rem/1 var(--mono);
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}

.lang button:hover,
.theme button:hover {
  color: var(--ink);
}

.lang button[aria-pressed="true"],
.theme button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.theme {
  margin-left: -0.5rem;
}

.theme button {
  padding: 0.3rem 0.5rem;
}

.theme svg {
  display: block;
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(-90deg);
  transition: transform 0.4s;
}

.theme button[aria-pressed="true"] svg {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .theme svg {
    transition: none;
  }
}

@media (max-width: 46rem) {
  .nav {
    display: none;
  }
}

/* Hero */

.hero {
  padding-block: clamp(3rem, 9vw, 6.5rem);
}

.hero .wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: center;
}

.avatar {
  width: clamp(7.5rem, 22vw, 12.5rem);
  aspect-ratio: 1;
  border-radius: 28%;
  box-shadow: 0.6rem 0.6rem 0 var(--bg-soft);
}

.eyebrow {
  font: 600 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0 0 1.25rem;
}

h1 mark {
  background: linear-gradient(transparent 62%, var(--accent) 62%, var(--accent) 92%, transparent 92%);
  color: inherit;
}

.lead {
  font-size: clamp(1.125rem, 2.4vw, 1.3125rem);
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 0 1.75rem;
}

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

.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.6rem 1.15rem;
  transition: border-color 0.15s, transform 0.15s;
}

.btn:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

@media (max-width: 34rem) {
  .hero .wrap {
    grid-template-columns: 1fr;
  }
}

/* Sections */

section {
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--line);
}

section.hero {
  border-top: 0;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.section-intro {
  color: var(--ink-soft);
  max-width: 38rem;
  margin: 0 0 2rem;
}

.prose {
  max-width: 40rem;
}

.prose p {
  margin: 0 0 1rem;
}

/* Cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card h3 {
  font-size: 1.1875rem;
  margin: 0 0 0.25rem;
}

.card .tag {
  font: 600 0.75rem/1.4 var(--mono);
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
}

.card p {
  color: var(--ink-soft);
  font-size: 0.9688rem;
  margin: 0 0 1.25rem;
}

.card .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin-top: auto;
  font-size: 0.9375rem;
  font-weight: 600;
}

.card .links a::after {
  content: " \2197";
}

.card .status {
  font: 600 0.75rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

/* Skills */

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.5rem 2rem;
}

.skills h3 {
  font: 600 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.75rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chips li {
  font-size: 0.9375rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
}

/* Photos */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.5rem;
}

@media (max-width: 34rem) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

.gallery button {
  padding: 0;
  border: 0;
  background: var(--bg-soft);
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 3 / 2;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}

.gallery button:hover img {
  transform: scale(1.04);
}

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 96vw;
  max-height: 96vh;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.lightbox img {
  max-width: 96vw;
  max-height: 88vh;
  border-radius: 8px;
  cursor: zoom-out;
}

.lightbox p {
  color: #fff;
  text-align: center;
  font-size: 0.9375rem;
  margin: 0.75rem 0 0;
}

.lightbox .prev,
.lightbox .next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox .prev {
  left: 0.75rem;
}

.lightbox .next {
  right: 0.75rem;
}

.lightbox .prev:hover,
.lightbox .next:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Contact */

.contact-mail {
  display: inline-block;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.18em;
  margin-bottom: 1.5rem;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-weight: 600;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem 3rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
}
