/* =========================================================
   Conrad van Coller — engineer's homepage
   Restrained, content-first. Inter only. Two surfaces, one accent.
   ========================================================= */

/* ----- Tokens ----- */
:root {
  /* Color */
  --canvas:      #FBFCFD;
  --canvas-alt:  #EEF4FA;
  --ink:         #0F1419;
  --ink-soft:    #424A57;
  --ink-faint:   #7A8290;
  --line:        #DDE4EC;
  --line-soft:   #E8EDF3;
  --accent:      #1F4E89;
  --accent-hov:  #2C5FA0;
  --selection:   #DDEAF7;

  /* Type */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Scale */
  --fs-xs:   0.75rem;   /* 12 */
  --fs-sm:   0.875rem;  /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-lg:   1.0625rem; /* 17 */
  --fs-xl:   1.25rem;   /* 20 */
  --fs-2xl:  1.5rem;    /* 24 */
  --fs-3xl:  1.875rem;  /* 30 */

  /* Spacing */
  --s-1:  0.25rem;
  --s-2:  0.5rem;
  --s-3:  0.75rem;
  --s-4:  1rem;
  --s-6:  1.5rem;
  --s-8:  2rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-20: 5rem;

  /* Layout */
  --container: 880px;
  --nav-h: 56px;

  /* Border + motion */
  --radius: 4px;
  --radius-md: 8px;
  --radius-pill: 9999px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--selection); color: var(--ink); }

/* ----- Base ----- */
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--canvas);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

/* ----- Typography ----- */
h1, .h1 { font-size: var(--fs-3xl); font-weight: 600; line-height: 1.15; letter-spacing: -0.018em; color: var(--ink); }
h2, .h2 { font-size: var(--fs-2xl); font-weight: 600; line-height: 1.2;  letter-spacing: -0.012em; color: var(--ink); }
h3      { font-size: var(--fs-xl); font-weight: 600; line-height: 1.3;  letter-spacing: -0.008em; }
h4      { font-size: var(--fs-base); font-weight: 600; line-height: 1.4; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.lede { font-size: var(--fs-lg); line-height: 1.6; color: var(--ink-soft); max-width: 60ch; }
.muted { color: var(--ink-soft); }

/* ----- Nav ----- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 252, 253, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 240ms var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}
.nav__brand {
  font-weight: 600;
  font-size: var(--fs-base);
  letter-spacing: -0.005em;
  color: var(--ink);
}
.nav__brand:hover { color: var(--accent); }
.nav__links { display: flex; gap: var(--s-6); align-items: center; }
.nav__links a {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  position: relative;
  padding: var(--s-2) 0;
  transition: color 160ms var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active { color: var(--ink); }
.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--accent);
}

@media (max-width: 640px) {
  .nav__links { gap: var(--s-4); }
  .nav__links a { font-size: var(--fs-xs); }
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: var(--s-3) var(--s-6);
  border-radius: var(--radius);
  transition: all 180ms var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn--primary { background: var(--ink); color: var(--canvas); }
.btn--primary:hover { background: var(--accent); }
.btn--ghost {
  color: var(--ink);
  border-color: var(--line);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--ink); }
.btn .arr { display: inline-block; transition: transform 180ms var(--ease); }
.btn:hover .arr { transform: translateX(2px); }

/* ----- Hero ----- */
.hero { padding: var(--s-8) 0 var(--s-12); }
.hero__inner {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--s-8);
}
.hero__avatar {
  width: 192px;
  height: 192px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  object-position: center 14%;
}
.hero__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.hero__name { margin-bottom: var(--s-2); }
.hero__role {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: var(--s-6);
}
.hero__bio {
  font-size: var(--fs-lg);
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: var(--s-8);
  max-width: 60ch;
  text-align: left;
}
.hero__cta {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-6);
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.hero__meta li { display: inline-flex; align-items: center; }
.hero__meta li + li::before {
  content: "/";
  margin-right: var(--s-4);
  color: var(--ink-faint);
}

@media (max-width: 768px) {
  .hero { padding: var(--s-6) 0 var(--s-8); }
  .hero__inner { flex-direction: column; gap: var(--s-6); }
  .hero__avatar { width: 120px; height: 120px; }
}

/* ----- Section ----- */
.section { padding: var(--s-8) 0; border-top: 1px solid var(--line); }
.section--alt { background: var(--canvas-alt); border-top-color: var(--line); }
.section__head {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  margin-bottom: var(--s-8);
}
.section__num {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}
.section__intro {
  font-size: var(--fs-lg);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-bottom: var(--s-8);
}

@media (max-width: 700px) {
  .section { padding: var(--s-6) 0; }
}

/* ----- Project ----- */
.project {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  padding: var(--s-8);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.project + .project { margin-top: var(--s-8); }
.section--alt .project { background: var(--canvas); }
.project__head {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--line);
}
.project__head h3 { font-size: var(--fs-2xl); margin-bottom: var(--s-1); }
.project__role {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.project__body p { color: var(--ink-soft); font-size: var(--fs-base); }
.project__body > * + * { margin-top: var(--s-4); }
.project__body p + p { margin-top: var(--s-4); }
.project__sub {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--s-2);
}

