/* ============================================
   YANIRK.COM — MODERN MINIMALIST (SUBTLE RETRO) v2
   Content lives inside a thick-bordered frame.
   Background squares animate in the gutters around it.
   ============================================ */

/* Self-hosted retro display font */
@font-face {
  font-family: 'bionic';
  src: url('bionic_type.ttf');
  font-display: swap;
}

/* Self-hosted display font for content section headers */
@font-face {
  font-family: 'Orbitron';
  src: url('fonts/Orbitron-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Self-hosted body font (from /fonts) */
@font-face {
  font-family: 'Open Sans Local';
  src: url('fonts/OpenSans-Regular-webfont.woff') format('woff'),
       url('fonts/OpenSans-Regular-webfont.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans Local';
  src: url('fonts/OpenSans-Semibold-webfont.woff') format('woff'),
       url('fonts/OpenSans-Semibold-webfont.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans Local';
  src: url('fonts/OpenSans-Bold-webfont.woff') format('woff'),
       url('fonts/OpenSans-Bold-webfont.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ====== Design tokens ====== */
:root {
  /* Surfaces */
  --bg: #ede4cf;            /* warm cream page background */
  --surface: #faf5e6;       /* frame interior — warmer white */
  --surface-2: #ffffff;     /* tiny accent surfaces */

  /* Ink */
  --ink: #15140e;
  --ink-soft: #3a352b;
  --ink-mute: #7a7466;

  /* Border — deep forest green (replaces black) */
  --border: #0c4427;
  --border-soft: #c9bfa5;

  /* Accents */
  --accent: #1aa15f;            /* phosphor green */
  --accent-bright: #26c97a;
  --accent-glow: rgba(26, 161, 95, 0.16);
  --accent-trace: rgba(26, 161, 95, 0.45);

  --accent-warm: #e26a3a;       /* coral — for variety on background squares */
  --accent-warm-trace: rgba(226, 106, 58, 0.45);

  --border-trace: rgba(13, 53, 32, 0.35);

  /* Layout */
  --sidebar-w: 250px;
  --bw: 3px;
  --bw-small: 2px;
  --bw-lg: 5px;          /* main frame border */
  --frame-pad: 32px;     /* gutter around the frame */
}

/* ====== Reset / base ====== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Open Sans Local', system-ui, -apple-system, 'Segoe UI', Roboto, 'Open Sans', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
a:hover { color: var(--accent-bright); border-bottom-color: var(--accent-bright); }

strong { font-weight: 700; }

/* ====== Background animation layer ====== */
.bg-squares {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Parallax wrapper — positioned absolutely, shifted by scroll.
   Independent of the inner square's idle animation. */
.bg-squares .square-wrap {
  position: absolute;
  will-change: transform;
  transform: translateY(calc(var(--scroll-y, 0px) * var(--parallax-factor, 0) * -1));
}

.bg-squares .square {
  position: absolute;
  inset: 0;
  border-style: solid;
  border-width: var(--bw);
  border-color: var(--border-trace);
  opacity: 0;
  background: transparent;
  will-change: rotate, translate, opacity;
  animation:
    sq-rotate var(--dur-rot, 90s) linear infinite,
    sq-drift  var(--dur, 60s)     ease-in-out infinite,
    sq-fade   var(--dur-fade, 14s) ease-in-out infinite;
}
.bg-squares .square.tint-green { border-color: var(--accent-trace); }
.bg-squares .square.tint-warm  { border-color: var(--accent-warm-trace); }

@keyframes sq-rotate {
  from { rotate: var(--rot-start, 0deg); }
  to   { rotate: calc(var(--rot-start, 0deg) + var(--rot-dir, 360deg)); }
}
@keyframes sq-drift {
  0%, 100% { translate: 0 0; }
  50%      { translate: var(--dx, 40px) var(--dy, -50px); }
}
@keyframes sq-fade {
  0%, 100% { opacity: 0.14; }
  50%      { opacity: 0.38; }
}
@keyframes sq-twinkle {
  0%, 100% { opacity: 0.08; }
  50%      { opacity: 0.65; }
}

/* Tiny "starfield" squares twinkle with higher contrast */
.bg-squares .square.small {
  border-width: var(--bw-small);
  animation-name: sq-rotate, sq-drift, sq-twinkle;
}

@media (prefers-reduced-motion: reduce) {
  .bg-squares .square { animation: none; opacity: 0.22; }
  .bg-squares .square.small { opacity: 0.35; }
  .bg-squares .square-wrap { transform: none; }
  html { scroll-behavior: auto; }
}

/* ====== Layout (transparent positioning grid — not a box itself) ====== */
.frame {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  max-width: 1180px;
  width: 100%;
  padding: var(--frame-pad);
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  gap: var(--frame-pad);
}

/* ====== Sidebar — its own box, sized to its content ====== */
.sidebar {
  background: var(--surface);
  border: var(--bw-lg) solid var(--border);
  box-shadow: 6px 6px 0 var(--border-trace);
  padding: 28px 24px 22px;
  display: flex;
  flex-direction: column;
  align-self: start;
  max-height: 100%;
  overflow-y: auto;
}

.brand {
  margin-bottom: 32px;
  position: relative;
}

/* Brand figure — a person made of boxes (per Yanir's animation design):
   face with asymmetric eyes, two hands, two feet, invisible body */
.brand-figure {
  position: relative;
  width: 120px;
  height: 122px;
  margin: 0 0 18px 0;
}
.brand-figure .bf {
  position: absolute;
  background: transparent;
  border: var(--bw) solid var(--border);
  display: block;
}
.brand-figure .face {
  width: 60px; height: 60px;
  top: 0; left: 30px;
}
.brand-figure .eye-l {
  /* Filled accent square — gives the character a hint of phosphor color */
  width: 8px; height: 8px;
  top: 35px; left: 56px;
  b-ackground: var(--accent);
  background: #337733;
  border: none;
}
.brand-figure .eye-r {
  /* Outlined, slightly larger and offset for asymmetry */
  width: 10px; height: 10px;
  top: 34px; left: 70px;
  border-width: 2px;
}
.brand-figure .hand {
  width: 16px; height: 16px;
  top: 72px;
}
.brand-figure .hand-l { left: 0; }
.brand-figure .hand-r { left: 104px; }
.brand-figure .foot {
  width: 18px; height: 18px;
  top: 100px;
}
.brand-figure .foot-l { left: 42px; }
.brand-figure .foot-r { left: 64px; }

.brand-name {
  font-family: 'bionic', 'Open Sans Local', system-ui, sans-serif;
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 4px 0;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1.15;
}

.brand-tag {
  margin: 0;
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
  letter-spacing: 0.02em;
}

.primary-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.primary-nav li { margin: 0 0 2px 0; }

.primary-nav a {
  display: block;
  padding: 9px 12px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-left: 3px solid transparent;
  border-bottom: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.primary-nav a:hover {
  background: var(--accent-glow);
  border-left-color: var(--accent);
  color: var(--accent);
}
.primary-nav a[aria-current="page"] {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-glow);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 24px;
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
}

/* ====== Main content — its own fixed-size box, scrolls internally ====== */
.content {
  position: relative;
  background: var(--surface);
  border: var(--bw-lg) solid var(--border);
  box-shadow: 6px 6px 0 var(--border-trace);
  padding: 56px 52px 84px;
  min-width: 0;
  overflow-y: auto;
  /* No height set — fills the grid cell (1fr row) by default stretch */
}

.bio {
  margin: 0 0 72px 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.75;
  max-width: 540px;
  text-wrap: pretty;
}
.bio p { margin: 0 0 16px 0; }
.bio a { border-bottom: 1px solid var(--accent-trace); }
.bio a:hover { border-bottom-color: var(--accent-bright); }

/* The "bottom line" — first sentence of the bio. Larger, darker,
   set apart by a phosphor-green underline. */
.bio-lead {
  font-size: 18px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin: 0 0 22px 0 !important;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--accent-trace);
}

/* Section heading */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 24px 0;
  padding-bottom: 14px;
  border-bottom: var(--bw-lg) solid var(--border);
}
.section-head h2 {
  font-family: 'Orbitron', 'Open Sans Local', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--ink);
}
.section-head .count {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.12em;
}

/* ====== Publications ====== */
.publications article {
  display: flex;
  gap: 26px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border-soft);
  align-items: flex-start;
  margin: 0;
  width: 100%;
  cursor: pointer;
  transition: background 0.18s ease;
}
.publications article:last-of-type { border-bottom: none; }
/* Article immediately before the dashed separator: skip the thin line
   so we don't get a doubled separator */
.publications article:has(+ .VerticalSeparatorLine) { border-bottom: none; }

.publications article:hover {
  background: rgba(26, 161, 95, 0.04);
}

.publications article img {
  width: 168px;
  flex-shrink: 0;
  border: var(--bw) solid var(--border);
  background: var(--surface-2);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.publications article:hover img {
  border-color: var(--accent);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--accent-trace);
}

.publications article .text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* Title link = first <a> inside .text */
.publications article .text > a:first-of-type {
  display: inline-block;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.35;
  border-bottom: none;
  letter-spacing: -0.005em;
}
.publications article:hover .text > a:first-of-type {
  color: var(--accent);
}

/* Venue: label-style, no border, on its own line */
.publications article venue {
  display: block;
  width: fit-content;
  margin-top: 12px;
  padding: 3px 10px;
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-glow);
  border: none;
  text-transform: uppercase;
}

.publications article nav {
  margin-top: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  text-align: left;
}
.publications article nav a {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 2px 0;
  border-bottom: 1px solid var(--ink);
  position: relative;
  z-index: 2;
}
.publications article nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Override the legacy gif-based Separator */
.publications article nav .Separator,
.publications nav .Separator {
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--ink-mute);
  margin: 0 14px;
  vertical-align: middle;
  border: none;
  background-image: none;
}

.VerticalSeparatorLine {
  width: 100%;
  height: 0;
  margin: 36px 0 0 0;
  border-bottom: var(--bw) dashed var(--border-soft);
  background: none;
}

/* ====== Generic content sections (stuff/code_data/contact pages) ====== */
.content-section {
  margin-bottom: 56px;
}
.content-section:last-of-type {
  margin-bottom: 0;
}

.content-section p,
.content-section ul,
.content-section ol {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 14px 0;
}
.content-section ul,
.content-section ol {
  padding-left: 22px;
}
.content-section li {
  margin-bottom: 4px;
}
.content-section em { font-style: italic; }
.content-section strong { color: var(--ink); }

.content-section a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-trace);
}
.content-section a:hover {
  color: var(--accent-bright);
  border-bottom-color: var(--accent-bright);
}

