/* ============================================================
   Karol Kozakowski — personal site
   Minimal / technical. Mono accents, lots of whitespace.
   ============================================================ */

:root {
  /* dark is the default theme */
  --bg:        #0d0f12;
  --bg-soft:   #14171c;
  --bg-card:   #14171c;
  --border:    #23272e;
  --border-strong: #313742;
  --text:      #e6e9ee;
  --text-dim:  #9aa4b2;
  --text-faint:#5f6773;
  --accent:    #5eead4; /* teal */
  --accent-dim:#2dd4bf;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --maxw: 860px;
}

:root[data-theme="light"] {
  --bg:        #fbfbf9;
  --bg-soft:   #ffffff;
  --bg-card:   #ffffff;
  --border:    #e6e4dd;
  --border-strong: #d3d0c6;
  --text:      #14171c;
  --text-dim:  #545b66;
  --text-faint:#8a919c;
  --accent:    #0d9488;
  --accent-dim:#0f766e;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.prompt { color: var(--accent); font-family: var(--mono); }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #08110f; padding: .5rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ─────────────── top bar ─────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1.25rem, 5vw, 3rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--text);
  font-size: .95rem;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-short { display: none; }
.cursor { color: var(--accent); animation: blink 1.2s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav { display: flex; align-items: center; gap: clamp(.75rem, 2.5vw, 1.5rem); }
.nav a {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text-dim);
}
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); }

.theme-toggle {
  font-family: var(--mono);
  font-size: 1rem;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-icon {
  line-height: 1;
}
:root[data-theme="dark"] .theme-icon-moon,
:root[data-theme="light"] .theme-icon-sun {
  display: none;
}

@media (max-width: 820px) {
  .nav { gap: .65rem; }
  .nav-wide { display: none; }
}

@media (max-width: 520px) {
  .nav-resume { display: none; }
}

@media (max-width: 380px) {
  .topbar { padding-left: 1rem; padding-right: 1rem; }
  .brand-full { display: none; }
  .brand-short { display: inline; }
}

/* ─────────────── layout ─────────────── */
main { display: block; }
.block, .hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: clamp(1.25rem, 5vw, 3rem);
  padding-right: clamp(1.25rem, 5vw, 3rem);
}
.block { padding-top: clamp(2rem, 5vw, 3.25rem); padding-bottom: 0; }

/* ─────────────── hero ─────────────── */
.hero { padding-top: clamp(2.5rem, 7vw, 4.5rem); padding-bottom: clamp(1.5rem, 3.5vw, 2.25rem); }
.project-hero { padding-top: clamp(2.5rem, 7vw, 4rem); padding-bottom: clamp(1rem, 3vw, 1.75rem); }
.project-hero .name { max-width: 11ch; }
.eyebrow {
  font-family: var(--mono);
  color: var(--accent);
  font-size: .85rem;
  letter-spacing: .04em;
  margin: 0 0 1rem;
}
.name {
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 0 0 1.25rem;
  font-weight: 600;
}
.tagline {
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  color: var(--text-dim);
  max-width: 44ch;
  margin: 0 0 2rem;
  line-height: 1.45;
}
.tagline strong { color: var(--text); font-weight: 600; }

.cred-strip {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: 0; margin: 0 0 2.25rem;
}
.cred-strip li {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: .35rem .8rem;
  white-space: nowrap;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: .85rem; }

.btn {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: .7rem 1.15rem;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent);
  color: #08110f;
  border-color: var(--accent);
  font-weight: 700;
}
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #08110f; }

.proof-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  padding: 0;
  margin: 0 0 1.75rem;
  font-family: var(--mono);
  font-size: .82rem;
}
.proof-links a { color: var(--text-dim); }
.proof-links a:hover { color: var(--accent); text-decoration: none; }
.proof-links a::before {
  content: "↗ ";
  color: var(--accent);
}

.hero-note { color: var(--text-faint); font-size: .95rem; margin: 0; }
.hero-note strong { color: var(--text-dim); font-weight: 600; }

/* ─────────────── section headings ─────────────── */
.block-head {
  display: flex; align-items: baseline; gap: .9rem;
  border-top: 1px solid var(--border);
  padding-top: 1.15rem;
  margin-bottom: 1.4rem;
}
.section-index {
  font-family: var(--mono);
  color: var(--accent);
  font-size: .85rem;
}
.block-head h2 {
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  margin: 0;
  font-weight: 600;
  letter-spacing: -.01em;
}

