/* ============================================
   Yaroslav Mar — Personal Service Website
   System font stack · Accent #2563EB · WCAG AA
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent: #2563EB;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --accent-hover-bg: #bfdbfe;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --radius: 8px;
  --max-w: 1060px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 0.5rem;
}

/* --- Utility --- */
.mt-sm { margin-top: 0.5rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Links --- */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-hover);
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.site-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.site-logo:hover { color: var(--accent); }

/* --- Desktop Nav --- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.125rem;
  align-items: center;
}

.nav-links a {
  display: block;
  padding: 0.375rem 0.625rem;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-hover-bg);
}

/* --- Language switcher --- */
.lang-switch {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-left: 0.75rem;
}

.lang-switch a {
  display: block;
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-light);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.lang-switch a:hover {
  color: var(--accent);
  background: var(--accent-hover-bg);
}
.lang-switch a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-hover-bg);
}

/* --- Header CTA --- */
.header-cta {
  display: inline-flex;
  align-items: center;
  margin-left: 0.75rem;
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.header-cta:hover { background: var(--accent-hover); color: #fff; }

/* --- Hamburger --- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}
.menu-toggle svg {
  display: block;
  width: 24px;
  height: 24px;
}
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* --- Mobile nav --- */
@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .main-nav {
    display: none;
    position: absolute;
    top: 3.5rem;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 1rem 1.25rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .main-nav.is-open { display: flex; }

  .nav-links {
    flex-direction: column;
    gap: 0;
  }
  .nav-links a {
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
  }

  .lang-switch {
    margin-left: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    justify-content: flex-start;
  }

  .header-cta {
    margin-left: 0;
    margin-top: 0.5rem;
    text-align: center;
    justify-content: center;
  }
}

/* --- Sections --- */
section {
  padding: 3rem 0;
}
section:nth-child(even) {
  background: var(--bg-alt);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* --- Hero --- */
.hero {
  padding: 3.5rem 0 2rem;
  background: var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: center;
}

.hero-portrait {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background-color: var(--bg-alt);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .hero-portrait {
    width: 160px;
    height: 160px;
    justify-self: center;
    order: -1;
  }
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero-sub {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-light);
  max-width: 680px;
  margin-bottom: 1.25rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
}

.hero-email {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--text-light);
}
.hero-email a {
  font-weight: 600;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-hover-bg);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.copy-btn:hover {
  background: var(--accent-light);
}


/* --- Proof bar --- */
.proof {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.proof-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  list-style: none;
  font-size: 0.9375rem;
  color: var(--text-light);
}

.proof-list li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.proof-list li::before {
  content: "•";
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.proof-label {
  font-weight: 600;
  color: var(--text);
}

/* --- Cards grid (Services, Packages) --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}
.card:hover {
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.card p,
.card ul {
  font-size: 0.9375rem;
  color: var(--text-light);
  line-height: 1.6;
}

.card ul {
  list-style: none;
  padding: 0;
}
.card ul li {
  padding: 0.25rem 0;
  padding-left: 1.125rem;
  position: relative;
}
.card ul li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}
[dir="rtl"] .card ul li {
  padding-left: 0;
  padding-right: 1.125rem;
}
[dir="rtl"] .card ul li::before {
  left: auto;
  right: 0;
}

.card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card .stack {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-light);
  font-family: var(--font-mono);
  line-height: 1.6;
}

.card .practicum {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--text-light);
}
.practicum-value {
  font-style: normal;
}

.pricing-note {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--text-light);
  font-style: italic;
}

/* --- Testimonials --- */
.testimonial-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.25rem;
  margin: 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  padding-top: 2.25rem;
}
.testimonial-card::before {
  content: "\201C";
  position: absolute;
  top: 0.5rem;
  left: 1.25rem;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.3;
}
[dir="rtl"] .testimonial-card::before {
  left: auto;
  right: 1.25rem;
}
.testimonial-card p {
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.6;
}
.testimonial-card footer {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.testimonial-name {
  font-weight: 600;
  font-style: normal;
  font-size: 0.875rem;
  color: var(--text);
}
.testimonial-service {
  font-size: 0.8125rem;
  color: var(--text-light);
}

/* --- Work / Projects --- */
.links-group-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.links-group-title + ul {
  margin-bottom: 1.5rem;
}

.links-section ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.links-section li {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.links-section li:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.links-section li a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s;
}
.links-section li a:hover {
  color: var(--accent);
}
.links-section li a svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.link-desc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-light);
  line-height: 1.4;
}

.links-details {
  margin-top: 1rem;
}
.links-details summary {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
}
.links-details summary:hover {
  color: var(--accent);
}
.links-details ul {
  margin-top: 0.5rem;
}

/* --- Stack details --- */
.stack-details {
  margin-top: 0.25rem;
}
.stack-details summary {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  font-family: var(--font);
}
.stack-details summary:hover {
  color: var(--accent);
}
.stack-details .stack {
  margin-top: 0.25rem;
}

/* --- Hero disclaimer --- */
.hero-disclaimer {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-top: 0.75rem;
  line-height: 1.4;
}

/* --- Process --- */
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  counter-reset: step;
}

