/* adritlath.com components. Requires tokens.css. */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + var(--space-3)); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: var(--leading-heading);
  margin: 0 0 var(--space-3);
}
h1 { font-size: var(--text-3xl); line-height: var(--leading-display); letter-spacing: -0.025em; }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
p { margin: 0 0 var(--space-3); max-width: var(--measure); }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); }

img, iframe { max-width: 100%; border-radius: var(--radius); }

.page { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }

/* Navbar */
.nav {
  position: sticky; top: 0; z-index: 10;
  height: var(--nav-height);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav .page { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.nav__name { font-family: var(--font-serif); font-weight: 400; font-size: var(--text-lg); color: var(--accent); text-decoration: none; white-space: nowrap; }
.nav__links { display: flex; gap: var(--space-4); list-style: none; margin: 0; padding: 0; }
.nav__links a { font-size: var(--text-sm); font-weight: 500; letter-spacing: 0.02em; color: var(--text-muted); text-decoration: none; padding: var(--space-2) 0; border-bottom: 2px solid transparent; }
.nav__links a:hover { color: var(--text); }
.nav__links a[aria-current="true"] { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 560px) {
  .nav__links { gap: var(--space-3); }
  .nav__name { font-size: var(--text-base); }
}
/* Below 520px the name and five links do not fit one row. Hide the name; the page title shows it. */
@media (max-width: 520px) {
  .nav__name { display: none; }
  .nav__links { width: 100%; justify-content: space-between; }
  /* The hero has a LinkedIn button; drop the navbar link so the theme switch fits. */
  .nav__li-ext { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 0.6rem 1.1rem;
  font: 600 var(--text-sm)/1 var(--font-sans);
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--accent);
  text-decoration: none; cursor: pointer;
}
.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--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent); color: var(--on-accent); }

/* Hero: photo, title, lead, CTA row (sits right below the navbar) */
/* Same two columns as the sections below: photo in the label column, text in the body column. */
.hero { padding: var(--space-7) 0 var(--space-6); display: flex; flex-direction: column; align-items: center; gap: var(--space-5); text-align: center; }
.hero__photo { display: block; width: 176px; height: 176px; aspect-ratio: 1; object-fit: cover; object-position: 50% 30%; border-radius: 50%; border: 1px solid var(--border); }
.hero__text { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.hero h1 { margin-bottom: var(--space-4); }
/* Standfirst: the opening paragraph in the serif, as a magazine sets its deck. */
.hero__lead { font-family: var(--font-serif); font-size: 1.625rem; line-height: 1.4; color: var(--text); max-width: 38ch; margin: 0 auto var(--space-4); text-wrap: balance; }
.hero__note { font-size: var(--text-base); color: var(--text-muted); max-width: var(--measure); margin: 0 auto; }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-5); }
@media (max-width: 640px) {
  .hero { padding-top: var(--space-5); }
  .hero__photo { width: 144px; height: 144px; }
  .hero__lead { font-size: 1.375rem; }
}

/* Section: two columns, label left and content right */
main { counter-reset: sec; }
.section { padding: var(--space-7) 0; border-top: 1px solid var(--border); }
.section__title { font-size: var(--text-2xl); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: var(--space-6); counter-increment: sec; }
/* Kicker: a small mono number above each section title. */
.section__title::before { content: counter(sec, decimal-leading-zero); display: block; margin-bottom: var(--space-3); font: 500 var(--text-xs)/1 var(--font-mono); letter-spacing: var(--tracking-label); color: var(--accent); }

.row { display: grid; grid-template-columns: var(--label-col) minmax(0, 1fr); gap: var(--space-4) var(--space-6); padding: var(--space-5) 0; }
.row__label { color: var(--text-muted); font-size: var(--text-sm); }
.row__label strong { display: block; color: var(--text); font-family: var(--font-serif); font-size: var(--text-lg); font-weight: 400; line-height: var(--leading-heading); margin-bottom: var(--space-2); }
.row__date { display: inline-block; margin-bottom: var(--space-1); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: var(--tracking-label); text-transform: uppercase; }
.row__body ul { padding-left: 1.2em; margin: 0 0 var(--space-3); max-width: var(--measure); }
.row__body li { margin-bottom: var(--space-2); }
@media (max-width: 760px) {
  .row { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
}

/* Media */
.figure { margin: var(--space-3) 0; }
.figure figcaption { color: var(--text-muted); font-size: var(--text-xs); letter-spacing: 0.02em; margin-top: var(--space-3); }
.video { position: relative; aspect-ratio: 16 / 9; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Footer: a terracotta band; text uses on-accent so it reads in both themes. */
.footer { margin-top: var(--space-7); padding: var(--space-6) 0 var(--space-5); background: var(--accent); color: var(--on-accent); }
.footer__top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4) var(--space-5); }
.footer__name { margin: 0; font-family: var(--font-serif); font-size: var(--text-2xl); line-height: var(--leading-display); }
.footer__tag { margin: var(--space-2) 0 0; font-size: var(--text-base); opacity: 0.85; }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font: 500 var(--text-xs)/1.3 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.footer a { color: var(--on-accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--on-accent) 45%, transparent); padding-bottom: 2px; }
.footer a:hover { border-bottom-color: var(--on-accent); }
.footer a:focus-visible { outline-color: var(--on-accent); }
.footer__legal { max-width: none; margin: var(--space-5) 0 0; padding-top: var(--space-3); border-top: 1px solid color-mix(in srgb, var(--on-accent) 30%, transparent); font-size: var(--text-xs); opacity: 0.8; }

/* Logo: one-color mark of an employer or school. The filter token flips it for dark theme. */
.logo { display: block; height: 32.5px; width: auto; max-width: 100%; filter: var(--logo-filter); margin-bottom: var(--space-2); }
.logo--tall { height: 55px; }
.logo--text { font-family: var(--font-serif); font-size: calc(var(--text-lg) * 1.25); line-height: 1.2; color: var(--accent); filter: none; height: auto; }

/* Image logo: drawn in the accent color. The image moves out of view and its drop-shadow is drawn back in place.
   This works from a plain file as well as from a server, which a CSS mask does not. */
.logo--img { overflow: hidden; width: fit-content; filter: none; }
.logo--img img { display: block; height: 100%; width: auto; transform: translateX(-2000px); filter: drop-shadow(2000px 0 0 var(--accent)); }

/* Theme switch in the navbar. Shows the sun in dark theme and the moon in light theme. */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; background: transparent; border: 0; border-radius: var(--radius-pill); color: var(--text-muted); cursor: pointer; }
.theme-toggle:hover { color: var(--text); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.nav__links { align-items: center; }

.row__label, .row__body { min-width: 0; }
@media (max-width: 400px) { .nav__links { gap: var(--space-2); } }

.logo--wide { height: 24px; }
