/* =========================================================
   Fonts
   ========================================================= */
@font-face {
  font-family: 'Gveret Levin';
  src: url('../fonts/GveretLevin-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* =========================================================
   Design tokens — "drafting table" palette on the
   Studio.Design layout, adapted for Hebrew (RTL)
   ========================================================= */
:root {
  /* Colors */
  --color-canvas: #f3f4f1;     /* drafting paper — page background */
  --color-paper: #ffffff;      /* sheets laid on the table — form, frames */
  --color-ink: #1c2340;        /* ink blue — text, buttons */
  --color-graphite: #2b3252;   /* nav text */
  --color-ash: #565c74;        /* dark pencil — secondary text (6:1 on canvas) */
  --color-pencil: #8a90a6;     /* light pencil — borders, placeholders only */
  --color-cobalt: #2f4bff;     /* the one colour block, lines, hovers */
  --color-highlight: #f2e94e;  /* highlighter — selection, focus, step numbers */
  --color-line: rgba(28, 35, 64, 0.14);
  --gradient-sketch: linear-gradient(180deg, #2f4bff 0%, #f3f4f1 100%);

  /* Texture */
  --grid-minor: rgba(47, 75, 255, 0.07);
  --grid-major: rgba(47, 75, 255, 0.12);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* Fonts */
  --font-display: 'Gveret Levin', 'Heebo', system-ui, sans-serif;
  --font-sans: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

  /* Type scale */
  --text-hero: clamp(46px, 5.8vw, 80px);
  --text-heading: clamp(38px, 5vw, 56px);
  --text-nav: 15px;
  --text-body: 16px;
  --text-lead: 19px;

  /* Spacing */
  --spacing-4: 4px;
  --spacing-8: 8px;
  --spacing-12: 12px;
  --spacing-16: 16px;
  --spacing-24: 24px;
  --spacing-32: 32px;
  --spacing-48: 48px;
  --spacing-64: 64px;
  --spacing-100: 100px;

  /* Layout */
  --page-max-width: 1200px;
  --gutter: 32px;
  --section-gap: clamp(80px, 11vw, 140px);
  --element-gap: 16px;

  /* Radius */
  --radius-buttons: 8px;
  --radius-cards: 8px;
  --radius-images: 4px;

  /* Elevation — only for button hover */
  --shadow-md: rgba(28, 35, 64, 0.18) 0px 4px 18px 0px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-quick: 200ms;
  --dur-reveal: 800ms;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Paper grain over the whole page */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background-image: var(--grain);
  mix-blend-mode: multiply;
  opacity: 0.08;
}

::selection {
  background: var(--color-highlight);
  color: var(--color-ink);
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

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

.container {
  width: 100%;
  max-width: calc(var(--page-max-width) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   Typography
   ========================================================= */
.display,
.heading {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--color-ink);
}

.display {
  font-size: var(--text-hero);
  line-height: 1.05;
  text-wrap: balance;
}

.heading {
  font-size: var(--text-heading);
  line-height: 1.1;
}

.section-sub {
  max-width: 520px;
  margin-top: var(--spacing-16);
  font-size: var(--text-lead);
  color: var(--color-ash);
}

/* =========================================================
   Buttons & links
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-8);
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-buttons);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  cursor: pointer;
  transition:
    transform var(--dur-quick) var(--ease-out),
    box-shadow var(--dur-quick) var(--ease-out),
    background-color 300ms ease;
}

.btn-dark {
  background: var(--color-ink);
  color: var(--color-paper);
}
.btn-dark:hover {
  background: var(--color-cobalt);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-dark:active { transform: translateY(0); box-shadow: none; }

.btn-arrow {
  display: inline-block;
  transition: transform var(--dur-quick) var(--ease-out);
}
.btn:hover .btn-arrow { transform: translateX(-3px); }

/* Underline that grows from the start (right) side on hover */
.text-link {
  padding-bottom: 2px;
  font-weight: 500;
  background:
    linear-gradient(currentColor, currentColor) right bottom / 0 1px no-repeat,
    linear-gradient(var(--color-line), var(--color-line)) right bottom / 100% 1px no-repeat;
  transition: background-size 300ms var(--ease-out), color var(--dur-quick) ease;
}
.text-link:hover { color: var(--color-cobalt); background-size: 100% 1px, 100% 1px; }

/* =========================================================
   Header / Nav
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 300ms ease, border-color 300ms ease;
}
.site-header.is-scrolled {
  background: rgba(243, 244, 241, 0.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--color-line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-24);
  min-height: 72px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  color: var(--color-ink);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-32);
}

.nav-links {
  display: flex;
  gap: var(--spacing-24);
  font-size: var(--text-nav);
  font-weight: 500;
}
.nav-links a {
  color: var(--color-graphite);
  transition: color var(--dur-quick) ease;
}
.nav-links a:hover { color: var(--color-cobalt); }

.nav-menu .btn { min-height: 40px; padding: 8px 18px; font-size: 15px; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-buttons);
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  margin: 5px auto;
  background: var(--color-ink);
  transition: transform 300ms var(--ease-out);
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(48px, 8vw, 100px) var(--section-gap);
}

/* Faint drafting grid, fading out from behind the sketches */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 140px 140px, 140px 140px, 28px 28px, 28px 28px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 25% 55%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 25% 55%, #000 20%, transparent 75%);
}

/* ---------- Flowing background lines ---------- */
.hero-paths {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--color-cobalt);   /* read by main.js as the stroke colour */
  opacity: 0.5;
  pointer-events: none;
  /* soft top/bottom edges so the lines fade into the page */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 85%, transparent);
  animation: fadeIn 2s var(--ease-out) both;
}

@keyframes fadeIn {
  from { opacity: 0; }
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: var(--spacing-48);
  align-items: center;
}

.hero-sub {
  max-width: 460px;
  margin-top: var(--spacing-32);
  font-size: var(--text-lead);
  line-height: 1.6;
  color: var(--color-ash);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-24);
  margin-top: var(--spacing-32);
}

/* Load-in: title, text, actions rise in sequence */
.hero-copy > * {
  animation: rise 900ms var(--ease-out) both;
}
.hero-copy > :nth-child(2) { animation-delay: 120ms; }
.hero-copy > :nth-child(3) { animation-delay: 240ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Collage of website sketches ---------- */
.collage {
  position: relative;
  aspect-ratio: 1 / 0.86;
  width: 100%;
}

.frame {
  position: absolute;
  overflow: hidden;
  border-radius: var(--radius-cards);
  background: var(--color-paper);
  animation: frameIn 1200ms var(--ease-out) both;
  transition: translate 500ms var(--ease-out);
}

.frame-a { top: 8%;  left: 6%;  width: 64%; z-index: 1; animation-delay: 150ms; --fx: -24px; --fy: 16px;
           border: 1px solid var(--color-line); }
.frame-b { top: 0;   right: 0;  width: 44%; z-index: 2; animation-delay: 300ms; --fx: 24px;  --fy: -16px;
           background: var(--color-ink); }
.frame-c { bottom: 2%; left: 0; width: 46%; z-index: 3; animation-delay: 450ms; --fx: -16px; --fy: 24px;
           background: var(--color-cobalt); border-radius: var(--radius-images); }
.frame-d { bottom: 0; right: 10%; width: 22%; z-index: 4; animation-delay: 600ms; --fx: 16px; --fy: 24px;
           border: 1px solid var(--color-line); border-radius: 14px; }

@keyframes frameIn {
  from { opacity: 0; transform: translate(var(--fx), var(--fy)); }
  to   { opacity: 1; transform: none; }
}

.collage:hover .frame-a { translate: -4px 2px; }
.collage:hover .frame-b { translate: 4px -4px; }
.collage:hover .frame-c { translate: -4px 4px; }
.collage:hover .frame-d { translate: 2px 4px; }

.frame-bar {
  display: flex;
  gap: 5px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(28, 35, 64, 0.06);
}
.frame-bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(28, 35, 64, 0.16);
}
.frame-b .frame-bar,
.frame-c .frame-bar { border-bottom-color: rgba(255, 255, 255, 0.08); }
.frame-b .frame-bar i,
.frame-c .frame-bar i { background: rgba(255, 255, 255, 0.22); }

.frame-notch {
  width: 34%;
  height: 6px;
  margin: 8px auto 4px;
  border-radius: 3px;
  background: rgba(28, 35, 64, 0.14);
}

.frame-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}
.frame-d .frame-body { padding: 8px; gap: 6px; }

