/* Elad Siman Tov: personal site. Plain CSS, no build step. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c1d21;
  --ink-2: #4a4c55;
  --ink-3: #7a7c86;
  --line: #e7e4dc;
  --accent: #c2531b;          /* the "elevation angle" orange */
  --accent-soft: #fbeee6;
  --link: #1f5f8b;            /* the "joint angle" blue */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 6px 24px rgba(20, 20, 30, .05);
  --max: 1060px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --surface: #1a1b20;
    --ink: #ecebe7;
    --ink-2: #b9b8b3;
    --ink-3: #8a8a88;
    --line: #2b2c33;
    --accent: #f08a4b;
    --accent-soft: #2a1d15;
    --link: #79b6e3;
    --shadow: none;
  }
  .figure img.diagram { filter: invert(.92) hue-rotate(180deg); }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16.5px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.85rem; margin: 0 0 1.4rem; }
h3 { font-size: 1.18rem; margin: 0 0 .35rem; }
p { margin: 0 0 1rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-3); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 100; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0 0 0 auto; padding: 0; overflow-x: auto; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav a.l { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .93rem; white-space: nowrap; }
.nav a.l:hover, .nav a.l.on { color: var(--ink); background: var(--accent-soft); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 320px; gap: 56px; align-items: center; }
.eyebrow { font: 500 .8rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); margin: 0 0 14px; }
.hero .role { font-size: 1.15rem; color: var(--ink-2); margin-bottom: 22px; }
.hero .lede { font-size: 1.06rem; max-width: 62ch; }
.hero-photo { margin: 0; }
.portrait { width: 320px; aspect-ratio: 4/5; border-radius: 22px; object-fit: cover; box-shadow: 0 18px 40px -18px rgba(20, 40, 60, .45); }
.hero-photo figcaption { font: 500 .74rem/1.4 var(--mono); color: var(--ink-3); margin-top: 10px; text-align: right; letter-spacing: .02em; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 500;
  transition: border-color .15s, transform .15s;
}
.btn:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { color: var(--bg); background: var(--accent); border-color: var(--accent); }

/* ---------- sections ---------- */
section.block { padding: 64px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head .muted { font-size: .92rem; }
.two { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: start; }

/* ---------- news ---------- */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 96px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.news li:last-child { border-bottom: 0; }
.news time, .news .when { font: 500 .82rem/1.9 var(--mono); color: var(--ink-3); text-transform: uppercase; }
.news .now { color: var(--accent); }
.tag { display: inline-block; font: 600 .7rem/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; padding: 4px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); vertical-align: 2px; margin-left: 4px; }

