/* =========================================================
   Tzvi Ben David - personal landing page
   "Blueprint" theme. Mobile-first. RTL Hebrew.
   Phase A (skeleton). Fable's finishing layer lives in fable.css.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --ink: #0B2239;
  --ink-deep: #071829;
  --draft: #67C7EB;
  --draft-dim: #2E5F7A;
  --paper: #F6F3EC;
  --paper-line: #E3DDCF;
  --amber: #F5A623;
  --wa-green: #25D366;
  --text-on-dark: #EAF2F8;
  --text-on-paper: #16344E;

  --font-display: 'Suez One', serif;
  --font-body: 'Assistant', sans-serif;
  /* Latin/digits render in Plex Mono; Hebrew glyphs fall through to Assistant
     (IBM Plex Mono has no Hebrew - without this it hits an ugly system mono). */
  --font-mono: 'IBM Plex Mono', 'Assistant', sans-serif;

  --wrap: 1120px;
  --radius-card: 12px;
  --radius-pill: 999px;
  --nav-h: 64px;

  --grid-gap: 40px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-on-paper);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.15; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

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

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 200;
  background: var(--amber);
  color: var(--ink-deep);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* Reveal-on-scroll (gated behind html.js) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

.section { padding-block: 64px; position: relative; }
.section--paper { background: var(--paper); color: var(--text-on-paper); }
.section--ink { background: var(--ink); color: var(--text-on-dark); }

/* Drafting grid textures */
.section--ink::before,
.section--paper::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.section--ink::before {
  background-image:
    linear-gradient(to right, var(--draft-dim) 1px, transparent 1px),
    linear-gradient(to bottom, var(--draft-dim) 1px, transparent 1px);
  background-size: var(--grid-gap) var(--grid-gap);
  opacity: .12;
}
.section--paper::before {
  background-image:
    linear-gradient(to right, var(--paper-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--paper-line) 1px, transparent 1px);
  background-size: var(--grid-gap) var(--grid-gap);
  opacity: .5;
}
.section > .wrap { position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn--wa {
  background: var(--wa-green);
  color: #06301C;
  box-shadow: 0 6px 18px rgba(37, 211, 102, .28);
}
.btn--wa:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(37, 211, 102, .34); }
.btn--ghost {
  background: transparent;
  color: var(--amber);
  border: 1.5px solid var(--amber);
}
.btn--ghost:hover { background: rgba(245, 166, 35, .12); transform: translateY(-2px); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: .95rem; }

.ico-wa { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 24, 41, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(46, 95, 122, .5);
  transition: background .25s ease, border-color .25s ease;
}
.nav.is-solid { background: rgba(7, 24, 41, .96); border-bottom-color: var(--draft-dim); }

.nav__inner {
  max-width: var(--wrap);
  margin-inline: auto;
  min-height: var(--nav-h);
  padding-inline: 20px;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark { display: inline-flex; flex-direction: row; align-items: center; gap: 9px; color: var(--text-on-dark); }
.wordmark__mark { width: 40px; height: auto; flex: none; }
.wordmark__name { font-family: var(--font-display); font-size: 1.2rem; }

.nav__links { display: none; }

.nav__burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav__burger span { display: block; height: 2px; width: 24px; margin-inline: auto; background: var(--text-on-dark); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__sheet {
  background: var(--ink-deep);
  border-bottom: 1px solid var(--draft-dim);
  padding: 12px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* The [hidden] attribute must win over display:flex, or the menu is stuck open */
.nav__sheet[hidden] { display: none; }
.nav__sheet a { color: var(--text-on-dark); font-weight: 600; padding: 14px 4px; min-height: 44px; display: flex; align-items: center; border-bottom: 1px solid rgba(46, 95, 122, .35); }
.nav__sheet a.btn { justify-content: center; border-bottom: none; margin-top: 10px; color: #06301C; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--ink-deep);
  color: var(--text-on-dark);
  padding-block: 56px 68px;
  overflow: hidden;
}
/* AI/blueprint artwork (Nano Banana) with a scrim so the copy stays legible */
.hero__bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 78% 68% at 50% 44%, rgba(7, 24, 41, .52), rgba(7, 24, 41, .2) 46%, rgba(7, 24, 41, .88)),
    linear-gradient(to bottom, rgba(7, 24, 41, .5), rgba(7, 24, 41, .1) 34%, var(--ink-deep) 94%),
    url('../img/hero-bg.webp?v=2');
  background-size: cover, cover, cover;
  background-position: center, center, center 28%;
  background-repeat: no-repeat;
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--draft-dim) 1px, transparent 1px),
    linear-gradient(to bottom, var(--draft-dim) 1px, transparent 1px);
  background-size: var(--grid-gap) var(--grid-gap);
  opacity: .06;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
}
.hero__inner {
  position: relative;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
  text-align: center;
}

