/* SPA page sections */
.page-section { display: none; }
.page-section.active { display: block; }

/* ============================================================
   Jaanus Terasmaa — koduleht
   Radical minimalist: warm near-black, warm white, sparse color.
   Color meaning:  blue = links/interactive · green = now/ongoing/available
                   red  = the signature line (strongest emphasis, rare)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Space+Mono:wght@400;700&family=Roboto+Slab:wght@900&display=swap');

:root {
  --bg:        #080807;
  --bg-2:      #100f0d;
  --bg-3:      #18161300;
  --ink:       #f3f1ec;
  --ink-dim:   #a4a29a;
  --ink-faint: #6c6a62;
  --line:        rgba(243,241,236,0.12);
  --line-soft:   rgba(243,241,236,0.07);
  --line-strong: rgba(243,241,236,0.24);

  --blue:  oklch(0.72 0.13 240);
  --green: oklch(0.74 0.15 152);
  --red:   oklch(0.65 0.21 27);
  --blue-dim:  oklch(0.72 0.13 240 / 0.16);
  --green-dim: oklch(0.74 0.15 152 / 0.16);

  --font: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;

  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--bg); }

/* ---- language toggle visibility ---- */
html[data-lang="et"] [data-l="en"] { display: none !important; }
html[data-lang="en"] [data-l="et"] { display: none !important; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
.section { padding-block: clamp(64px, 9vw, 140px); }
.section--tight { padding-block: clamp(48px, 6vw, 90px); }

/* hairline rule */
.rule { height: 1px; background: var(--line); border: 0; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.site-head__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 16px var(--pad);
  display: flex; align-items: center; gap: 28px;
}
.brand {
  display: flex; align-items: baseline; gap: 12px;
  text-decoration: none; color: var(--ink);
  font-weight: 700; letter-spacing: -0.02em; font-size: 18px;
  white-space: nowrap;
}
.brand__mark {
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  border: 1px solid var(--line-strong); border-radius: 50%;
  width: 30px; height: 30px; display: grid; place-items: center;
  letter-spacing: 0; flex: none;
}
.brand__role {
  font-family: var(--mono); font-size: 11px; font-weight: 400;
  color: var(--ink-faint); letter-spacing: 0.02em;
}
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--ink-dim); text-decoration: none;
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em;
  padding: 8px 12px; border-radius: 7px;
  transition: color .18s, background .18s;
}
.nav a:hover { color: var(--ink); background: var(--bg-2); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; display: block; height: 1.5px; background: var(--blue);
  margin-top: 3px; border-radius: 2px;
}

/* language toggle */
.lang {
  display: inline-flex; border: 1px solid var(--line-strong);
  border-radius: 999px; overflow: hidden; font-family: var(--mono);
  font-size: 11px; flex: none;
}
.lang button {
  background: none; border: 0; color: var(--ink-faint);
  font: inherit; cursor: pointer; padding: 6px 11px; letter-spacing: 0.04em;
  transition: color .18s, background .18s;
}
.lang button[aria-pressed="true"] { color: var(--bg); background: var(--ink); }
.lang button:hover:not([aria-pressed="true"]) { color: var(--ink); }

/* mobile nav toggle */
.nav-toggle { display: none; }

