/* tztech.dev
   Layout: professional profile, LinkedIn-style. Sticky top bar; main column of cards
   (profile header, About, Projects, Skills) with a narrow sidebar (Contact, Certifications).
   Swiss-minimal: navy text, one blue accent, white cards on a cool gray page. */

:root {
  --bg: #F3F5F8;
  --card: #FFFFFF;
  --fg: #0F172A;
  --muted: #475569;
  --faint: #64748B;
  --line: #E2E8F0;
  --accent: #0369A1;
  --accent-hover: #075985;
  --accent-soft: #E0F0FA;
  --on-accent: #FFFFFF;
  --banner-a: #0F2A44;
  --banner-b: #1E4A6E;
  --banner-dot: rgba(255, 255, 255, 0.07);

  /* Status */
  --live-bg: #E7F6EC;  --live-fg: #166534;
  --dev-bg:  #FEF3E2;  --dev-fg:  #92400E;

  /* Project logo tiles: soft tint + strong icon color */
  --t-hotlap-bg: #FDECE7; --t-hotlap-fg: #C2410C;
  --t-van-bg:    #E6F4EA; --t-van-fg:    #15803D;
  --t-feed-bg:   #E5EEFB; --t-feed-fg:   #1D4ED8;
  --t-pix-bg:    #FDF4DC; --t-pix-fg:    #B45309;

  --font-head: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  --wrap: 1128px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1118;
    --card: #141C25;
    --fg: #E6EDF4;
    --muted: #A9B6C4;
    --faint: #8494A5;
    --line: #243140;
    --accent: #5BB4E8;
    --accent-hover: #86CAF0;
    --accent-soft: #12314A;
    --on-accent: #06131D;
    --banner-a: #0E2236;
    --banner-b: #173A57;
    --banner-dot: rgba(255, 255, 255, 0.05);
    --live-bg: #12301F;  --live-fg: #7BDCA0;
    --dev-bg:  #33240E;  --dev-fg:  #F3BE6B;
    --t-hotlap-bg: #3A1D12; --t-hotlap-fg: #FB9A6C;
    --t-van-bg:    #12301D; --t-van-fg:    #6FD69A;
    --t-feed-bg:   #142849; --t-feed-fg:   #8CB2FA;
    --t-pix-bg:    #362A0E; --t-pix-fg:    #F3BE6B;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1118;
  --card: #141C25;
  --fg: #E6EDF4;
  --muted: #A9B6C4;
  --faint: #8494A5;
  --line: #243140;
  --accent: #5BB4E8;
  --accent-hover: #86CAF0;
  --accent-soft: #12314A;
  --on-accent: #06131D;
  --banner-a: #0E2236;
  --banner-b: #173A57;
  --banner-dot: rgba(255, 255, 255, 0.05);
  --live-bg: #12301F;  --live-fg: #7BDCA0;
  --dev-bg:  #33240E;  --dev-fg:  #F3BE6B;
  --t-hotlap-bg: #3A1D12; --t-hotlap-fg: #FB9A6C;
  --t-van-bg:    #12301D; --t-van-fg:    #6FD69A;
  --t-feed-bg:   #142849; --t-feed-fg:   #8CB2FA;
  --t-pix-bg:    #362A0E; --t-pix-fg:    #F3BE6B;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-head); color: var(--fg); margin: 0; text-wrap: balance; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  color: var(--fg);
}
.brand:hover { color: var(--fg); text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--on-accent);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.02em;
}
.topnav { display: flex; gap: 4px; }
.topnav a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 12px;
  font-size: 15px; font-weight: 600;
  color: var(--muted);
  border-radius: 8px;
  transition: color 200ms ease, background-color 200ms ease;
}
.topnav a:hover { color: var(--fg); background: var(--bg); text-decoration: none; }

/* ---------- Layout ---------- */
.layout {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
.main, .aside { display: grid; gap: 16px; min-width: 0; }
.aside { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 80px); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-pad { padding: 24px; }
.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
}
.card-sub { margin: 0 0 16px; font-size: 15px; color: var(--faint); }