.blk {
  display: block;
  height: 8px;
  border-radius: 2px;
  background: var(--color-canvas);
}
.frame-b .blk,
.frame-c .blk { background: rgba(255, 255, 255, 0.14); }

.blk.h-lg  { height: 18px; }
.blk.h-btn { height: 16px; background: var(--color-ink); }
.frame-b .blk.h-btn { background: var(--color-highlight); }
.frame-d .blk.h-btn { background: var(--color-cobalt); }
.blk.h-img { height: auto; aspect-ratio: 16 / 9; background: var(--gradient-sketch); }
.frame-c .blk.h-img { background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.1)); }
.frame-d .blk.h-img { aspect-ratio: 1; }
.blk.h-box { flex: 1; height: auto; aspect-ratio: 1; }
.blk-row { display: flex; gap: 8px; margin-top: 6px; }

.w-30 { width: 30%; } .w-40 { width: 40%; } .w-50 { width: 50%; }
.w-60 { width: 60%; } .w-70 { width: 70%; } .w-80 { width: 80%; } .w-full { width: 100%; }

/* =========================================================
   Sections
   ========================================================= */
.section { padding-block: var(--section-gap); }

.section-band {
  position: relative;
  background: var(--color-cobalt);
  color: rgba(255, 255, 255, 0.86);
}
.section-band .heading { color: var(--color-paper); }
.section-band .section-sub { color: rgba(255, 255, 255, 0.86); }
.section-band :focus-visible { outline-color: var(--color-highlight); }