/* ---------- eyebrow / labels ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 400;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--line-strong);
}
.eyebrow--plain::before { display: none; }

/* ---------- type ---------- */
h1, h2, h3 { font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; }
.display {
  font-size: clamp(48px, 9.5vw, 132px); font-weight: 800;
  letter-spacing: -0.045em; line-height: 0.92;
}
.h-sec { font-size: clamp(28px, 4vw, 46px); letter-spacing: -0.035em; }
.lede { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.5; color: var(--ink); font-weight: 400; }
.dim { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.mono { font-family: var(--mono); }

/* signature line — the ONE place red lives */
.signature {
  color: var(--red); font-style: normal; font-weight: 600;
  letter-spacing: -0.01em;
}
em.q { font-style: italic; }

/* ---------- links ---------- */
a.link {
  color: var(--ink); text-decoration: none;
  background-image: linear-gradient(var(--blue), var(--blue));
  background-size: 0% 1.5px; background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .25s ease, color .2s;
}
a.link:hover { color: var(--blue); background-size: 100% 1.5px; }

/* ---------- buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  padding: 13px 22px; border-radius: 999px; cursor: pointer;
  text-decoration: none; border: 1px solid var(--line-strong);
  color: var(--ink); background: none;
  transition: border-color .2s, background .2s, color .2s, transform .2s;
}
.btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: translateY(-1px); }
.btn--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--primary:hover { background: transparent; color: var(--ink); }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- focus grid ---------- */
.focus-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.focus-cell {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 30px 28px 34px; min-height: 210px;
  display: flex; flex-direction: column; gap: 18px;
  transition: background .25s;
}
.focus-cell:hover { background: var(--bg-2); }
.focus-cell .ico { width: 34px; height: 34px; color: var(--ink); }
.focus-cell h3 { font-size: 20px; letter-spacing: -0.02em; }
.focus-cell p { font-size: 14.5px; color: var(--ink-dim); line-height: 1.5; margin-top: -6px; }
.focus-cell .idx { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); margin-top: auto; }

/* ---------- highlight cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 24px 22px; display: flex; flex-direction: column; gap: 14px;
  background: var(--bg-2); text-decoration: none; color: var(--ink);
  transition: border-color .22s, transform .22s, background .22s;
  min-height: 230px;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.card__kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint);
  display: flex; align-items: center; gap: 9px;
}
.card__title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.card__meta { font-size: 13.5px; color: var(--ink-dim); margin-top: auto; }
.card__cta { font-size: 14px; color: var(--blue); font-weight: 600; display: inline-flex; gap: 7px; align-items: center; }

/* status dot */
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot--green { background: var(--green); box-shadow: 0 0 0 4px var(--green-dim); }
.dot--blue  { background: var(--blue);  box-shadow: 0 0 0 4px var(--blue-dim); }