.hero__logo {
  width: min(300px, 72%);
  height: auto;
  margin: 0 auto 22px;
  display: block;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.6rem);
  letter-spacing: -.01em;
}
.hero__line { display: block; }
.hero__mark { position: relative; color: var(--text-on-dark); white-space: nowrap; }
.hero__underline {
  position: absolute;
  inset-inline-start: 0;
  bottom: -.12em;
  width: 100%;
  height: .34em;
  color: var(--amber);
  overflow: visible;
}
.hero__sub {
  max-width: 44ch;
  margin: 22px auto 0;
  color: #C6D6E4;
  font-size: 1.08rem;
}
.hero__cta {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  justify-content: center;
}
.hero__cta .btn { flex: 1 1 0; max-width: 260px; }

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .04em;
  color: #9FBBD0;
}
.hero__trust li { position: relative; }
.hero__trust li + li::before {
  content: "";
  position: absolute;
  inset-inline-start: -10px;
  top: 50%;
  width: 4px;
  height: 4px;
  transform: translateY(-50%) rotate(45deg);
  background: var(--draft);
}
.hero__wink {
  margin-top: 34px;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: rgba(103, 199, 235, .6);
}

/* ---------- Section heading ---------- */
.sec-head { margin-bottom: 40px; }
.sec-head__idx {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .1em;
  color: var(--amber);
  padding-bottom: 6px;
  border-bottom: 1.5px dashed var(--draft);
  margin-bottom: 12px;
}
.sec-head__title { font-family: var(--font-display); font-size: clamp(1.5rem, 6vw, 2.4rem); }
.sec-head--ondark .sec-head__idx { border-bottom-color: var(--draft-dim); }