/* ─────────────── prose ─────────────── */
.prose p {
  color: var(--text-dim);
  max-width: 62ch;
  margin: 0 0 1.15rem;
}
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--text); font-style: normal; border-bottom: 1px dashed var(--border-strong); }

/* ─────────────── highlight cards ─────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}
.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  padding: 1.25rem 1.35rem;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card h3 {
  font-size: 1rem;
  margin: 0 0 .6rem;
  font-weight: 600;
}
.card p.card-outcome {
  color: var(--accent);
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.45;
  margin: 0 0 .65rem;
}
.card p { color: var(--text-dim); font-size: .95rem; margin: 0; }
.card strong { color: var(--text); font-weight: 600; }

/* ─────────────── project work ─────────────── */
.project-list {
  display: grid;
  gap: 1rem;
}
.project {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  padding: 1.35rem;
}
.project-meta {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.45;
}
.project-meta span:first-child {
  color: var(--accent);
}
.project-body h3 {
  margin: 0 0 .55rem;
  font-size: 1.08rem;
  font-weight: 600;
}
.project-body p {
  color: var(--text-dim);
  font-size: .95rem;
  margin: 0 0 .9rem;
}
.project-points {
  display: grid;
  gap: .45rem;
  margin: 0;
  padding-left: 1.1rem;
}
.project-points li {
  color: var(--text-dim);
  font-size: .9rem;
}
.project-points li::marker {
  color: var(--accent);
}

@media (max-width: 640px) {
  .project { grid-template-columns: 1fr; gap: .85rem; }
  .project-meta { flex-direction: row; flex-wrap: wrap; gap: .4rem .75rem; }
}

/* ─────────────── timeline ─────────────── */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--border);
}
.tl-item:first-child { border-top: none; }
.tl-when {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text-dim);
  padding-top: .15rem;
}
.tl-loc { display: block; color: var(--text-faint); margin-top: .25rem; }
.tl-what h3 { margin: 0 0 .1rem; font-size: 1.08rem; font-weight: 600; }
.tl-org { margin: 0 0 .55rem; color: var(--accent); font-family: var(--mono); font-size: .85rem; }
.tl-what p:last-child { margin: 0; color: var(--text-dim); font-size: .95rem; }

@media (max-width: 560px) {
  .tl-item { grid-template-columns: 1fr; gap: .4rem; }
  .tl-loc { display: inline; margin-left: .5rem; }
}

/* ─────────────── skills ─────────────── */
.skill-groups { display: grid; gap: 1.75rem; }
.skill-group h3 {
  font-family: var(--mono);
  font-size: .9rem;
  color: var(--text);
  margin: 0 0 .85rem;
  font-weight: 500;
}
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; }
.tags li {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text-dim);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .4rem .75rem;
}

/* ─────────────── facts grid ─────────────── */
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.75rem; }
.fact h3 { font-size: .9rem; font-family: var(--mono); color: var(--accent); margin: 0 0 .7rem; font-weight: 500; }
.fact ul { list-style: none; margin: 0; padding: 0; }
.fact li { color: var(--text-dim); font-size: .95rem; margin-bottom: .6rem; }
.fact strong { color: var(--text); font-weight: 600; }
.ext { font-family: var(--mono); font-size: .78rem; margin-left: .35rem; white-space: nowrap; }

/* ─────────────── contact ─────────────── */
.block-contact { padding-bottom: 1rem; }
.contact-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1.75rem;
  max-width: 760px;
}
.contact-actions .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-align: center;
}
.contact-actions .contact-main { grid-column: span 3; }
.contact-actions .btn:not(.contact-main) { grid-column: span 2; }

@media (max-width: 640px) {
  .contact-actions { grid-template-columns: 1fr; }
  .contact-actions .contact-main,
  .contact-actions .btn:not(.contact-main) {
    grid-column: 1;
  }
}

/* ─────────────── footer ─────────────── */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.25rem clamp(1.25rem, 5vw, 3rem) 2.5rem;
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: .8rem;
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
}
.footer a { color: var(--text-dim); }
.footer-sep { color: var(--border-strong); }
