/* Narya Bio, site styles. Plain CSS, no build step. */

/* ---------- Font (self-hosted Sora, weights 400 to 600 in one variable file, Latin subset, SIL OFL) ---------- */
@font-face {
  font-family: "Sora";
  src: url("../assets/fonts/sora.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ----------
   Warm off-white page, charcoal type and a ruby accent (also the dot in the logo).
   A cool pale slate marks the occasional section. The hero chip is dark
   polished silicon whose lit compartments shine ruby; the Origins illustration is a pale
   silicon schematic whose three sensors use ruby, bronze and slate teal. */
:root {
  --bg: #fcfaf8;          /* page background, warm and just off white */
  --bg-tint: #eef1f4;     /* occasional section in a cool pale slate (Team, Contact, publication cards) */
  --heading: #1f2327;
  --text: #2e3338;        /* body copy */
  --muted: #6b7280;       /* secondary lines */
  --muted-on-tint: #5e6470; /* secondary lines on the tint (#6b7280 falls to 4.26:1 there) */
  --accent: #9b1b30;      /* ruby: accents, links, the logo dot */
  --accent-hover: #7f1d2d;
  --line: #e8e1dd;        /* hairlines */
  --white: #ffffff;

  --sig-1: #9b1b30;       /* sensor colours for the three illustrated compartments, muted */
  --sig-2: #96704c;       /* to sit on the pale silicon: ruby, bronze, slate teal */
  --sig-3: #4e7482;

  --font-sans: "Sora", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section-space: clamp(3.5rem, 7vw, 6.5rem);

  color-scheme: light;
}

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

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

@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: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--heading);
  font-weight: 500;
  text-wrap: balance;
}

p {
  margin: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

a:hover {
  color: var(--accent-hover);
}

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

[id] {
  scroll-margin-top: 1.5rem;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--heading);
  color: var(--bg);
  font-size: 0.9375rem;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 5rem;
}

.wordmark {
  display: inline-flex;
  color: var(--heading);
  text-decoration: none;
}

.logo {
  display: block;
  height: 2rem;
  width: auto;
}

.logo-type { fill: currentColor; }
.logo-dot { fill: var(--accent); }

.nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  color: var(--text);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav a:hover {
  color: var(--accent-hover);
}

@media (max-width: 40em) {
  .nav-optional {
    display: none;
  }
}