/* status tag */
.tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-dim); white-space: nowrap;
}
.tag--now { color: var(--green); border-color: color-mix(in oklab, var(--green) 40%, transparent); }
.tag--rec { color: var(--green); border-color: color-mix(in oklab, var(--green) 42%, transparent); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- list rows (writings / talks) ---------- */
.list { border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 116px 1fr auto;
  gap: 28px; align-items: baseline;
  padding: 22px 4px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  transition: background .2s, padding-left .2s;
}
.row:hover { background: var(--bg-2); padding-left: 16px; }
.row__date { font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); padding-top: 4px; letter-spacing: -0.02em; }
.row__main { display: flex; flex-direction: column; gap: 6px; }
.row__title { font-size: clamp(18px, 2vw, 22px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; }
.row:hover .row__title { color: var(--ink); }
.row__sub { font-size: 14px; color: var(--ink-dim); display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.row__venue { color: var(--ink-dim); }
.row__right { display: flex; align-items: center; gap: 12px; padding-top: 4px; }
.row__arrow { color: var(--ink-faint); transition: transform .2s, color .2s; }
.row:hover .row__arrow { color: var(--blue); transform: translate(3px,-3px); }
.row--static { cursor: default; }
.row--static:hover { background: none; padding-left: 4px; }
.row--static .row__arrow { display: none; }

/* year heading inside lists */
.year {
  font-family: var(--mono); font-size: 13px; color: var(--ink-faint);
  letter-spacing: 0.1em; padding: 30px 0 10px;
}

/* ---------- filter bar ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.filters__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-right: 6px; }
.chip {
  font-size: 13.5px; font-weight: 500; color: var(--ink-dim);
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: none;
  transition: color .18s, border-color .18s, background .18s;
}
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.chip .ct { font-family: var(--mono); font-size: 11px; opacity: .6; margin-left: 3px; }

/* ---------- page hero (interior pages) ---------- */
.page-hero { padding-block: clamp(44px, 7vw, 92px) clamp(26px, 4vw, 48px); }
.page-hero h1 { font-size: clamp(40px, 7vw, 88px); font-weight: 800; letter-spacing: -0.045em; line-height: 0.94; margin-top: 14px; }
.page-hero .lede { margin-top: 26px; max-width: 40ch; }
.page-hero .motto { color: var(--red); font-weight: 600; }

/* sticky-ish filter wrapper */
.filterbar {
  position: sticky; top: 63px; z-index: 20;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  padding-block: 16px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

/* subsection heading inside the talks area */
.sub-h {
  display: flex; align-items: baseline; gap: 14px;
  padding: 46px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.sub-h h2 { font-size: clamp(22px, 3vw, 32px); letter-spacing: -0.03em; }
.sub-h .ct { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.sub-h__desc { font-size: 14px; color: var(--ink-dim); margin-left: auto; max-width: 34ch; text-align: right; }

/* ---------- video cards ---------- */
.vgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 16px; margin-top: 24px; }
.vcard { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 11px; }
.vcard__thumb {
  position: relative; aspect-ratio: 16/9; border-radius: 11px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
}
.vcard__thumb img { width: 100%; height: 100%; object-fit: cover; display: block;
  filter: grayscale(0.25) contrast(1.02); transition: transform .4s ease, filter .4s ease; }
.vcard:hover .vcard__thumb img { transform: scale(1.05); filter: grayscale(0) contrast(1.05); }
.vcard__play {
  position: absolute; inset: 0; margin: auto; width: 46px; height: 46px;
  display: grid; place-items: center; border-radius: 50%;
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  border: 1.5px solid rgba(255,255,255,0.85); color: #fff;
  backdrop-filter: blur(2px); transition: background .25s, transform .25s;
}
.vcard:hover .vcard__play { background: var(--blue); border-color: var(--blue); transform: scale(1.08); }
.vcard__play svg { width: 16px; height: 16px; margin-left: 2px; }
.vcard__title { font-size: 15.5px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; }
.vcard:hover .vcard__title { color: var(--blue); }
.vcard__meta { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: -0.01em; }

/* ---------- blog list (blogi.html) ---------- */
.blog-row {
  display: block; padding: 26px 4px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  transition: background .2s, padding-left .2s;
}
.blog-row:hover { background: var(--bg-2); padding-left: 16px; }
.blog-row__date { font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); letter-spacing: -0.02em; }
.blog-row__title { font-size: clamp(19px, 2.2vw, 24px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; margin-top: 8px; }
.blog-row:hover .blog-row__title { color: var(--blue); }
.blog-row__excerpt { font-size: 15px; color: var(--ink-dim); line-height: 1.6; margin-top: 8px; max-width: 68ch; }
.blog-row__more { font-size: 13.5px; color: var(--blue); font-weight: 600; margin-top: 10px; display: inline-flex; gap: 6px; align-items: center; }
.blog-row:hover .blog-row__more .arr { transform: translateX(3px); }
.blog-row__more .arr { transition: transform .2s; }

/* ---------- blog post (article prose) ---------- */
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 18px; }
.post-meta .mono { font-size: 12.5px; color: var(--ink-faint); }
.post-article { max-width: 68ch; }
.post-article p { margin-bottom: 32px; font-size: 17px; line-height: 1.9; color: var(--ink-dim); }
.post-article h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 700; letter-spacing: -0.02em; margin: 64px 0 26px; }
.post-article h2:first-child { margin-top: 0; }
.post-article h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin: 44px 0 20px; }
.post-article strong { color: var(--ink); font-weight: 600; }
.post-article a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.post-article a:hover { color: var(--blue); text-decoration-color: var(--blue); }
.post-article blockquote {
  border-left: 3px solid var(--blue); background: var(--blue-dim);
  padding: 18px 22px; border-radius: 0 8px 8px 0; margin: 28px 0;
  font-size: 17px; line-height: 1.65; color: var(--ink);
}
.post-article ul, .post-article ol { margin: 0 0 20px 22px; color: var(--ink-dim); font-size: 17px; line-height: 1.75; }
.post-article li { margin-bottom: 8px; }
.post-back {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--ink-dim); font-size: 14px; font-weight: 500;
  transition: color .18s;
}
.post-back:hover { color: var(--blue); }
.post-back .arr { transition: transform .2s; }
.post-back:hover .arr { transform: translateX(-3px); }