/* ---------- research ---------- */
.pillars { display: grid; gap: 14px; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: p; }
.pillars li { position: relative; padding: 16px 18px 16px 58px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pillars li::before { counter-increment: p; content: "0" counter(p); position: absolute; left: 18px; top: 16px; font: 600 .85rem/1.65 var(--mono); color: var(--accent); }
.pillars strong { display: block; font-family: var(--serif); font-size: 1.05rem; }
.figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.figure figcaption { font-size: .85rem; color: var(--ink-3); margin-top: 12px; }

.wide-figure { margin: 0 0 40px; }
.wide-figure img { border-radius: 10px; }

/* ---------- publications ---------- */
.pubs { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.pub { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.pub .title { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; margin-bottom: 4px; }
.pub .authors { color: var(--ink-2); font-size: .95rem; }
.pub .venue { font-style: italic; color: var(--ink-2); font-size: .95rem; }
.pub .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 500 .78rem/1 var(--mono); padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; }
a.chip:hover { border-color: var(--accent); color: var(--accent); }
.me { font-weight: 600; color: var(--ink); }
h3.sub { font-family: var(--sans); font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 36px 0 14px; }
.talks { list-style: none; padding: 0; margin: 0; }
.talks li { padding: 10px 0; border-bottom: 1px dashed var(--line); display: grid; grid-template-columns: 96px 1fr; gap: 20px; }
.talks li:last-child { border: 0; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card .media { aspect-ratio: 16/9; background: #fff; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.card .media img { width: 100%; height: 100%; object-fit: contain; }
.card .media.cover img { object-fit: cover; }
.card .media.code {
  background: radial-gradient(120% 120% at 0% 0%, #2b2f3a 0%, #15171c 60%);
  color: #d7dae0; font: 500 .82rem/1.55 var(--mono); place-items: stretch; padding: 18px 20px; text-align: left;
}
.card .media.code .c { color: #7d8590; }
.card .media.code .k { color: #f08a4b; }
.card .media.code .s { color: #9ecbff; }
.card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .body p { font-size: .94rem; color: var(--ink-2); margin: 0; }
.card .meta { font: 500 .75rem/1 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.card .foot { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.stack { font: 500 .72rem/1 var(--mono); padding: 5px 8px; border-radius: 6px; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr; }
.feature .media { aspect-ratio: auto; min-height: 260px; border-bottom: 0; border-right: 1px solid var(--line); }
.feature .body { padding: 26px 28px; }
.feature h3 { font-size: 1.4rem; }

/* course list */
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 32px; }
.course { padding: 16px 0; border-bottom: 1px solid var(--line); }
.course h3 { font-size: 1.05rem; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.course h3 a { color: var(--ink); text-decoration: none; }
.course h3 a:hover { color: var(--accent); }
.course .num { font: 500 .72rem/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
.course p { font-size: .93rem; color: var(--ink-2); margin: 4px 0 8px; }
.course .foot { display: flex; flex-wrap: wrap; gap: 6px; }

/* experience */
.xp { list-style: none; padding: 0; margin: 0; }
.xp li { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.xp li:last-child { border: 0; }
.xp .where { color: var(--ink-2); font-size: .95rem; grid-column: 1; }
.xp .when { font: 500 .8rem/1.9 var(--mono); color: var(--ink-3); grid-row: 1; grid-column: 2; }
.xp p { grid-column: 1 / -1; font-size: .94rem; color: var(--ink-2); margin: 4px 0 0; }

/* ---------- contact / footer ---------- */
.contact { text-align: center; padding: 80px 0; }
.contact h2 { font-size: 2.2rem; }
.contact p { color: var(--ink-2); max-width: 56ch; margin: 0 auto 24px; }
.contact .links { justify-content: center; }
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: .85rem; color: var(--ink-3); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- post ---------- */
.post { max-width: 760px; margin: 0 auto; padding: 56px 24px 24px; }
.post h1 { font-size: clamp(2rem, 4.4vw, 2.7rem); margin: 8px 0 14px; }
.post .dek { font-size: 1.15rem; color: var(--ink-2); }
.post h2 { font-size: 1.45rem; margin: 42px 0 12px; }
.post figure { margin: 28px 0; }
.post figure img { border-radius: 10px; border: 1px solid var(--line); }
.post figcaption { font-size: .85rem; color: var(--ink-3); margin-top: 8px; }
.post .callout { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 24px 0; }
.post .cite { font-size: .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.post .split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.back { font-size: .92rem; text-decoration: none; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { padding: 44px 0 40px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .hero-photo { order: -1; }
  .portrait { width: 100%; aspect-ratio: 16/10; object-position: 50% 62%; }
  .two { grid-template-columns: 1fr; }
  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature .media { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; aspect-ratio: 16/9; }
  .post .split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .brand { display: none; }
  .nav ul { margin: 0; }
  .news li, .talks li { grid-template-columns: 1fr; gap: 2px; }
  section.block { padding: 48px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
}

/* ---------- side study (research) ---------- */
.study { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: center; margin-top: 40px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; }
.study img { background: #fff; border-radius: 8px; }
.study h3 { font-size: 1.15rem; }
.study p { color: var(--ink-2); font-size: .97rem; margin: 0 0 8px; }
@media (prefers-color-scheme: dark) { .study img { filter: invert(.92) hue-rotate(180deg); } }

/* ---------- phase strip (Go2 lab) ---------- */
.phases { display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: center; margin: 2px 0 4px; padding: 0; list-style: none; }
.phases li { font: 500 .74rem/1 var(--mono); padding: 6px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.phases li + li::before { content: "→"; color: var(--ink-3); margin: 0 6px 0 -2px; }
.phases li.k { background: var(--ink); color: var(--bg); }
.eq { font: 500 .85rem/1.5 var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; color: var(--ink); overflow-x: auto; white-space: nowrap; }
.study > * { min-width: 0; }
@media (max-width: 860px) { .study { grid-template-columns: minmax(0, 1fr); padding: 18px; } .study img { width: 100%; max-width: 360px; margin: 0 auto; } }

/* ---------- lab video (research) ---------- */
.side-stack { display: grid; gap: 18px; }
.video-figure { padding: 10px; }
.video-wrap { position: relative; border-radius: 10px; overflow: hidden; background: #111; }
.video-wrap video { display: block; width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; }
.live-tag { position: absolute; left: 12px; top: 12px; font: 600 .7rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: rgba(0,0,0,.55); padding: 6px 9px 6px 22px; border-radius: 999px; backdrop-filter: blur(4px); }
.live-tag::before { content: ""; position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #f05a28; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.vid-btn { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; letter-spacing: -1px; backdrop-filter: blur(4px); }
.vid-btn:hover { background: rgba(0,0,0,.75); }
.video-figure figcaption { padding: 0 6px 4px; }
@media (prefers-reduced-motion: reduce) { .live-tag::before { animation: none; } }