.process-step {
  counter-increment: step;
  padding: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}
.process-step::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 50%;
  margin-bottom: 0.75rem;
}
.process-step p {
  font-size: 0.9375rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* --- FAQ --- */
.faq-list {
  max-width: 720px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  line-height: 1.4;
  font-family: var(--font);
  gap: 1rem;
}
.faq-btn:hover { color: var(--accent); }
.faq-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform 0.2s;
}
.faq-btn[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
.faq-answer[hidden] {
  display: block;
  max-height: 0;
}
.faq-answer:not([hidden]) {
  max-height: 500px;
}
.faq-answer-inner {
  padding: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* no-JS fallback: show all answers */
.no-js .faq-answer { max-height: none; }
.no-js .faq-answer[hidden] { display: block; max-height: none; }
.no-js .faq-icon { display: none; }
.no-js .faq-btn { cursor: default; }

/* --- Contact --- */
.contact-section {
  text-align: center;
  padding: 3.5rem 0;
}
.contact-section p {
  font-size: 1.0625rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.contact-email-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.contact-email-display a {
  font-size: 1.25rem;
  font-weight: 700;
}
.contact-subject {
  font-size: 0.875rem;
  color: var(--text-light);
  font-style: italic;
}
.payment-methods {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.payment-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 20px;
}
.payment-logo {
  display: block;
  height: 20px;
  width: auto;
  filter: grayscale(100%) opacity(0.5);
  transition: filter 0.2s;
}
.payment-logo:hover {
  filter: grayscale(0%) opacity(1);
}

/* --- Contact Form --- */
.contact-form {
  max-width: 480px;
  margin: 0 auto 1.5rem;
  text-align: left;
}
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-group textarea {
  resize: vertical;
  min-height: 120px;
}
.form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.625rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.form-submit:hover { background: var(--accent-hover); }
.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.form-result {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  text-align: center;
}
.form-result.is-success { color: #16a34a; }
.form-result.is-error { color: #dc2626; }
.contact-divider {
  margin: 1.5rem 0;
  font-size: 0.875rem;
  color: var(--text-light);
}
[dir="rtl"] .contact-form {
  text-align: right;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: var(--text);
  color: #fff;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  pointer-events: none;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.875rem;
  color: var(--text-light);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}
.footer-social a {
  color: var(--text-light);
  transition: color 0.15s;
}
.footer-social a:hover {
  color: var(--accent);
}
.footer-social svg {
  width: 20px;
  height: 20px;
}

.footer-lang {
  display: flex;
  gap: 0.25rem;
}
.footer-lang a {
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-light);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.footer-lang a:hover {
  color: var(--accent);
  background: var(--accent-hover-bg);
}
.footer-lang a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-hover-bg);
}

/* --- 404 page --- */
.page-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 2rem;
}
.page-404 h1 {
  font-size: 4rem;
  font-weight: 800;
  color: var(--accent);
}
.page-404 p {
  font-size: 1.125rem;
  color: var(--text-light);
  margin: 1rem 0 2rem;
}
.page-404-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- RTL overrides (Hebrew) --- */
[dir="rtl"] .lang-switch {
  margin-left: 0;
  margin-right: 0.75rem;
}
[dir="rtl"] .header-cta {
  margin-left: 0;
  margin-right: 0.75rem;
}

/* --- Print --- */
@media print {
  .site-header,
  .menu-toggle,
  .copy-btn,
  .toast,
  .skip-link { display: none !important; }
  body { font-size: 12pt; }
  section { padding: 1rem 0; }
  a { color: var(--text); text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