/* ---------- Services ---------- */
.services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.service-card {
  background: #fff;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-card);
  padding: 20px 16px;
  box-shadow: 0 2px 10px rgba(11, 34, 57, .04);
  transition: transform .18s ease, box-shadow .18s ease;
}
.service-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(11, 34, 57, .1); }
.service-card__ico { display: inline-flex; color: var(--ink); margin-bottom: 12px; }
.service-card__ico svg { width: 30px; height: 30px; }
.service-card h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; color: var(--ink); }
.service-card p { font-size: .95rem; color: #47617A; }

/* ---------- Portfolio ---------- */
.project { padding-block: 34px; }
.project + .project { border-top: 1px solid var(--draft-dim); }

.project__visual { margin-bottom: 24px; }

/* The composite has an explicit aspect-ratio so it is always tall enough to
   contain the portrait phone (which is taller than the browser). Both frames
   are absolutely positioned inside it, so neither overflows into neighbours. */
.composite {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  aspect-ratio: 100 / 62;
}
/* Browser frame - the larger element, on the inline-end (visual left), vertically centered */
.frame--browser {
  position: absolute;
  inset-inline-end: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 72%;
  background: #0E2B45;
  border: 1px solid var(--draft-dim);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .35);
}
.frame__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: #0A2136;
  border-bottom: 1px solid var(--draft-dim);
}
.frame__bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--draft-dim); }
.frame__url {
  margin-inline-start: 10px;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--draft);
  background: rgba(103, 199, 235, .08);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
}
.frame__screen { position: relative; overflow: hidden; aspect-ratio: 1440 / 900; background: #0E2B45; }
.frame__screen img { position: absolute; inset-inline-start: 0; top: 0; width: 100%; height: auto; }

/* Phone frame - smaller, standing on the visual right, straddling the browser's
   inline-start (visual right) edge: its left half sits over the browser, right half beside it. */
.frame--phone {
  position: absolute;
  inset-inline-start: 14.5%;
  inset-inline-end: auto;
  bottom: 4%;
  width: 27%;
  max-width: none;
  z-index: 2;
  background: #060F18;
  border: 3px solid #0A2136;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .5);
}
.frame--phone .frame__screen { aspect-ratio: 390 / 780; border-radius: 14px; }
.frame__notch { position: absolute; top: 6px; inset-inline: 0; margin-inline: auto; width: 40px; height: 4px; border-radius: 4px; background: #0A2136; z-index: 2; }

/* Bot composite (beds-fast): dummy dashboard browser + chat phone, same overlap
   arrangement as the others but the phone is a touch larger so the chat stays legible. */
.composite--bot { aspect-ratio: 100 / 74; }
.composite--bot .frame--browser { width: 66%; }
.composite--bot .frame--phone { width: 33%; inset-inline-start: 17%; }
.frame__screen--chat { background: #0B141A; }

/* Project body */
.project__idx { font-family: var(--font-mono); font-size: .85rem; color: var(--amber); letter-spacing: .1em; }
.project__name { font-family: var(--font-display); font-size: 1.7rem; margin-top: 4px; }
.project__role { font-family: var(--font-mono); font-size: .78rem; color: var(--draft); letter-spacing: .05em; margin-top: 6px; }
.project__desc { margin-top: 14px; color: #C6D6E4; font-size: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips li {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .03em;
  color: var(--draft);
  border: 1px solid var(--draft-dim);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
}
.chips .chip--soon { color: var(--amber); border-color: var(--amber); }

.project__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--amber);
  font-weight: 700;
}
.project__link .ico-arr { width: 20px; height: 20px; transition: transform .18s ease; }
.project__link:hover .ico-arr { transform: translateX(-4px); }

/* ---------- Process ---------- */
/* Mobile: vertical timeline, node on the inline-start edge, content beside it. */
.process { position: relative; display: flex; flex-direction: column; }
.process::before {
  content: "";
  position: absolute;
  inset-inline-start: 17px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--draft) 0 6px, transparent 6px 12px);
}
.step { position: relative; display: grid; grid-template-columns: 36px 1fr; column-gap: 16px; padding-block: 10px; }
.step__node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--draft);
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink);
  position: relative;
  z-index: 1;
}
.step__content { padding-top: 4px; }
.step h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.step p { font-size: .96rem; color: #47617A; margin-top: 4px; }

/* ---------- About ---------- */
.about { display: flex; flex-direction: column; gap: 24px; }
.about__portrait {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  border: 1px solid var(--draft-dim);
  background: rgba(103, 199, 235, .05);
  display: grid;
  place-items: center;
  position: relative;
}
.about__portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; border-radius: 15px; }
.about__portrait-ph svg { width: 54px; height: 54px; color: var(--draft-dim); }
.about__lead { font-size: 1.1rem; color: var(--text-on-dark); }
.facts { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.facts li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; color: #C6D6E4; }
.ico-fact { width: 24px; height: 24px; color: var(--amber); margin-top: 2px; }

/* ---------- Contact ---------- */
.contact__lead { font-family: var(--font-display); font-size: clamp(1.2rem, 4.5vw, 1.6rem); color: var(--ink); margin-bottom: 26px; line-height: 1.35; }

/* Quick-start chips: one tap opens WhatsApp with the first message pre-written */
.wa-quick { margin-bottom: 30px; }
.wa-quick__hint {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .04em;
  color: #6B8299;
  margin-bottom: 12px;
}
.wa-quick__chips { display: flex; flex-wrap: wrap; gap: 10px; }
.wa-quick__chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  background: #fff;
  border: 1.5px solid var(--paper-line);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: .95rem;
  color: var(--ink);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.wa-quick__chip:hover {
  transform: translateY(-2px);
  border-color: var(--amber);
  box-shadow: 0 6px 16px rgba(11, 34, 57, .1);
}
.contact__tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-card);
  padding: 20px 14px;
  min-height: 44px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(11, 34, 57, .1); }
