/* Pascal Malz, digital CV
   Design system: one accent, restrained neutrals, light + dark. */

:root {
  --bg:            #ffffff;
  --bg-sunken:     #f6f7f9;
  --bg-raised:     #ffffff;
  --border:        #e3e6ea;
  --border-strong: #c9cfd6;
  --text:          #14181d;
  --text-muted:    #5b6672;
  --text-faint:    #8a94a0;
  --accent:        #0f5c8c;
  --accent-soft:   #e7f0f6;
  --accent-text:   #0f5c8c;
  --shadow:        0 1px 2px rgba(16,24,32,.05), 0 8px 24px -12px rgba(16,24,32,.18);
  --radius:        10px;
  --maxw:          1080px;
  --font-sans:     "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:     ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0f1418;
    --bg-sunken:     #141a20;
    --bg-raised:     #171e25;
    --border:        #262f38;
    --border-strong: #38434f;
    --text:          #e8ecf1;
    --text-muted:    #a3aeba;
    --text-faint:    #74808d;
    --accent:        #4da6dd;
    --accent-soft:   #16293a;
    --accent-text:   #6fb9e8;
    --shadow:        0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  }
}

:root[data-theme="dark"] {
  --bg:            #0f1418;
  --bg-sunken:     #141a20;
  --bg-raised:     #171e25;
  --border:        #262f38;
  --border-strong: #38434f;
  --text:          #e8ecf1;
  --text-muted:    #a3aeba;
  --text-faint:    #74808d;
  --accent:        #4da6dd;
  --accent-soft:   #16293a;
  --accent-text:   #6fb9e8;
  --shadow:        0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); }
h3 { font-size: 1.125rem; }
p  { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.15rem; }
li { margin-bottom: .3rem; }

a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

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

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

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0; z-index: 200;
}
.skip-link:focus { left: 0; top: 0; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1rem;
  min-height: 4rem;
}
.brand {
  font-weight: 700; letter-spacing: -.02em; color: var(--text);
  text-decoration: none; font-size: 1.02rem; margin-right: auto; white-space: nowrap;
}
.brand span { color: var(--text-faint); font-weight: 500; }

.nav { display: flex; align-items: center; gap: .25rem; }
.nav a {
  color: var(--text-muted); text-decoration: none;
  padding: .45rem .7rem; border-radius: 6px;
  font-size: .925rem; font-weight: 500; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--bg-sunken); }
.nav a[aria-current="true"] { color: var(--accent-text); background: var(--accent-soft); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border-strong);
  color: var(--text); border-radius: 7px; padding: .45rem .6rem; cursor: pointer;
}
.theme-toggle {
  background: none; border: 1px solid var(--border-strong); color: var(--text-muted);
  border-radius: 7px; width: 2.15rem; height: 2.15rem; cursor: pointer;
  display: grid; place-items: center; flex: none;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-faint); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun  { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun  { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
  :root[data-theme="light"] .icon-sun  { display: block; }
  :root[data-theme="light"] .icon-moon { display: none; }
}

@media (max-width: 800px) {
  .nav-toggle { display: block; order: 3; }
  .nav {
    display: none; order: 4; width: 100%;
    flex-direction: column; align-items: stretch;
    padding-bottom: .75rem; gap: 0;
  }
  .nav.open { display: flex; }
  .nav a { padding: .65rem .5rem; }
  .site-header .wrap { flex-wrap: wrap; }
}

/* ---------- Hero ---------- */

.hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero-grid {
  display: grid; gap: clamp(1.75rem, 5vw, 3.5rem);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 780px) {
  .hero-grid { grid-template-columns: minmax(0,1fr) 260px; }
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-text); background: var(--accent-soft);
  padding: .3rem .7rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.hero .lede {
  font-size: clamp(1.05rem, .98rem + .35vw, 1.2rem);
  color: var(--text-muted); max-width: 56ch; margin-bottom: 1.75rem;
}
.hero-photo {
  width: 100%; max-width: 260px; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow);
  justify-self: center;
}

.actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .62rem 1.1rem; border-radius: 8px;
  font-family: inherit; font-size: .94rem; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--bg-sunken); border-color: var(--text-faint); }
.btn svg { width: 1rem; height: 1rem; flex: none; }

.facts {
  display: flex; flex-wrap: wrap; gap: .4rem 1.5rem;
  margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--border);
  font-size: .9rem; color: var(--text-muted);
}
.facts div { display: inline-flex; align-items: center; gap: .45rem; }
.facts svg { width: .95rem; height: .95rem; color: var(--text-faint); flex: none; }