.project__figure {
  margin: 0;
  padding: var(--s-4);
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.project__figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  cursor: zoom-in;
  transition: opacity 160ms var(--ease);
}
.project__figure img:hover { opacity: 0.92; }
.project__figure figcaption {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  margin-top: var(--s-3);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* ----- Lightbox ----- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 20, 25, 0.86);
  padding: var(--s-8);
  cursor: zoom-out;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.lightbox.is-open { display: flex; }
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #FFFFFF;
  padding: var(--s-4);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.lightbox__close {
  position: absolute;
  top: var(--s-4);
  right: var(--s-6);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}
.lightbox__close:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.project__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
  padding: var(--s-6) 0;
  margin: var(--s-2) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.project__metric .num {
  display: block;
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ink);
  line-height: 1;
}
.project__metric .num .plus { color: var(--accent); font-weight: 500; }
.project__metric .lbl {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  margin-top: var(--s-2);
  line-height: 1.4;
}

.project__stack {
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.kbd {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--canvas-alt);
  letter-spacing: 0.02em;
}
.section--alt .kbd { background: var(--canvas); }

/* ----- Collapsible project cards ----- */
.project.is-collapsed .project__body > div,
.project.is-collapsed .project__metrics,
.project.is-collapsed .project__stack {
  display: none;
}
.project.is-collapsed .project__body { padding-bottom: 0; }

.project__toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  border: 0;
  padding: var(--s-2) 0;
  margin-top: var(--s-2);
  cursor: pointer;
  transition: color 160ms var(--ease);
}
.project__toggle:hover { color: var(--ink); }
.project__toggle .arr {
  display: inline-block;
  transition: transform 220ms var(--ease);
}
.project:not(.is-collapsed) .project__toggle .arr { transform: rotate(180deg); }

.work__more {
  margin-top: var(--s-8);
  font-size: var(--fs-sm);
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.work__more::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

@media (max-width: 700px) {
  .project { padding: var(--s-6); }
  .project__metrics { grid-template-columns: 1fr 1fr; gap: var(--s-4); }
}
@media (max-width: 480px) {
  .project__metrics { grid-template-columns: 1fr; }
}

/* ----- Contact ----- */
.contact__lede {
  font-size: var(--fs-xl);
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--ink);
  max-width: 50ch;
  margin-bottom: var(--s-8);
}
.contact__methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 var(--s-6);
  border-top: 1px solid var(--line);
}
.contact__method {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--line);
  transition: color 200ms var(--ease);
}
.contact__method:hover { color: var(--accent); }
.contact__lbl {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.contact__val { font-size: var(--fs-base); color: inherit; font-weight: 500; }

@media (max-width: 600px) {
  .contact__methods { grid-template-columns: 1fr; }
}

/* ----- Footer ----- */
.foot {
  padding: var(--s-6) 0;
  background: var(--canvas);
  border-top: 1px solid var(--line);
}
.foot__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}
.foot__inner a:hover { color: var(--ink); }

/* ----- Reveal on scroll ----- */
.reveal {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

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

/* ----- CV page ----- */
.cv {
  padding: var(--s-12) var(--s-6) var(--s-16);
  max-width: 760px;
}

.cv__head { margin-bottom: var(--s-8); }
.cv__name { margin-bottom: var(--s-2); }
.cv__title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: var(--s-4);
}
.cv__contact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin-bottom: var(--s-6);
}
.cv__contact li { display: inline-flex; align-items: center; }
.cv__contact li + li::before {
  content: "·";
  margin-right: var(--s-3);
  color: var(--ink-faint);
}
.cv__contact a { color: inherit; }
.cv__contact a:hover { color: var(--accent); }

.cv__summary {
  font-size: var(--fs-lg);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 64ch;
  margin-bottom: var(--s-6);
}
.cv__actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.cv__section {
  padding-top: var(--s-8);
  margin-top: var(--s-8);
  border-top: 1px solid var(--line);
}
.cv__section-title {
  font-size: var(--fs-xl);
  margin-bottom: var(--s-6);
}

/* Each employer / institution is a self-contained group: a header (name +
   tenure) above an indented block of one or more roles, marked by its own
   vertical rule. The rule is separate per group, giving a uniform timeline. */
.cv__group + .cv__group { margin-top: var(--s-8); }
.cv__group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}
.cv__company { font-size: var(--fs-lg); font-weight: 600; color: var(--ink); }

.cv__roles {
  margin-top: var(--s-6);
  padding-left: var(--s-6);
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
}
.cv__role-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-4);
  margin-bottom: var(--s-2);
}
.cv__role { font-size: var(--fs-base); font-weight: 600; color: var(--ink); line-height: 1.3; }
.cv__dates {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  white-space: nowrap;
  flex-shrink: 0;
}
.cv__desc { color: var(--ink-soft); }
.cv__desc + .cv__desc { margin-top: var(--s-2); }

.cv__list {
  list-style: none;
  margin-top: var(--s-3);
}
.cv__list li {
  position: relative;
  padding-left: var(--s-4);
  color: var(--ink-soft);
  line-height: 1.6;
}
.cv__list li + li { margin-top: var(--s-2); }
.cv__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.cv__list strong { color: var(--ink); font-weight: 600; }

@media (max-width: 600px) {
  .cv { padding: var(--s-8) var(--s-6) var(--s-12); }
  .cv__roles { padding-left: var(--s-4); }
}

/* ----- Print ----- */
@media print {
  .nav, .foot, .hero__cta, .cv__actions { display: none; }
  body { background: #fff; color: #000; }
  .cv { padding: 0; max-width: none; }
  .cv__section { page-break-inside: auto; }
  .cv__group, .cv__role-head { page-break-inside: avoid; }
}