/* ---------- feature link (case study card) ---------- */
.feature-link {
  display: block; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-left: 3px solid var(--blue);
  border-radius: 0 12px 12px 0; padding: 26px 30px;
  background: var(--bg-2);
  transition: border-color .2s, background .2s, transform .2s;
}
.feature-link:hover { border-color: var(--line-strong); border-left-color: var(--blue); background: var(--bg-3); transform: translateX(2px); }
.feature-link__tag {
  display: inline-block; font-size: 11.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--blue); margin-bottom: 12px;
}
.feature-link__title { display: block; font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; letter-spacing: -0.025em; margin-bottom: 10px; }
.feature-link__desc { display: block; font-size: 14.5px; line-height: 1.6; color: var(--ink-dim); max-width: 64ch; }
.feature-link__cta { display: inline-block; margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--blue); transition: transform .2s; }
.feature-link:hover .feature-link__cta { transform: translateX(4px); }

/* ---------- explore strip ---------- */
.explore { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.explore a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px;
  text-decoration: none; color: var(--ink);
  transition: border-color .2s, background .2s;
}
.explore a:hover { border-color: var(--line-strong); background: var(--bg-2); }
.explore__t { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.explore__d { font-size: 13.5px; color: var(--ink-dim); }
.explore .arr { color: var(--ink-faint); transition: transform .2s, color .2s; }
.explore a:hover .arr { color: var(--blue); transform: translateX(4px); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: clamp(48px, 7vw, 84px); }

.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.foot-grid h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); font-weight: 400; margin-bottom: 16px; }
.foot-links { display: flex !important; flex-direction: column !important; gap: 9px; }
.foot-links a, .foot-links span { color: var(--ink) !important; text-decoration: underline; text-decoration-color: rgba(243,241,236,0.3); text-underline-offset: 3px; font-size: 14.5px; transition: color .18s, text-decoration-color .18s; }
.foot-links a:hover { color: var(--ink) !important; text-decoration-color: var(--ink); }
.foot__name { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.foot__sig { color: var(--red); font-size: 14px; margin-top: 10px; max-width: 30ch; }
.foot__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }

/* ---------- short-bio two-col grid ---------- */
.bio-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: clamp(32px, 6vw, 90px);
}