/* ---------- Profile header ---------- */
.profile { overflow: hidden; }
.banner {
  height: 132px;
  background-color: var(--banner-a);
  background-image:
    radial-gradient(var(--banner-dot) 1.2px, transparent 1.6px),
    linear-gradient(120deg, var(--banner-a), var(--banner-b));
  background-size: 18px 18px, 100% 100%;
}
.profile-body { padding: 0 24px 24px; }
.avatar {
  width: 128px; height: 128px;
  margin-top: -68px;
  border-radius: 50%;
  border: 4px solid var(--card);
  background: linear-gradient(145deg, #0F2A44, #0369A1);
  color: #FFFFFF;
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-size: 44px; font-weight: 600;
  letter-spacing: 0.01em;
}
.profile h1 {
  margin-top: 14px;
  font-size: clamp(1.6rem, 3.2vw, 1.9rem);
  font-weight: 600;
  line-height: 1.2;
}
.headline { margin: 4px 0 0; font-size: 1.125rem; color: var(--fg); }
.meta { margin: 6px 0 0; font-size: 15px; color: var(--faint); }
.meta a { font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px; font-weight: 600;
  border: 1.5px solid var(--accent);
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); color: var(--accent); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn svg { width: 15px; height: 15px; flex: none; }

/* ---------- About ---------- */
.about p { margin: 0; max-width: 68ch; }

/* ---------- Projects ---------- */
.project-list { list-style: none; margin: 0; padding: 0; }
.project {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
}
.project:first-child { border-top: 0; padding-top: 4px; }
.project:last-child { padding-bottom: 0; }
.logo {
  width: 56px; height: 56px;
  border-radius: 12px;
  display: grid; place-items: center;
}
.logo svg { width: 28px; height: 28px; }
.logo-img { overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.logo-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.logo.hotlap { background: var(--t-hotlap-bg); color: var(--t-hotlap-fg); }
.logo.van    { background: var(--t-van-bg);    color: var(--t-van-fg); }
.logo.feed   { background: var(--t-feed-bg);   color: var(--t-feed-fg); }
.logo.pix    { background: var(--t-pix-bg);    color: var(--t-pix-fg); }
.project-info { min-width: 0; }
.project-top {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 10px;
}
.project h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live { background: var(--live-bg); color: var(--live-fg); }
.badge.dev  { background: var(--dev-bg);  color: var(--dev-fg); }
.kind { margin: 2px 0 0; font-size: 15px; color: var(--fg); }
.where { margin: 0; font-size: 14px; color: var(--faint); overflow-wrap: anywhere; }
.project .desc { margin: 10px 0 0; max-width: 66ch; color: var(--muted); }
.built { margin: 8px 0 0; font-size: 14px; color: var(--faint); }
.built strong { font-weight: 600; color: var(--muted); }
.project-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- Skills ---------- */
.skill-groups { display: grid; margin-top: 12px; }
.skill-group {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 16px;
  align-items: start;
  padding-block: 14px;
  border-top: 1px solid var(--line);
}
.skill-group:first-child { border-top: 0; padding-top: 0; }
.skill-group:last-child { padding-bottom: 0; }
.skill-group h3 { font-family: var(--font-body); font-size: 15px; font-weight: 600; line-height: 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Sidebar ---------- */
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.side-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; }
.side-item svg { width: 20px; height: 20px; color: var(--faint); margin-top: 2px; }
.side-label { display: block; font-size: 14px; color: var(--faint); }
.side-value { display: block; font-weight: 600; overflow-wrap: anywhere; }
.cert { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; }
.cert-mark {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--font-head); font-size: 12px; font-weight: 600; color: var(--muted);
}
.cert-name { display: block; font-weight: 600; line-height: 1.3; }
.cert-status { display: block; font-size: 14px; color: var(--faint); }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px 40px;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 20px;
  font-size: 14px; color: var(--faint);
}
.footer a { color: var(--muted); }

/* ---------- Document pages (privacy policy) ---------- */
.doc-wrap { max-width: 800px; margin: 0 auto; padding: 24px 20px 48px; }
.doc { padding: 32px; }
.doc .back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px; font-size: 15px; font-weight: 600; }
.doc h1 { font-size: clamp(1.6rem, 3.6vw, 2rem); font-weight: 600; line-height: 1.2; }
.doc .updated { margin: 6px 0 24px; font-size: 15px; color: var(--faint); }
.doc h2 { margin: 32px 0 10px; font-size: 1.2rem; font-weight: 600; line-height: 1.3; }
.doc p { margin: 0 0 14px; max-width: 68ch; }
.doc .lead { font-size: 1.0625rem; color: var(--muted); }
.callout {
  margin: 0 0 14px; padding: 14px 18px;
  background: var(--live-bg); color: var(--fg);
  border-radius: 8px;
}
.callout strong { color: var(--live-fg); }
.table-wrap { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font-size: 14px; font-weight: 600; color: var(--muted); background: var(--bg); }
td:first-child { min-width: 180px; }
code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
}
@media (max-width: 560px) {
  .topbar-inner { padding-inline: 16px; }
  .topnav a { padding: 0 8px; font-size: 14px; }
  .brand-name { display: none; }
  .layout { padding: 16px 16px 40px; gap: 16px; }
  .card-pad { padding: 20px; }
  .profile-body { padding: 0 20px 20px; }
  .banner { height: 96px; }
  .avatar { width: 96px; height: 96px; margin-top: -52px; font-size: 34px; }
  .project { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
  .logo { width: 44px; height: 44px; border-radius: 10px; }
  .logo svg { width: 22px; height: 22px; }
  .doc-wrap { padding: 16px 16px 40px; }
  .skill-group { grid-template-columns: minmax(0, 1fr); }
  .skill-group h3 { line-height: 1.4; }
  .doc { padding: 22px; }

  /* Tables become stacked rows on phones */
  .table-wrap { overflow-x: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  tr:last-child { border-bottom: 0; }
  td { padding: 0; border: 0; min-width: 0; }
  td:first-child { min-width: 0; font-weight: 600; }
  td + td { margin-top: 8px; }
  td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .topnav a { transition: none; }
}
