/* Yaniv Efraim — personal site
   Editorial, text-first design. No framework, no build step.
   Body font: Rubik, self-hosted as a variable font (assets/fonts) — a warm, rounded Hebrew/Latin
   sans-serif, with a friendly system-sans fallback stack if it fails to load. Self-hosted instead
   of Google Fonts' CDN so no visitor IP/request ever reaches Google just to render the page. */

@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/rubik-hebrew.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/rubik-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #faf6ef;
  --surface: #f1e9db;
  --ink: #201d1a;
  --muted: #726b5e;
  --rule: #e2d8c4;
  --accent: #a8451f;
  --accent-dark: #833519;
  --btn-bg: #201d1a;
  --btn-text: #faf6ef;
  --btn-hover: #833519;
  --max: 640px;
}

[data-theme="dark"] {
  --bg: #1a1815;
  --surface: #262320;
  --ink: #f1ece1;
  --muted: #a29a89;
  --rule: #3b362d;
  --accent: #e58b5c;
  --accent-dark: #f3ac83;
  --btn-bg: #e58b5c;
  --btn-text: #1a1815;
  --btn-hover: #f3ac83;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Rubik", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header / nav */

header.site {
  border-bottom: 1px solid var(--rule);
  padding: 20px 0 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.logo {
  font-weight: bold;
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.2px;
}

nav.primary {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 16px;
}

nav.primary a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

nav.primary a:hover,
nav.primary a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

nav.primary a.btn-nav {
  color: var(--btn-text);
  background: var(--btn-bg);
  padding: 7px 14px;
  border-radius: 3px;
  border-bottom: none;
}

nav.primary a.btn-nav:hover {
  background: var(--btn-hover);
}

.toggles {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  line-height: 1;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  display: block;
}

/* Main content */

main {
  padding: 56px 0 40px;
}

main.narrow .wrap { max-width: var(--max); }

h1 {
  font-size: 38px;
  line-height: 1.2;
  margin: 0 0 6px;
}

h2 {
  font-size: 23px;
  margin: 44px 0 12px;
}

h3 {
  font-size: 19px;
  margin: 0 0 4px;
}

p { margin: 0 0 20px; }

.lede {
  font-size: 21px;
  color: var(--muted);
  margin-bottom: 34px;
}

.dateline {
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
  margin: -8px 0 34px;
}

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

ul.plain, ol.plain {
  padding-inline-start: 22px;
  margin: 0 0 20px;
}

ul.plain li, ol.plain li { margin-bottom: 10px; }

.hairline {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}

/* Buttons */

.btn {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-text) !important;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 3px;
  font-size: 17px;
  font-family: inherit;
}

.btn:hover { background: var(--btn-hover); }

.btn.large { padding: 18px 32px; font-size: 19px; }

.btn.outline {
  background: transparent;
  color: var(--ink) !important;
  border: 1px solid var(--ink);
}

.btn.outline:hover {
  background: var(--ink);
  color: #fff !important;
}

/* Home hero */

.hero p:first-of-type { margin-top: 0; }

.cta-row {
  margin: 34px 0 8px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.cta-row .fine {
  color: var(--muted);
  font-size: 15px;
}

/* Card links (home quick nav) */

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 48px 0 0;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 18px 18px 20px;
  text-decoration: none;
  color: var(--ink);
}

.card:hover { border-color: var(--ink); }

.kicker {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 6px;
}

p.kicker { margin-top: 28px; }

.will-note {
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}

.will-note a { font-style: normal; }

.card strong { font-size: 17px; }

@media (max-width: 700px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* Writing entries (reuse .entry from Work, add a format badge) */

.entry .badge {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px 10px;
  margin-inline-start: 8px;
  vertical-align: middle;
}

.entry .open-link {
  font-size: 15px;
  display: inline-block;
  margin-top: 6px;
}

/* Now page lists */

.now-block {
  margin-bottom: 36px;
}

.now-block h2 { margin-top: 0; }

/* Work entries */

.entry {
  margin-bottom: 34px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--rule);
}

.entry:last-of-type { border-bottom: none; }

.entry .meta {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 6px;
}

.entry .result {
  font-size: 16px;
  margin-top: 8px;
}

.entry .result strong { color: var(--ink); }

.stats {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  margin: 30px 0 10px;
}

.stats div { min-width: 100px; }

.stats .num {
  font-size: 30px;
  font-weight: bold;
  display: block;
  line-height: 1.1;
}

.stats .label {
  color: var(--muted);
  font-size: 14px;
}

/* Contact page */

.contact-box {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 34px;
  text-align: center;
  margin: 30px 0;
}

.contact-box p { margin-bottom: 24px; }

/* Legal pages (accessibility / privacy / terms) */

.legal-placeholder {
  background: var(--surface);
  border: 1px dashed var(--rule);
  border-radius: 4px;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 20px;
}

.legal-updated {
  color: var(--muted);
  font-size: 14px;
  margin-top: 40px;
}

/* Footer */

footer.site {
  border-top: 1px solid var(--rule);
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: 14px;
}

footer.site .wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

footer.site .foot-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
}

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

.foot-legal { margin: 0; }
.foot-legal a { margin-inline-end: 4px; }

.social-icons {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.social-icons a {
  display: inline-flex;
  color: var(--muted);
}

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

.social-icons svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 480px) {
  body { font-size: 17px; }
  h1 { font-size: 32px; }
  main { padding-top: 40px; }
}