/* ---------- Services ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-48) var(--spacing-32);
  margin-top: var(--spacing-64);
}
.service {
  padding-top: var(--spacing-24);
  border-top: 1px solid var(--color-ink);
}
.service h3 {
  margin-bottom: var(--spacing-12);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.1;
}
.service p { color: var(--color-ash); }

/* ---------- Process ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-48) var(--spacing-32);
  margin-top: var(--spacing-64);
  counter-reset: none;
}
.step {
  padding-top: var(--spacing-24);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}
.step-num {
  display: block;
  margin-bottom: var(--spacing-16);
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
  color: var(--color-highlight);
}
.step h3 {
  margin-bottom: var(--spacing-8);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-paper);
}

/* ---------- Included features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-48) var(--spacing-32);
  margin-top: var(--spacing-64);
}
.feature {
  display: flex;
  gap: var(--spacing-16);
  align-items: flex-start;
}
.feature .icon { margin-top: 2px; color: var(--color-cobalt); }
.feature h3 {
  margin-bottom: var(--spacing-4);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.feature p { color: var(--color-ash); }

/* ---------- Work ---------- */
.work {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-32) var(--element-gap);
  margin-top: var(--spacing-64);
}
.work-item h3 {
  margin-top: var(--spacing-16);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.work-media {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-images);
  background: var(--color-ink);
}
.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease-out);
}
.work-item:hover .work-media img { transform: scale(1.03); }

/* An empty drafting sheet until the real project goes in */
.work-media.is-empty {
  background-color: var(--color-paper);
  background-image:
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: center;
  border: 1px solid var(--color-line);
}
.work-media.is-empty span {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ash);
}

/* ---------- Contact ---------- */
.section-contact { padding-top: 0; }

.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-64);
  align-items: start;
  padding-top: var(--section-gap);
  /* divider aligned with the content, not the container padding */
  background: linear-gradient(var(--color-line), var(--color-line)) top center / calc(100% - var(--gutter) * 2) 1px no-repeat;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-12);
  margin-top: var(--spacing-32);
  font-size: var(--text-lead);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-24);
  padding: var(--spacing-32);
  border-radius: var(--radius-cards);
  background: var(--color-paper);
}
.contact-form .btn { align-self: flex-start; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-16);
}

.field label {
  display: block;
  margin-bottom: var(--spacing-8);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-graphite);
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-buttons);
  background: var(--color-canvas);
  color: var(--color-ink);
  font: inherit;
  transition: border-color var(--dur-quick) ease, background-color var(--dur-quick) ease, box-shadow var(--dur-quick) ease;
}
.field input[dir="ltr"] { text-align: right; }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-cobalt);
  background: var(--color-paper);
  box-shadow: 0 0 0 3px rgba(242, 233, 78, 0.8);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  padding-block: var(--spacing-48);
  border-top: 1px solid var(--color-line);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-24);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-16) var(--spacing-24);
  font-size: var(--text-nav);
  font-weight: 500;
}
.footer-links a { transition: color var(--dur-quick) ease; }
.footer-links a:hover { color: var(--color-cobalt); }
.legal { font-size: 13px; color: var(--color-ash); }

/* =========================================================
   Floating WhatsApp
   ========================================================= */
.whatsapp-float {
  position: fixed;
  inset-inline-end: var(--spacing-24);   /* left side in RTL */
  bottom: var(--spacing-24);
  z-index: 40;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-buttons);
  background: var(--color-ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  color: var(--color-paper);
  animation: rise 700ms 900ms var(--ease-out) both;
  transition: translate var(--dur-quick) var(--ease-out), box-shadow var(--dur-quick) var(--ease-out), background-color 300ms ease;
}
.whatsapp-float:hover { background: var(--color-cobalt); translate: 0 -2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), var(--shadow-md); }
.whatsapp-float svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   Contact switch — <html class="contact-off"> hides every
   element marked data-contact until real details are in
   ========================================================= */
.contact-off [data-contact] { display: none !important; }

/* =========================================================
   Scroll reveal (staggered via --i, set in main.js)
   ========================================================= */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero-grid,
  .contact { grid-template-columns: 1fr; }
  .hero-grid { gap: var(--spacing-48); }
  .collage { max-width: 560px; margin-inline: auto; }
  .services,
  .work { grid-template-columns: 1fr; }
  .work { max-width: 560px; }

  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-16);
    padding: var(--spacing-8) var(--gutter) var(--spacing-24);
    background: var(--color-canvas);
    border-bottom: 1px solid var(--color-line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out), visibility 0s 250ms;
  }
  .nav-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out), visibility 0s;
  }
  .nav-links { flex-direction: column; gap: 0; font-size: 17px; }
  .nav-links a { display: block; padding: 12px 0; border-bottom: 1px solid var(--color-line); }
  .nav-menu .btn { min-height: 48px; }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .steps,
  .features,
  .field-row { grid-template-columns: 1fr; }
  .contact-form { padding: var(--spacing-24); }
  .contact-form .btn { align-self: stretch; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .whatsapp-float { inset-inline-end: var(--spacing-16); bottom: var(--spacing-16); }
}