/* ---------- Sections ---------- */

.section { padding: clamp(2.75rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--border); }
.section-sunken { background: var(--bg-sunken); }
.section-head { margin-bottom: 2.25rem; max-width: 60ch; }
.section-head p { color: var(--text-muted); margin: 0; }
.section-num {
  font-family: var(--font-mono); font-size: .78rem; color: var(--text-faint);
  letter-spacing: .1em; display: block; margin-bottom: .5rem;
}

/* ---------- Timeline ---------- */

.timeline { position: relative; padding-left: 1.9rem; }
.timeline::before {
  content: ""; position: absolute; left: .43rem; top: .5rem; bottom: .5rem;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 2.1rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -1.9rem; top: .48rem;
  width: .95rem; height: .95rem; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border-strong);
}
.tl-item.is-current::before { background: var(--accent); border-color: var(--accent); }
.tl-date {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .04em;
  color: var(--text-faint); text-transform: uppercase;
}
.tl-item h3 { margin: .2rem 0 .1rem; }
.tl-org { color: var(--text-muted); font-size: .93rem; margin-bottom: .7rem; }
.tl-body { color: var(--text-muted); font-size: .95rem; }
.tl-body ul { margin-bottom: 0; }

/* ---------- Skills ---------- */

.skill-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.skill-card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.35rem;
}
.skill-card h3 { font-size: .95rem; letter-spacing: .02em; margin-bottom: .85rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.tags li {
  font-size: .82rem; color: var(--text-muted); margin: 0;
  background: var(--bg-sunken); border: 1px solid var(--border);
  padding: .22rem .6rem; border-radius: 999px;
}
.section-sunken .tags li { background: var(--bg); }

/* ---------- Certifications ---------- */

.cert-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
}
.cert-card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.05rem 1.2rem;
}
.cert-date {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-faint); margin: 0 0 .35rem;
}
.cert-card h3 { font-size: .97rem; margin-bottom: .25rem; }
.cert-org { font-size: .86rem; color: var(--text-muted); margin: 0; }

/* ---------- Projects ---------- */

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }
.filter {
  font: inherit; font-size: .88rem; font-weight: 500;
  padding: .38rem .85rem; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border-strong);
}
.filter:hover { color: var(--text); }
.filter[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

.project-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.project-card {
  display: flex; flex-direction: column;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.project-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.project-media { aspect-ratio: 16 / 9; background: var(--bg-sunken); overflow: hidden; }
.project-media img { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.project-kicker {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: .45rem;
}
.project-card h3 { font-size: 1.02rem; margin-bottom: .5rem; }
.project-card p { font-size: .91rem; color: var(--text-muted); margin: 0 0 1rem; }
.project-tags { margin-top: auto; }
.project-empty { color: var(--text-muted); }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.contact-card {
  display: flex; align-items: center; gap: .85rem;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.15rem;
  text-decoration: none; color: var(--text);
  transition: border-color .15s, background .15s;
  /* also used as a <button> for click-to-reveal contact details */
  font: inherit; text-align: left; width: 100%; cursor: pointer;
}
button.contact-card .value { color: var(--accent-text); }
.contact-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.contact-card svg { width: 1.35rem; height: 1.35rem; color: var(--accent-text); flex: none; }
.contact-card .label { font-size: .78rem; color: var(--text-faint); display: block; }
.contact-card .value { font-weight: 600; font-size: .93rem; word-break: break-word; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.25rem 0;
  font-size: .875rem; color: var(--text-muted);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; }
.site-footer nav { margin-left: auto; display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-note { color: var(--text-faint); font-size: .82rem; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Legal / prose pages ---------- */

.prose { max-width: 72ch; padding-block: clamp(2.5rem, 6vw, 4rem); }
.prose h1 { margin-bottom: 1.5rem; }
.prose h2 { font-size: 1.3rem; margin-top: 2.25rem; }
.prose h3 { font-size: 1.05rem; margin-top: 1.75rem; }
.prose p, .prose li { color: var(--text-muted); }
.prose a { word-break: break-word; }

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Print ---------- */

@media print {
  .site-header, .site-footer, .actions, .filters, .theme-toggle, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section { border-top: none; padding: .75rem 0; break-inside: avoid; }
  .section-sunken { background: #fff; }
  a { color: #000; text-decoration: none; }
  .project-media { display: none; }
  .reveal { opacity: 1; transform: none; }
}