.bio-photo { margin-top: 22px; }
.bio-photo img {
  display: block; width: auto; max-width: 100%; height: auto;
  max-height: 360px;            /* keep desktop height within the text block */
  border-radius: 12px; border: 1px solid var(--line);
}
.bio-photo figcaption { margin-top: 10px; font-size: 12.5px; line-height: 1.4; }
.bio-photo figcaption a {
  color: var(--ink-dim); text-decoration: none;
  border-bottom: 1px solid var(--line-strong); padding-bottom: 1px;
  transition: color .18s, border-color .18s;
}
.bio-photo figcaption a:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- hero (shared bits) ---------- */
.hero { position: relative; padding-block: clamp(56px, 11vw, 130px) clamp(40px, 6vw, 80px); }
.hero__name { font-size: clamp(52px, 11vw, 150px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.88; }
.hero__role { font-size: clamp(17px, 2.2vw, 22px); color: var(--ink-dim); font-weight: 400; letter-spacing: -0.01em; margin-top: 22px; }
.hero__sig { font-size: clamp(20px, 2.6vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-top: 28px; max-width: 18ch; }
.hero__bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: -1;
}
.hero__drop {
  position: absolute; right: -6%; top: 50%; transform: translateY(-50%);
  width: min(46vw, 540px); height: auto; color: var(--line-strong); opacity: .5;
}

/* Entrance motion intentionally omitted: content is always visible by default.
   Tasteful motion lives in hover/focus transitions + smooth scrolling, which
   never risk hiding content. The .reveal class is kept as an inert hook. */
.reveal { opacity: 1; }

/* ---------- project cards (research page) ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.proj-card {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 22px 20px 18px; background: var(--bg-2);
  display: flex; flex-direction: column; gap: 10px;
}
.proj-card__period { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: -0.01em; }
.proj-card__name { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.proj-card__desc { font-size: 13.5px; color: var(--ink-dim); line-height: 1.5; }
.proj-card__foot { margin-top: auto; padding-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.role-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.role-tag--lead { color: var(--green); border: 1px solid color-mix(in oklab, var(--green) 38%, transparent); }
.role-tag--partner { color: var(--ink-faint); border: 1px solid var(--line); }
.funder { font-size: 12.5px; color: var(--ink-faint); }

/* ---------- app cards (web apps page) ---------- */
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.app-card {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 22px 22px; background: var(--bg-2);
  display: flex; flex-direction: column; gap: 14px;
  text-decoration: none; color: var(--ink);
  transition: border-color .2s, transform .2s;
}
.app-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.app-card__ico { width: 42px; height: 42px; color: var(--ink); flex: none; }
.app-card__name { font-size: 20px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.app-card__desc { font-size: 14px; color: var(--ink-dim); line-height: 1.5; flex-grow: 1; }
.app-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.app-card__open {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--blue);
  text-decoration: none; transition: gap .2s;
}
.app-card__open:hover { gap: 12px; }

/* ---------- two-col content layout (research) ---------- */
.res-grid { display: grid; grid-template-columns: 220px 1fr; gap: clamp(32px, 5vw, 72px); }
.res-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); padding-top: 6px; }
.res-h { font-size: clamp(22px, 2.5vw, 30px); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 22px; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-row { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.tl-row:first-child { padding-top: 0; }
.tl-year { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); padding-top: 3px; }
.tl-body { font-size: 15.5px; }
.tl-body strong { font-weight: 600; letter-spacing: -0.01em; }
.tl-body .dim { font-size: 14px; display: block; margin-top: 3px; }
.art-row { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.art-row__title { font-size: 15px; line-height: 1.4; }
.art-row__meta { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }
.award-list { display: flex; flex-direction: column; gap: 0; }
.award-row { display: flex; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.award-year { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); min-width: 44px; padding-top: 2px; }
.profile-links { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-link {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink);
  text-decoration: none; transition: border-color .2s, background .2s, color .2s;
}
.profile-link:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  body { font-size: 17px; }
  .focus-grid { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .vgrid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .app-grid { grid-template-columns: repeat(2, 1fr); }
  .res-grid { grid-template-columns: 1fr; gap: 8px; }
  .res-label { padding-bottom: 4px; }
  .sub-h { flex-wrap: wrap; }
  .sub-h__desc { margin-left: 0; text-align: left; width: 100%; }
  .filterbar { top: 0; }
  .explore { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .row { grid-template-columns: 1fr auto; gap: 14px; }
  .row__date { grid-column: 1 / -1; padding-top: 0; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--pad) 16px; z-index: 49; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; font-size: 16px; border-bottom: 1px solid var(--line-soft); }
  .nav a[aria-current="page"]::after { display: none; }
  .nav .lang { margin: 12px 4px 4px; align-self: flex-start; }
  .nav-toggle { display: inline-grid; place-items: center; margin-left: auto;
    width: 40px; height: 40px; background: none; border: 1px solid var(--line-strong);
    border-radius: 9px; color: var(--ink); cursor: pointer; }
  .hero__drop { opacity: .18; right: -10%; width: min(52vw, 300px); }
  .bio-grid { grid-template-columns: 1fr; gap: 18px; }
  .hero__role { font-size: clamp(16px, 4vw, 20px); }
  /* photo above text, clearly narrower than full page width */
  .bio-photo { max-width: 200px; }
  .bio-photo img { max-height: none; width: 100%; max-width: 200px; }
}
@media (max-width: 520px) {
  .focus-grid { grid-template-columns: 1fr; }
  .vgrid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: 1fr; }
  .tl-row { grid-template-columns: 80px 1fr; }
  .hero__drop { display: none; }
  .btn-row { gap: 10px; }
  .btn { font-size: 14px; padding: 10px 18px; }
  .bio-photo { max-width: 170px; }
  .bio-photo img { max-width: 170px; }
}
