/* © Shimon Shmueli */

:root {
  --bg: #F0EEE6;
  --surface: #FAF9F5;
  --surface-2: #EDEAE0;
  --border: #E0DCCF;
  --border-strong: #C9C3B0;
  --text: #1A1915;
  --text-muted: #6B6862;
  --accent: #C96442;
  --accent-hover: #B5573A;
  --accent-soft: #F4DCD2;
  --coffee: #FFDD00;
  --coffee-text: #0A0A0A;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(26, 25, 21, 0.04), 0 1px 3px rgba(26, 25, 21, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 25, 21, 0.06), 0 2px 6px rgba(26, 25, 21, 0.04);
  --shadow-lg: 0 12px 32px rgba(26, 25, 21, 0.10), 0 4px 12px rgba(26, 25, 21, 0.06);

  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --max-w: 1080px;
  --gutter: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px var(--gutter);
  background: rgba(240, 238, 230, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }

.brand {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.2px;
}
.site-nav { display: flex; gap: 28px; font-size: 15px; color: var(--text-muted); }
.site-nav a { transition: color 0.15s ease; }
.site-nav a:hover { color: var(--text); }

@media (max-width: 540px) {
  .site-nav { gap: 18px; font-size: 14px; }
  .brand { font-size: 18px; }
}

/* ---------- Layout ---------- */
main { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }

.section {
  padding: clamp(32px, 5vw, 56px) 0;
  border-top: 1px solid var(--border);
}

.section-head { margin-bottom: 24px; max-width: 640px; }
.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.1;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.section-lead {
  margin: 0;
  font-size: 17px;
  color: var(--text-muted);
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(40px, 7vw, 80px) 0 clamp(28px, 5vw, 52px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.profile-avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar .initials {
  font-family: var(--font-serif);
  font-size: 52px;
  color: var(--text-muted);
  letter-spacing: 1px;
  display: none;
}
.profile-avatar.no-image .initials { display: block; }

.hero-name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
.hero-bio {
  max-width: 560px;
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { background: #2c2a25; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface); border-color: var(--text); }

.btn-coffee {
  background: var(--coffee);
  color: var(--coffee-text);
  font-weight: 600;
  padding: 14px 26px;
  font-size: 16px;
  box-shadow: var(--shadow-md);
}
.btn-coffee:hover { background: #FFE633; }

.arrow { font-size: 0.9em; transition: transform 0.15s ease; display: inline-block; }
.btn:hover .arrow,
.project-card:hover .arrow { transform: translate(2px, -2px); }

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.project-shot {
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}
.project-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.4s ease;
}
.project-card:hover .project-shot img { transform: scale(1.02); }

.project-meta { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-meta h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 24px;
  margin: 0;
  letter-spacing: -0.01em;
}
.project-meta p { margin: 0; color: var(--text-muted); font-size: 15px; line-height: 1.55; flex: 1; }
.project-link {
  margin-top: 10px;
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

/* ---------- ZoneKey ---------- */
.section-zonekey {
  /* slightly distinct background panel */
  background: linear-gradient(180deg, transparent 0%, var(--surface) 8%, var(--surface) 92%, transparent 100%);
  margin: 0 calc(var(--gutter) * -1);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  border-radius: 0;
}

/* Dedicated /zonekey/ page hero */
.zonekey-page-hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.zonekey-page-icon {
  width: 128px;
  height: 128px;
  border-radius: 28px;
  margin-bottom: 4px;
}
.zonekey-page-icon .app-icon-fallback { font-size: 56px; }
.zonekey-page-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
.zonekey-page-tagline {
  font-size: clamp(15px, 1.6vw, 19px);
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .zonekey-page-tagline { white-space: normal; font-size: 16px; }
}
.zonekey-page-buttons { margin-top: 14px; }
.zonekey-page-hero .cta-note { margin-top: -2px; }

.zonekey-header {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.app-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent) 0%, #E58067 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-icon-fallback {
  font-family: var(--font-serif);
  font-size: 42px;
  color: white;
  font-weight: 400;
  letter-spacing: 1px;
  display: none;
}
.app-icon.no-image .app-icon-fallback { display: block; }

.zonekey-titles { flex: 1; min-width: 240px; }
.eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 6px;
  font-weight: 600;
}
.zonekey-titles h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.05;
  margin: 0 0 10px;
  letter-spacing: -0.015em;
}
.zonekey-tagline {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0;
}

.zonekey-desc {
  margin: 0 0 20px;
  font-size: 17px;
  color: var(--text);
  line-height: 1.65;
}

.features-grid {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px 32px;
}
.features-grid li {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.features-grid h4 {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}
.features-grid p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Screenshots gallery */
.screenshots-wrap { margin-bottom: 24px; }
.screenshots-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 0 16px;
  font-weight: 600;
}
.screenshots {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 4px;
  padding: 4px 4px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.screenshots::-webkit-scrollbar { height: 8px; }
.screenshots::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.screenshots::-webkit-scrollbar-track { background: transparent; }

.shot {
  margin: 0;
  flex: 0 0 auto;
  width: min(78vw, 480px);
  aspect-ratio: 16 / 10;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-snap-align: start;
  position: relative;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.shot:not(.placeholder):hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.shot.placeholder { cursor: default; }
.shot img { width: 100%; height: 100%; object-fit: cover; cursor: inherit; }
.shot figcaption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  font-family: 'SF Mono', Menlo, monospace;
  background: var(--surface-2);
  opacity: 0;
  pointer-events: none;
}
.shot.placeholder figcaption { opacity: 1; }
.shot.placeholder img { display: none; }

.zonekey-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 0 4px;
  text-align: center;
}
.zonekey-cta-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn-download {
  background: var(--text);
  color: var(--bg);
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}
.btn-download:hover { background: #2c2a25; }
.cta-note { color: var(--text-muted); font-size: 14px; margin: 0; max-width: 480px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.site-footer p { margin: 0; }
.footer-links { display: flex; gap: 12px; align-items: center; }
.footer-links a:hover { color: var(--text); }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal.is-open { opacity: 1; visibility: visible; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 19, 16, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.99);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal.is-open .modal-panel { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-panel h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.modal-sub { color: var(--text-muted); font-size: 14.5px; margin: 0 0 22px; }

.field { display: block; margin-bottom: 16px; }
.field span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 110px; }

.hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.form-status { margin: 14px 0 0; font-size: 14px; min-height: 20px; }
.form-status.is-pending { color: var(--text-muted); }
.form-status.is-success { color: #2D7A4F; }
.form-status.is-error { color: #B23A3A; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 14, 11, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 6vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lightbox.is-open .lightbox-img { transform: scale(1); }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: white;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-family: var(--font-sans);
  line-height: 1;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}
.lightbox-close { top: 20px; right: 20px; font-size: 26px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  letter-spacing: 0.05em;
  font-family: var(--font-sans);
}

@media (max-width: 640px) {
  .lightbox { padding: 8vh 12px; }
  .lightbox-prev,
  .lightbox-next { width: 38px; height: 38px; font-size: 20px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 12px; right: 12px; }
}

/* ---------- New badge ---------- */
.new-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  padding: 2px 7px;
  vertical-align: middle;
  margin-left: 7px;
  line-height: 1.6;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Mobile fine-tuning ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding-top: 60px; }
  .profile-avatar { width: 108px; height: 108px; }
  .profile-avatar .initials { font-size: 42px; }
  .modal-panel { padding: 30px 22px 22px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; }
}