/* ---------- Shared type ---------- */
.eyebrow {
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Section headings (Origins, Team, Contact): large, above the section content */
.section-label {
  color: var(--heading);
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.625rem, 1.2rem + 1.5vw, 2.375rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.prose h2 {
  margin-bottom: 1.75rem;
}

.prose p + p {
  margin-top: 1.25rem;
}

.prose p {
  max-width: 64ch;
}

/* The hero text and the Origins paragraph are justified; hyphenation keeps the word gaps even on narrow screens */
.lead,
.origins .prose p {
  text-align: justify;
  hyphens: auto;
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(3.5rem, 8vw, 7rem) var(--section-space);
}

.hero-inner {
  display: grid;
  gap: clamp(3rem, 6vw, 5rem);
  align-items: center;
}

h1 {
  font-size: clamp(2rem, 1rem + 2.2vw, 2.875rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  max-width: 22ch;
}

.hero-fields {
  margin-top: 2rem;
}

.lead {
  margin-top: 1.75rem;
  max-width: 44ch;
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.6;
}

.hero-figure {
  width: 100%;
  max-width: 24rem;
  justify-self: center;
}

@media (min-width: 60em) {
  .hero-inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
  .hero-figure {
    max-width: 30rem;
    justify-self: end;
  }
}

/* Hero chip (inline SVG, decorative): a polished silicon die seen face on, drawn in ChatGPT from
   photos of the chip and imported by tools/hero_chip.py. Each compartment has a ruby signal layer
   (.hc-signal), dark at rest, that on hover lights in a diagonal wave, each to its own strength
   (--o) after its own delay (--d). With JavaScript on a mouse device,
   js/main.js replaces the wave with a glow that follows the pointer. */
.array { overflow: visible; }
.array .hc-decoration { pointer-events: none; }
.array .hc-signal {
  opacity: 0;
  transition: opacity 0.52s ease-out;
}

@media (hover: hover) {
  .array .hc-chip:hover .hc-signal {
    opacity: var(--o);
    transition-duration: 0.38s;
    transition-delay: var(--d);
  }
  /* the pointer glow sets each signal's opacity inline: follow it quickly, without the wave's delay */
  .array.is-following .hc-chip:hover .hc-signal {
    transition: opacity 0.14s ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  .array .hc-signal,
  .array .hc-chip:hover .hc-signal {
    transition: none;
  }
}

/* ---------- Sections ---------- */
/* The occasional pale slate section. Secondary text is darkened slightly there to keep AA contrast,
   and the hairlines next to the tint are dropped because the colour change already divides. */
.section--tint,
.contact {
  --muted: var(--muted-on-tint);
}

.section--tint {
  background: var(--bg-tint);
}

/* The headshots are cut out, so the transparent space above each head already adds air;
   Team therefore starts with less padding than the other sections */
#team {
  padding-top: calc(var(--section-space) * 0.6);
}

.section--tint .section-grid::before,
.section--tint + .section .section-grid::before {
  display: none;
}

.section {
  padding-block: var(--section-space);
}

.section-grid {
  position: relative;
  display: grid;
  gap: 1.5rem;
}

/* Hairline that starts each section, aligned with the content */
.section .section-grid::before {
  content: "";
  position: absolute;
  top: calc(var(--section-space) * -1);
  left: var(--gutter);
  right: var(--gutter);
  border-top: 1px solid var(--line);
}

@media (min-width: 56em) {
  .section-grid {
    grid-template-columns: minmax(10rem, 1fr) minmax(0, 3fr);
    gap: 2.5rem;
  }
}

/* ---------- Technology: text beside the zoomed illustration ---------- */
.tech {
  display: grid;
  gap: clamp(2.5rem, 5vw, 3.5rem);
}

/* Stacked sections (Technology, Team, Origins): the label sits above the content,
   which then uses the full width */
@media (min-width: 56em) {
  .section-grid.section-grid--stack {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
}

.expression .ex-svg {
  max-width: 44rem;
}

/* The illustration has room around the scene in which its dark panel fades into the page
   (tools/illustration.py: 12% of the scene width at each side, 7.2% at top and bottom). The
   svg is widened and pulled out by that much, so the scene keeps its size and only the soft
   fade spills past the column; the section clips it at the screen edge. */
#origins {
  overflow-x: clip;
}

/* Wide screens: two rows shared by both columns (subgrid). The origins text sits beside the
   animation; the Weizmann logo sits beside the caption, centred under the text and centred
   vertically on the caption. */
@media (min-width: 64em) {
  .tech {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-rows: auto auto;
    column-gap: 4rem;
    row-gap: 1.5rem;
  }
  .tech .origins,
  .tech .expression {
    grid-row: 1 / span 2;
    display: grid;
    grid-template-rows: subgrid;
    gap: 0;
  }
  .tech .origins-logo {
    align-self: center;
  }
  .tech .expression figcaption {
    align-self: center;
  }
}

.expression {
  margin: 0;
}

.expression .ex-svg {
  width: 124%;
  max-width: calc(44rem * 1.24);
  height: auto;
  margin: -7.2% -12%;
}

.ex-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  color: var(--text);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.ex-steps li {
  counter-increment: step;
}

.ex-steps li::before {
  content: "0" counter(step) " ";
  color: var(--accent);
}

.ex-steps li:not(:last-child)::after {
  content: "\2192";
  padding-inline: 0.6rem;
  color: var(--muted);
}

/* The step list and caption are centred under the illustration */
.expression figcaption {
  margin-top: 1.25rem;
  text-align: center;
}

.expression figcaption p {
  max-width: 48ch;
  margin: 0.75rem auto 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Enlarged silicon schematic in pale smoke grey: shallow etched recesses with graphite walls,
   fading into the page, so it bridges the dark hero chip and the light page */
.ex-bg { fill: url(#ex-bgg); }
.ex-bg-a { stop-color: var(--bg); }
.ex-bg-b { stop-color: var(--bg); }
.ex-top { fill: url(#ex-sheen); }
.ex-sheen-a { stop-color: #d5d9d5; }
.ex-sheen-b { stop-color: #a9b2b3; }
.ex-sheen-c { stop-color: #c9cfcb; }
.ex-top { stroke: #626d73; stroke-width: 0.6; }
.ex-rim { fill: none; stroke: #67767a; stroke-opacity: 0.75; stroke-width: 0.65; }
.ex-floor,
.ex-empty .ex-floor { fill: #bfc8c5; }
.ex-bottom-rim { fill: none; stroke: #e1e6df; stroke-opacity: 0.7; stroke-width: 0.55; }
.ex-empty .ex-rim { stroke-opacity: 0.55; }
.ex-fluid { fill: var(--c); fill-opacity: 0.025; }
/* Every vertical wall uses the same local top-to-bottom silicon fill. */
.ex-wall-b,
.ex-wall-l,
.ex-front { fill: url(#ex-wall); }
.ex-wall-a,
.ex-wall2-a { stop-color: #849094; }
.ex-wall-z,
.ex-wall2-z { stop-color: #b4bdbb; }
.ex-anchor { fill: var(--c); fill-opacity: 0.055; stroke: var(--c); stroke-width: 0.55; stroke-opacity: 0.22; }
.ex-padbase { fill: var(--c); fill-opacity: 0.045; stroke: var(--c); stroke-width: 0.55; stroke-opacity: 0.28; }
.ex-pad { fill: var(--c); fill-opacity: 0.09; stroke: var(--c); stroke-width: 0.7; stroke-opacity: 0.55; }
.ex-glow { fill: var(--c); fill-opacity: 0.035; }
.ex-contact { fill: #303b42; fill-opacity: 0.15; }
/* DNA double helix: half turns behind the axis are fainter, base pairs between the strands */
.ex-dna { fill: none; stroke: var(--c); stroke-linecap: round; stroke-linejoin: round; }
.ex-dna-f { stroke-width: 1.15; }
.ex-dna-b { stroke-width: 0.8; stroke-opacity: 0.4; }
.ex-rung { fill: none; stroke: var(--c); stroke-width: 0.65; stroke-opacity: 0.34; }
.ex-pol { fill: url(#ex-ball); }
.ex-ball-a { stop-color: #fcfaf8; }
.ex-ball-b { stop-color: #56666e; }
.ex-mrna { fill: none; stroke: var(--c); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 0.82; }
/* Abstract folded protein silhouettes: restrained shading and fine internal contours. */
.ex-prot-base { fill: var(--c); }
.ex-prot-shade { fill: url(#ex-sphere); }
.ex-g-hi { stop-color: var(--white); stop-opacity: 0.3; }
.ex-g-clear { stop-color: var(--white); stop-opacity: 0; }
.ex-g-clear-dark { stop-color: #273b3c; stop-opacity: 0; }
.ex-g-dark { stop-color: #273b3c; stop-opacity: 0.16; }
.ex-prot-line { fill: none; stroke: var(--c); stroke-opacity: 0.7; stroke-width: 4; }
.ex-marker line { stroke: #737e7d; stroke-width: 0.65; }
.ex-marker circle { fill: var(--bg); stroke: #a3abaa; stroke-width: 0.75; }
.ex-marker text { fill: var(--accent); font-size: 10px; font-weight: 500; }

/* keep the numbered markers legible when the figure is scaled down on phones */
@media (max-width: 40em) {
  .ex-marker circle { r: 13px; }
  .ex-marker text { font-size: 16px; }
  /* the scene runs the full screen width; its fade spills past the screen edge and is clipped */
  .expression .ex-svg {
    width: calc((100% + 2 * var(--gutter)) * 1.24);
    max-width: none;
    margin-inline: calc(var(--gutter) * -1 - (100% + 2 * var(--gutter)) * 0.12);
    margin-block: calc((100% + 2 * var(--gutter)) * -0.072);
  }
}

/* Scroll-linked animation: main.js drives every part from the scroll position, forwards
   when scrolling down and backwards when scrolling up. Without JavaScript, or with
   reduced motion, the final state is shown as is. */
.expression.is-armed .ex-dna,
.expression.is-armed .ex-mrna { stroke-dasharray: 1; }

/* ---------- Origins ---------- */
/* Logo above the text, in the column beside the illustration */
.origins {
  display: grid;
  gap: 2rem;
  align-items: start;
  padding-top: 0.5rem;
}

.origins-logo {
  display: block;
  width: min(22rem, 100%);
  justify-self: center;   /* centred under the origins text */
}

.origins-logo img {
  width: 100%;
  height: auto;
}

/* Key publications: a full-width row under the origins text and illustration.
   Journal and year are set prominently on each card. */
.papers {
  margin-top: clamp(2rem, 4vw, 3rem);
}

@media (min-width: 64em) {
  .tech {
    grid-template-rows: auto auto auto;
  }
  .tech .papers {
    grid-column: 1 / -1;
  }
}

.papers-title {
  font-size: 1.25rem;
  line-height: 1.3;
}

.papers-list {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48em) {
  .papers-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

.paper {
  padding: 1.25rem 1.5rem 1.4rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-tint);
  border-radius: 0 6px 6px 0;
}

.paper-venue {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.paper-year {
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
}

.paper-journal {
  color: var(--heading);
  font-size: 1.0625rem;
  font-weight: 600;
}

.paper-title {
  margin-top: 0.6rem;
  font-size: 1rem;
  line-height: 1.5;
}

.paper-ref {
  margin-top: 0.5rem;
  color: var(--muted-on-tint);
  font-size: 0.875rem;
}

/* ---------- Team ---------- */
.team {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.75rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

/* Wide screens: names stay on one line and set each column's minimum width; the bios (capped at
   16rem) take what room is left, wrapping narrower on smaller screens, and the four columns are
   spread across the full width */
@media (min-width: 64em) {
  .team {
    grid-template-columns: repeat(4, auto);
    justify-content: space-between;
    column-gap: clamp(1.5rem, 3vw, 3rem);
  }

  .person h3 {
    white-space: nowrap;
  }
}

.person img {
  width: 100%;
  max-width: 10rem;
  margin-inline: auto;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg-tint);
}

.person h3 {
  margin-top: 1.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
}

.person-role {
  margin-top: 0.35rem;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
}

.person-bio {
  max-width: 16rem;
  margin: 0.6rem auto 0;
  text-wrap: balance;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* ---------- Contact ---------- */
.contact {
  position: relative;
  padding-block: var(--section-space);
  background: var(--bg-tint);
}

/* A faint row of compartments along the top edge */
.contact::before {
  content: "";
  position: absolute;
  top: 1.5rem;
  left: 0;
  right: 0;
  height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='10'%3E%3Crect x='0.5' y='0.5' width='9' height='9' rx='2' fill='none' stroke='%239b1b30' stroke-opacity='0.2'/%3E%3C/svg%3E") repeat-x center;
}

.contact-text {
  max-width: 48ch;
  margin-top: 0.5rem;
  font-size: 1.125rem;
}

/* The email address is not written in the pages. Each [data-email-reveal] holds it spelled out
   in words, which is what shows without JavaScript. js/main.js swaps that for a "Show email
   address" button (.button here, .link-button inside the legal text) and, on a click, for the
   address as a link. */
.contact-email {
  display: flex;
  align-items: center;
  max-width: 48ch;
  min-height: 3rem; /* the button's height, so the page does not jump when the address replaces it */
  margin-top: 1.5rem;
}

.button {
  padding: 0.8rem 1.6rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--white);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-hover);
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.link-button:hover {
  color: var(--accent-hover);
}

.contact-link {
  color: var(--accent);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  overflow-wrap: anywhere;
}

.contact-link:hover {
  color: var(--accent-hover);
}

/* Marks content that still has to be supplied; remove the class once filled in */
.placeholder {
  outline: 1px dashed currentColor;
  outline-offset: 0.35em;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 2.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

.footer-links a + a {
  margin-left: 1.5rem;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--accent-hover);
}

/* ---------- Legal page ---------- */
.legal {
  padding-block: clamp(3rem, 7vw, 6rem) var(--section-space);
}

.legal h1 {
  max-width: none;
  margin-bottom: 2rem;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.legal h2 {
  margin: 3rem 0 1rem;
  font-size: 1.375rem;
}