.tile--wa { grid-column: 1 / -1; background: var(--wa-green); border-color: var(--wa-green); color: #06301C; }
.tile--wa .ico-wa { width: 30px; height: 30px; }
.ico-tile { width: 28px; height: 28px; color: var(--ink); }
.tile__label { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; color: #6B8299; }
.tile--wa .tile__label { color: #094D2C; }
.tile__value { font-weight: 700; color: var(--ink); font-size: 1rem; }
.tile--wa .tile__value { color: #06301C; }

/* ---------- Footer ---------- */
.footer { background: var(--ink-deep); color: var(--text-on-dark); padding-block: 40px 24px; }
/* Mobile: everything centered; desktop restores the spread row (see min-width:768). */
.footer__inner { display: flex; flex-direction: column; gap: 22px; align-items: center; text-align: center; }
.footer__logo { width: 175px; height: auto; margin: 0 auto 8px; display: block; }
.footer__brand p { color: #9FBBD0; font-size: .95rem; margin-top: 6px; }
.footer__links { display: flex; flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 20px; }
.footer__links a { color: var(--draft); padding-block: 8px; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.footer__bottom {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 22px 20px 0;
  margin-top: 26px;
  border-top: 1px solid var(--draft-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  font-size: .8rem;
  color: #7C97AD;
}
.footer__credit { color: #7C97AD; transition: color .18s ease; }
.footer__credit:hover { color: var(--amber); }

/* =========================================================
   Tablet and up
   ========================================================= */
@media (min-width: 768px) {
  .section { padding-block: 88px; }
  .services { grid-template-columns: repeat(4, 1fr); gap: 18px; }

  .nav__links { display: flex; flex-direction: row-reverse; align-items: center; gap: 26px; }
  .nav__links > a:not(.btn) { color: var(--text-on-dark); font-weight: 600; }
  .nav__links > a:not(.btn):hover { color: var(--draft); }
  .nav__burger { display: none; }
  .nav__sheet { display: none !important; }

  .hero { padding-block: 84px 96px; }
  /* Desktop: put each sentence group on its own line */
  .hero__sub { max-width: none; }
  .hero__sub-line { display: block; }

  /* Project two-column with alternating sides */
  .project { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 44px; padding-block: 56px; }
  .project__visual { margin-bottom: 0; }
  .project--flip .project__visual { order: 2; }
  .composite { max-width: 540px; }

  .process { flex-direction: row; }
  .process::before {
    inset-inline: 8% 8%;
    top: 28px;
    bottom: auto;
    width: auto;
    height: 2px;
    background: repeating-linear-gradient(to right, var(--draft) 0 6px, transparent 6px 12px);
  }
  .step { grid-template-columns: 1fr; justify-items: center; text-align: center; flex: 1; row-gap: 14px; padding-inline: 10px; padding-block: 0; }
  .step__content { padding-top: 0; }

  .about { flex-direction: row; align-items: flex-start; gap: 40px; }
  .about__portrait { flex: none; width: 150px; height: 180px; }

  .contact__tiles { grid-template-columns: repeat(3, 1fr); }
  .tile--wa { grid-column: auto; }

  .footer__inner { flex-direction: row; justify-content: space-between; align-items: center; text-align: start; }
  .footer__links { flex-direction: row; gap: 22px; }
  .footer__bottom { flex-direction: row; justify-content: space-between; align-items: center; text-align: start; }
}

/* =========================================================
   Desktop
   ========================================================= */
@media (min-width: 1024px) {
  .hero__title { font-size: clamp(3rem, 5vw, 4rem); }
}

@media (min-width: 1120px) {
  /* Wide desktop: keep the long middle sentence on a single line */
  .hero__sub-line--wide { white-space: nowrap; }
}
