@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Hebrew project names only ("חשבון כיף", "פרטים") — loads on demand. */
@font-face {
  font-family: "Frank Ruhl Libre";
  src: url("/fonts/frank-ruhl-hebrew.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

:root {
  --bg: #f5efe4;
  --surface: #fbf8f1;
  --ink: #1d1711;
  --ink-2: #564a3c;
  --muted: #766956;      /* 4.7:1 on --bg */
  --line: #e2d8c5;
  --line-strong: #cbbda3;
  --accent: #9a4f17;     /* cognac, 5.7:1 on --bg */
  --accent-soft: rgba(154, 79, 23, 0.1);
  --shadow: 0 1px 2px rgba(64, 42, 16, 0.05), 0 14px 32px -18px rgba(64, 42, 16, 0.28);
  --shadow-lift: 0 2px 4px rgba(64, 42, 16, 0.06), 0 28px 48px -22px rgba(64, 42, 16, 0.38);
  --serif: "Fraunces", "Frank Ruhl Libre", "New York", Georgia, ui-serif, serif;
  --sans: "Geist", "Frank Ruhl Libre", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --nav-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

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

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 40px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 30;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================ NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 239, 228, 0.82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-right: auto;
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  padding: 4px 0;
}
.nav-cta {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--bg);
  background: var(--ink);
  padding: 9px 16px;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.15s ease;
}
.nav-cta:hover { background: var(--accent); }
.nav-cta:active { transform: scale(0.97); }

/* ============================================ HERO */
.hero { padding: 96px 0 112px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 500px;
  gap: 56px;
  align-items: center;
}
h1 {
  font-family: var(--serif);
  font-size: clamp(42px, 6.6vw, 92px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.0;
  margin-top: 20px;
  max-width: 13ch;
  text-wrap: balance;
}
h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-sub {
  margin-top: 28px;
  max-width: 46ch;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}
.hero-actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn::after { content: "↓"; transition: transform 0.25s var(--ease); }
.btn:hover { background: var(--accent); }
.btn:hover::after { transform: translateY(3px); }
.btn:active { transform: scale(0.97); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 calc(100% - 9px) / 0 1.5px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) 0 calc(100% - 9px) / 100% 1.5px no-repeat;
  transition: color 0.3s ease, background-size 0.45s var(--ease);
}
.link-arrow::after { content: "↗"; font-size: 0.9em; transition: transform 0.25s var(--ease); }
.link-arrow:hover { color: var(--accent); background-size: 100% 1.5px, 100% 1.5px; }
.link-arrow:hover::after { transform: translate(2px, -2px); }
.link-arrow.quiet { color: var(--ink-2); font-weight: 400; }

.stats {
  margin-top: 44px;
  max-width: 560px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 24px;
}
.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
}
.stat dt { font-size: 14px; color: var(--ink-2); }
.stat dd {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* Intro: copy rises in. */
@keyframes rise {
  from { opacity: 0; translate: 0 18px; }
  to   { opacity: 1; translate: 0 0; }
}
.hero-copy > * { animation: rise 0.8s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: 0.06s; }
.hero-copy > :nth-child(3) { animation-delay: 0.14s; }
.hero-copy > :nth-child(4) { animation-delay: 0.22s; }

/* ============================================ HERO DECK
   Five highlight cards held like a hand of cards. Every card rotates around
   ONE pivot far below the deck, so the fan reads as a hand, not tilted boxes.
   JS deals them in and sets --x / --r per card; hover spreads the hand. */
.deck {
  position: relative;
  height: 420px;
  --card-w: 268px;
}
.deck-card {
  position: absolute;
  left: 50%;
  top: 70px;
  width: var(--card-w);
  margin-left: calc(var(--card-w) / -2);
  transform-origin: 50% 300%;
  transform: translateX(var(--x, 0px)) translateY(calc(var(--y, 0px) + var(--lift, 0px))) rotate(var(--r, 0deg));
  z-index: var(--z, 1);
  transition: transform 0.6s var(--ease), filter 0.3s ease, opacity 0.3s ease;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(64, 42, 16, 0.08), 0 22px 40px -20px rgba(64, 42, 16, 0.45);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  outline: none;
}
.deck-card img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.deck-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px 12px;
  border-bottom: 1px solid var(--line);
}
.deck-foot .glyph { width: 24px; height: 24px; border-radius: 6px; }
.deck-name { font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.deck-tag { margin-left: auto; font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; }
/* The light that runs once around the edge of the card you point at. */
.deck-lap { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.deck-lap rect { x: 1px; y: 1px; width: calc(100% - 2px); height: calc(100% - 2px); fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 0.18 0.82; stroke-dashoffset: 1; opacity: 0; }
.deck-card:hover .deck-lap rect, .deck-card:focus-visible .deck-lap rect { animation: lap 0.9s var(--ease) both; }
@keyframes lap {
  0%   { stroke-dashoffset: 1; opacity: 0; }
  12%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.deck:hover .deck-card:not(:hover):not(:focus-visible) { filter: saturate(0.7) brightness(0.97); }
.deck-card:hover, .deck-card:focus-visible { --lift: -26px; z-index: 20; }
.deck-card:focus-visible { box-shadow: 0 0 0 3px var(--accent), 0 22px 40px -20px rgba(64, 42, 16, 0.45); }
.deck-hint { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ============================================ BLOCK HEADS */
.block-head {
  padding-top: 28px;
  border-top: 1px solid var(--ink);
}
.block-head h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.block-head p {
  margin-top: 14px;
  max-width: 56ch;
  color: var(--ink-2);
  font-size: 18px;
  text-wrap: pretty;
}

/* ============================================ SELECTED */
.selected { padding-top: 0; }
#featured-root { margin-top: 56px; border-top: 1px solid var(--line); }
.feature {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 56px;
  align-items: center;
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}
.feature:last-child { border-bottom: 0; }
.feature:nth-child(even) .feature-media { order: 2; }
.feature-media {
  display: block;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(29, 23, 17, 0.12);
  box-shadow: var(--shadow);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.feature-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}
.feature-media:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.feature-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.feature-index {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.feature-name {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  font-family: var(--serif);
  font-size: clamp(34px, 3.6vw, 48px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.feature-name .glyph { width: 44px; height: 44px; border-radius: 11px; }
.feature-line {
  margin-top: 12px;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 500;
  text-wrap: balance;
}
.feature-body { margin-top: 12px; color: var(--ink-2); max-width: 52ch; text-wrap: pretty; }
.feature-facts { margin-top: 20px; border-top: 1px solid var(--line); }
.feature-facts li {
  position: relative;
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  color: var(--ink);
}
.feature-facts li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 19px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.feature-links { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 4px 28px; }

/* Shared bits */
/* Sweep: an accent underline grows in from the left and the text takes the
   accent color. Used on the contact email, nav, links and project names. */
.sweep,
.nav-links a,
.contact-links a {
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1.5px no-repeat;
  transition: color 0.3s ease, background-size 0.45s var(--ease);
}
.sweep:hover,
a.card:hover .sweep,
.nav-links a:hover,
.contact-links a:hover {
  color: var(--accent);
  background-size: 100% 1.5px;
}
.feature-name .sweep { background-size: 0 2px; padding-bottom: 2px; }
.feature-name .sweep:hover { background-size: 100% 2px; }

.glyph {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(29, 23, 17, 0.08);
}
.tags { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 5px;
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  white-space: nowrap;
}
.tag-status { color: var(--accent); border-color: transparent; background: var(--accent-soft); }

/* ============================================ ALL WORK */
.work { padding-top: 72px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter:active { transform: scale(0.97); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter-count { font-family: var(--mono); font-size: 11px; opacity: 0.7; }

.section { margin-top: 56px; }
.section[hidden] { display: none; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.section-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.section-count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.section-line { flex: 1; height: 1px; background: var(--line); align-self: center; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px 28px;
}
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
}
.card-media {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(29, 23, 17, 0.12);
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s ease;
}
.card-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
a.card:hover .card-media {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
}
a.card:hover .card-media img { transform: scale(1.04); }
a.card:active .card-media { transform: translateY(-1px); }
.card-head { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.card-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-right: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-desc { margin-top: 8px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.card-url {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.card-url::after { content: " ↗"; }
a.card:hover .card-url { color: var(--accent); }

/* Scroll reveal — only when JS is running (html.js), so nothing is ever
   hidden without the script that un-hides it. */
.js .reveal { opacity: 0; translate: 0 22px; transition: opacity 0.7s var(--ease), translate 0.7s var(--ease); }
.js .reveal.in { opacity: 1; translate: 0 0; }
.grid .reveal:nth-child(3n + 2) { transition-delay: 0.06s; }
.grid .reveal:nth-child(3n + 3) { transition-delay: 0.12s; }

/* Shown only when JavaScript is unavailable and the grid never renders. */
.noscript-msg {
  max-width: 560px;
  margin: 40px 0;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-2);
  font-size: 15px;
}
.noscript-msg a { color: var(--accent); }

/* ============================================ CONTACT */
.contact { margin-top: 112px; padding-top: 28px; padding-bottom: 96px; }
.contact::before {
  content: "";
  display: block;
  height: 1px;
  background: var(--ink);
  margin-bottom: 28px;
}
.contact-mail {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--serif);
  font-size: clamp(28px, 5.4vw, 72px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: color 0.3s ease, background-size 0.5s var(--ease);
}
.contact-mail:hover { color: var(--accent); background-size: 100% 2px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 4px 32px; margin-top: 28px; }
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  color: var(--ink-2);
}
.contact-links a::after { content: "↗"; font-size: 0.85em; }

.footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 24px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.footer-mark { height: 28px; width: auto; opacity: 0.8; }

/* ============================================ RESPONSIVE */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; align-items: start; }
  .deck { height: 360px; max-width: 520px; width: 100%; margin: 0 auto; --card-w: 260px; }
  .deck-card { top: 50px; }
  .feature { grid-template-columns: 1fr; gap: 28px; padding: 48px 0; }
  .feature:nth-child(even) .feature-media { order: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid .reveal:nth-child(n) { transition-delay: 0s; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .nav-links { display: none; }
  .hero { padding: 48px 0 72px; }
  .hero-sub { font-size: 16.5px; }
  .stat dd { font-size: 32px; }
  .stats { margin-top: 36px; }
  .deck { height: 290px; --card-w: 200px; }
  .deck-card { top: 40px; border-radius: 12px; }
  .deck-foot { padding: 8px 10px 9px; gap: 8px; }
  .deck-foot .glyph { width: 20px; height: 20px; }
  .deck-name { font-size: 15px; }
  .deck-tag { display: none; }
  .stat dt { font-size: 12.5px; }
  .grid { grid-template-columns: 1fr; gap: 36px; }
  .feature-line { font-size: 18px; }
  .section { margin-top: 44px; }
  .contact { margin-top: 80px; padding-bottom: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy > *, .stats { animation: none; }
  .deck-card { transition: none; }
  .deck-card:hover .deck-lap rect, .deck-card:focus-visible .deck-lap rect { animation: none; }
  .js .reveal { opacity: 1; translate: none; transition: none; }
}