/* Embedded media */
.content-section iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: var(--bw) solid var(--border);
  margin: 6px 0 14px;
  background: var(--surface-2);
}
.content-section video {
  display: block;
  width: 100%;
  height: auto;
  border: var(--bw) solid var(--border);
  margin: 6px 0 14px;
  background: var(--surface-2);
}

/* In-section nav (download links etc.) — same retro chip style as publications nav */
.content-section nav {
  margin: 8px 0 14px;
  text-align: left;
}
.content-section nav a {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 2px 0;
  border-bottom: 1px solid var(--ink);
}
.content-section nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.content-section nav .Separator {
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--ink-mute);
  margin: 0 14px;
  vertical-align: middle;
  border: none;
  background-image: none;
}

/* Image grids */
.image-grid-3,
.image-grid-2 {
  display: grid;
  margin: 14px 0;
  gap: 6px;
}
.image-grid-3 { grid-template-columns: repeat(3, 1fr); }
.image-grid-2 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
.image-grid-3 img,
.image-grid-2 img {
  width: 100%;
  height: auto;
  display: block;
  border: var(--bw) solid var(--border);
  background: var(--surface-2);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.image-grid-3 a:hover img,
.image-grid-2 a:hover img {
  border-color: var(--accent);
  transform: translate(-1px, -1px);
}

.image-caption {
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
  margin: 6px 0 18px;
  font-style: italic;
}

/* Standalone image inside a content section (e.g. paper teaser) */
.content-section > img {
  display: block;
  max-width: 100%;
  height: auto;
  border: var(--bw) solid var(--border);
  background: var(--surface-2);
  margin: 14px 0;
}

/* Inline table — used in resume timeline and the SPRender showcase */
.content-section table.inline {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.content-section table.inline td {
  padding: 8px 14px 8px 0;
  vertical-align: top;
}
.content-section table.inline td:first-child {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
}

/* Image table (SPRender) — two-column grid of images with captions */
.image-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 8px;
  margin: 12px -8px;
}
.image-table td {
  vertical-align: top;
  padding: 0;
  width: 50%;
}
.image-table img {
  width: 100%;
  height: auto;
  display: block;
  border: var(--bw) solid var(--border);
  background: var(--surface-2);
}
.image-table td br + small,
.image-table td > small {
  display: block;
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}

/* Responsive content sections */
@media (max-width: 820px) {
  .image-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .content-section { margin-bottom: 40px; }
}
@media (max-width: 480px) {
  .image-grid-3,
  .image-grid-2 { grid-template-columns: 1fr; }
  .image-table td { display: block; width: 100%; margin-bottom: 12px; }
}

/* ====== Mobile menu toggle ====== */
.menu-toggle {
  display: none;
  background: var(--surface);
  border: var(--bw) solid var(--border);
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
}

/* ====== Responsive ====== */
@media (max-width: 1100px) {
  :root {
    --sidebar-w: 220px;
    --frame-pad: 24px;
  }
  .content { padding: 48px 40px 72px; }
}

@media (max-width: 820px) {
  :root {
    --frame-pad: 24px;
    --bw-lg: 4px;
  }
  body { font-size: 14px; }

  .frame {
    /* Mobile: normal document flow so the page can scroll naturally */
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: var(--frame-pad);
  }
  .sidebar {
    /* Sized to content. flex-wrap lets the menu open onto a new line,
       which grows the box itself and pushes the content box down. */
    align-self: stretch;
    max-height: none;
    overflow: visible;
    padding: 14px 18px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
  }
  .brand {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 22px;
    margin-bottom: 0;
    min-width: 0;
  }
  .brand-text {
    flex: 1;
    min-width: 0;
  }
  .brand-figure {
    width: 56px;
    height: 57px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .brand-figure .face   { width: 32px; height: 32px; top: 0;  left: 14px; }
  .brand-figure .eye-l  { width: 5px;  height: 5px;  top: 17px; left: 26px; }
  .brand-figure .eye-r  { width: 6px;  height: 6px;  top: 16px; left: 34px; border-width: 1.5px; }
  .brand-figure .hand   { width: 8px;  height: 8px;  top: 36px; border-width: 2px; }
  .brand-figure .hand-l { left: 0; }
  .brand-figure .hand-r { left: 48px; }
  .brand-figure .foot   { width: 9px;  height: 9px;  top: 48px; border-width: 2px; }
  .brand-figure .foot-l { left: 20px; }
  .brand-figure .foot-r { left: 30px; }
  .brand-name { font-size: 19px; margin-bottom: 0; }
  .brand-tag { font-size: 11px; }
  .menu-toggle { display: flex; }
  .primary-nav {
    /* When hidden: takes no space. When open: takes a full new flex line
       inside the sidebar, growing the box and pushing content down. */
    display: none;
    flex: 0 0 100%;
    width: 100%;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 2px solid var(--border-soft);
  }
  .primary-nav.open { display: block; }
  .sidebar-foot { display: none; }

  .content {
    padding: 32px 22px 60px;
    overflow-y: visible;
    /* Sized to its content on mobile — page scrolls naturally */
  }

  .bio { margin-bottom: 56px; font-size: 15px; max-width: none; }

  /* Keep the two-column row layout on mobile, but shrink the thumbnail */
  .publications article {
    gap: 16px;
    padding: 18px 0;
  }
  .publications article img {
    width: 110px;
  }
  .publications article .text > a:first-of-type {
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .content { padding: 24px 16px 56px; }
  .brand-name { font-size: 17px; }
  .brand-tag { display: none; }
  .publications article {
    gap: 12px;
  }
  .publications article img {
    width: 88px;
  }
}

/* ==============================================
   BRAND FIGURE DANCE ANIMATION
   Pure overlay — uses transforms on top of static
   positions. The static design is unaffected.
   To remove the animation: delete everything
   between the BEGIN and END markers below.
   ============================================== */
/* BEGIN BRAND DANCE */

.brand-figure {
  /* Full cycle: 2s. Breakdown:
       0      → 0.3s  (0%   → 15%)  move state 1 → state 2
       0.3s   → 0.6s  (15%  → 30%)  hold state 2
       0.6s   → 0.9s  (30%  → 45%)  move state 2 → state 1
       0.9s   → 2.0s  (45%  → 100%) hold state 1 (long rest)
     Edit --dance-cycle to slow/speed everything proportionally. */
  --dance-cycle: 2s;
}

/* Face: counter-clockwise semicircle arc, 15px to the left.
   The eyes share this animation so they ride along. */
@keyframes face-dance {
  0%         { transform: translate(0, 0); }
  3.75%      { transform: translate(-1px, -5.3px); }
  7.5%       { transform: translate(-4px, -7.5px); }
  11.25%     { transform: translate(-7px, -5.3px); }
  15%, 30%   { transform: translate(-8px, 0); }
  33.75%     { transform: translate(-7px, -5.3px); }
  37.5%      { transform: translate(-4px, -7.5px); }
  41.25%     { transform: translate(-1px, -5.3px); }
  45%, 100%  { transform: translate(0, 0); }
}

/* Left hand: state 1 tucked under face (center at face's left edge);
   arcs down briefly then up-and-out to sit beside the face, with its
   bottom edge slightly below the face's bottom. */
@keyframes hand-l-dance {
  0%, 100%   { transform: translate(22px, 0); }
  3.75%      { transform: translate(20px, 3px); }
  7.5%       { transform: translate(13px, 0px); }
  11.25%     { transform: translate(5px, -10px); }
  15%, 30%   { transform: translate(0, -24px); }
  33.75%     { transform: translate(5px, -10px); }
  37.5%      { transform: translate(13px, 0px); }
  41.25%     { transform: translate(20px, 3px); }
  45%        { transform: translate(22px, 0); }
}

/* Right hand: mirror of left hand */
@keyframes hand-r-dance {
  0%, 100%   { transform: translate(-22px, 0); }
  3.75%      { transform: translate(-20px, 3px); }
  7.5%       { transform: translate(-13px, 0px); }
  11.25%     { transform: translate(-5px, -10px); }
  15%, 30%   { transform: translate(0, -24px); }
  33.75%     { transform: translate(-5px, -10px); }
  37.5%      { transform: translate(-13px, 0px); }
  41.25%     { transform: translate(-20px, 3px); }
  45%        { transform: translate(-22px, 0); }
}

/* Right foot: straight-line slide 80% of its width to the right */
@keyframes foot-r-dance {
  0%, 100%   { transform: translate(0, 0); }
  15%, 30%   { transform: translate(14.4px, 0); }
  45%        { transform: translate(0, 0); }
}

.brand-figure .face,
.brand-figure .eye-l,
.brand-figure .eye-r {
  animation: face-dance var(--dance-cycle) linear infinite;
}
.brand-figure .hand-l { animation: hand-l-dance var(--dance-cycle) linear infinite; }
.brand-figure .hand-r { animation: hand-r-dance var(--dance-cycle) linear infinite; }
.brand-figure .foot-r { animation: foot-r-dance var(--dance-cycle) linear infinite; }

/* On mobile the figure is roughly half-size. We override the keyframes
   in-place so the same animation-name + timing still work. */
@media (max-width: 820px) {
  @keyframes face-dance {
    0%         { transform: translate(0, 0); }
    3.75%      { transform: translate(-1px, -3px); }
    7.5%       { transform: translate(-2px, -4px); }
    11.25%     { transform: translate(-4px, -3px); }
    15%, 30%   { transform: translate(-4px, 0); }
    33.75%     { transform: translate(-4px, -3px); }
    37.5%      { transform: translate(-2px, -4px); }
    41.25%     { transform: translate(-1px, -3px); }
    45%, 100%  { transform: translate(0, 0); }
  }
  @keyframes hand-l-dance {
    0%, 100%   { transform: translate(10px, 0); }
    3.75%      { transform: translate(9px, 1px); }
    7.5%       { transform: translate(6px, 0px); }
    11.25%     { transform: translate(2px, -3px); }
    15%, 30%   { transform: translate(0, -10px); }
    33.75%     { transform: translate(2px, -3px); }
    37.5%      { transform: translate(6px, 0px); }
    41.25%     { transform: translate(9px, 1px); }
    45%        { transform: translate(10px, 0); }
  }
  @keyframes hand-r-dance {
    0%, 100%   { transform: translate(-10px, 0); }
    3.75%      { transform: translate(-9px, 1px); }
    7.5%       { transform: translate(-6px, 0px); }
    11.25%     { transform: translate(-2px, -3px); }
    15%, 30%   { transform: translate(0, -10px); }
    33.75%     { transform: translate(-2px, -3px); }
    37.5%      { transform: translate(-6px, 0px); }
    41.25%     { transform: translate(-9px, 1px); }
    45%        { transform: translate(-10px, 0); }
  }
  @keyframes foot-r-dance {
    0%, 100%   { transform: translate(0, 0); }
    15%, 30%   { transform: translate(7px, 0); }
    45%        { transform: translate(0, 0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-figure .face,
  .brand-figure .eye-l,
  .brand-figure .eye-r,
  .brand-figure .hand-l,
  .brand-figure .hand-r,
  .brand-figure .foot-r {
    animation: none;
  }
}

/* END BRAND DANCE */
