/* Heebo, self-hosted (SIL Open Font License, see /fonts/OFL.txt). Variable
   weight, one file per script; the browser downloads only what the page uses. */
@font-face {
  font-family: "Heebo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/heebo-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: "Heebo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/heebo-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;
}

/* BAZ — design tokens */
:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #141414;
  --muted: #646c75;
  --faint: #6c747b;
  --line: #e7e5e0;
  --accent: #c4663d;
  /* Same terracotta, one step deeper, for small text (4.5:1 on the cream). */
  --accent-text: #b0562e;
  --font: "Heebo", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --container: 1120px;
  --pad: clamp(20px, 5vw, 48px);
  --ease: 150ms ease;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --move: 380ms var(--ease-out);
}

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

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Text for screen readers only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  min-height: 68px;
}

.wordmark {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

/* Hero */
.hero {
  padding-block: clamp(44px, 8vh, 96px) clamp(32px, 5vh, 64px);
}

.hero-title {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  font-weight: 300;
  line-height: 1.15;
  text-wrap: balance;
}

.hero-title .accent {
  color: var(--accent);
}

.hero-intro {
  margin: 16px 0 0;
  max-width: 44ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  text-wrap: pretty;
}

/* Projects */
.projects {
  padding-block: 0 clamp(64px, 12vh, 140px);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 18px;
  margin-bottom: 36px;
  border-top: 1px solid var(--line);
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.section-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

.section-count {
  color: var(--muted);
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.project-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 52px 32px;
}

@media (min-width: 640px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 56px 40px;
  }
}

/* A lone card on the last row spans the row and turns into a feature:
   illustration on the start side, text beside it. Nothing is cropped. */
@media (min-width: 640px) and (max-width: 1199px) {
  .project:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .project:last-child:nth-child(odd) .card {
    flex-direction: row;
    align-items: stretch;
    gap: 28px;
  }

  .project:last-child:nth-child(odd) .card-preview {
    flex: 0 0 calc(50% - 14px);
  }

  .project:last-child:nth-child(odd) .card-body {
    flex: 1;
    justify-content: center;
    margin-top: 0;
    padding-top: 0;
    padding-inline-start: 24px;
    border-top: 0;
    border-inline-start: 1px solid var(--line);
  }
}

@media (min-width: 1200px) {
  .project:last-child:nth-child(3n + 1) {
    grid-column: 1 / -1;
  }

  .project:last-child:nth-child(3n + 1) .card {
    flex-direction: row;
    align-items: stretch;
    gap: 40px;
  }

  .project:last-child:nth-child(3n + 1) .card-preview {
    flex: 0 0 calc((100% - 80px) / 3);
  }

  .project:last-child:nth-child(3n + 1) .card-body {
    flex: 1;
    justify-content: center;
    margin-top: 0;
    padding-top: 0;
    padding-inline-start: 32px;
    border-top: 0;
    border-inline-start: 1px solid var(--line);
  }
}

/* Card: one link, one unit */
.card {
  display: flex;
  flex-direction: column;
  transition: transform var(--move);
}

.card-preview {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  transition: box-shadow var(--move);
}

.card-preview:not(.card-preview-inline) {
  border: 1px solid var(--line);
}

.card-preview img,
.card-preview svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-preview svg {
  transition: transform var(--move);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.card-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--faint);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.card-number {
  color: var(--muted);
  font-weight: 500;
}

.card-title {
  margin: 2px 0 0;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.3;
  transition: color var(--ease);
}

.card-description {
  margin: 0;
  color: var(--muted);
  text-wrap: pretty;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--accent-text);
  font-size: 0.95rem;
  font-weight: 500;
}

.card-soon {
  cursor: default;
}

.card-cta-soon {
  color: var(--faint);
}

/* Touch: no hover, so the card (and the product-page CTA) answers the press instead */
.card,
.product-cta {
  -webkit-tap-highlight-color: transparent;
}

@media (hover: none) {
  a.card:active {
    transform: translateY(1px) scale(0.99);
    transition-duration: 120ms;
  }

  .product-cta:active {
    transform: translateY(1px) scale(0.98);
    transition-duration: 120ms;
  }
}

.card-cta-arrow {
  display: inline-block;
  transition: transform var(--move);
}

/* Illustrations: parts that move (see public/previews/*.svg) */
.pv-cal-photo,
.pv-cal-today,
.pv-rem-row-hi,
.pv-veh-result,
.pv-veh-seg-accent {
  transition: transform var(--move);
}

.pv-cal-dot,
.pv-rem-chip-hi,
.pv-rem-dot {
  transform-box: fill-box;
  transform-origin: center;
}

.pv-veh-seg-accent {
  transform-box: fill-box;
  transform-origin: left center;
}

.pv-veh-dot-idle {
  transform-box: view-box;
  transform-origin: 200px 130px;
}

/* Idle: each illustration keeps one or two small parts slowly alive */
@keyframes pv-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes pv-pulse {
  0%,
  60%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  78% {
    transform: scale(2);
    opacity: 0.5;
  }
}

@keyframes pv-breathe {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12);
  }
}

/* The gauge needle sweeps along the arc; the arc length follows it (10deg ≈ 12.2px). */
@keyframes pv-orbit {
  0%,
  100% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(-10deg);
  }
}

@keyframes pv-gauge {
  0%,
  100% {
    stroke-dasharray: 136.3 400;
  }

  50% {
    stroke-dasharray: 124.1 400;
  }
}

.pv-cal-sun {
  animation: pv-float 3.6s ease-in-out infinite;
}

.pv-cal-dot {
  animation: pv-pulse 3.2s ease-in-out infinite;
}

.pv-cal-dot + .pv-cal-dot {
  animation-delay: 1.6s;
}

.pv-rem-avatar-hi {
  animation: pv-float 3.2s ease-in-out 0.6s infinite;
}

.pv-rem-chip-hi {
  animation: pv-breathe 3s ease-in-out infinite;
}

.pv-rem-dot {
  animation: pv-pulse 3.2s ease-in-out 0.8s infinite;
}

.pv-veh-dot-idle {
  animation: pv-orbit 4s ease-in-out infinite;
}

.pv-veh-value {
  animation: pv-gauge 4s ease-in-out infinite;
}

/* Hover: the card lifts a little and the illustration answers */
@media (hover: hover) {
  a.card:hover {
    transform: translateY(-3px);
  }

  a.card:hover .card-preview {
    box-shadow: 0 14px 32px -20px rgba(20, 20, 20, 0.35);
  }

  a.card:hover .card-preview svg {
    transform: translateY(-2px) scale(1.02);
  }

  a.card:hover .card-title {
    color: var(--accent);
  }

  a.card:hover .card-cta-arrow,
  .card-cta:hover .card-cta-arrow {
    transform: translateX(-4px);
  }

  a.card:hover .pv-cal-photo,
  a.card:hover .pv-cal-today {
    transform: translateY(-3px);
  }

  a.card:hover .pv-rem-row-hi {
    transform: translateX(-4px);
  }

  a.card:hover .pv-veh-result {
    transform: translateY(-2px);
  }

  a.card:hover .pv-veh-seg-accent {
    transform: scaleX(1.14);
  }
}

/* Page entrance: title, then the line under it, then the dot */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.hero-title {
  animation: rise 700ms var(--ease-out) both;
}

.hero-title .accent {
  animation: fade 450ms ease-out 620ms both;
}

.hero-intro {
  animation: rise 700ms var(--ease-out) 160ms both;
}

.projects {
  animation: fade 800ms ease-out 300ms both;
}

/* Scroll: cards reveal as they enter, the hero drifts as it leaves */
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hero-drift {
  to {
    opacity: 0.7;
    transform: translateY(-12px);
  }
}

@supports (animation-timeline: view()) {
  .hero {
    animation: hero-drift linear both;
    animation-timeline: view();
    animation-range: exit 0% exit 100%;
  }

  .section-head,
  .project,
  .about {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 45%;
  }

  @media (min-width: 640px) and (max-width: 1199px) {
    .project:nth-child(2n) {
      animation-range: entry 8% entry 53%;
    }
  }

  @media (min-width: 1200px) {
    .project:nth-child(3n + 2) {
      animation-range: entry 8% entry 53%;
    }

    .project:nth-child(3n) {
      animation-range: entry 16% entry 61%;
    }
  }
}

/* Not found */
.notfound {
  padding-block: clamp(64px, 18vh, 200px);
}

.notfound-code {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.notfound-title {
  margin: 0 0 24px;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 300;
  line-height: 1.2;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  color: var(--faint);
  font-size: 0.75rem;
}

.footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* The falcon, as a small seal after the credit */
.footer-mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  color: var(--muted);
  line-height: 0;
}

.footer-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* "What is BAZ": an asymmetric two-column editorial block between the
   project grid and the footer. Chosen from three candidates reviewed live. */
.about {
  padding-block: clamp(48px, 10vh, 96px);
  border-top: 1px solid var(--line);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 720px) {
  .about-grid {
    grid-template-columns: minmax(180px, 280px) 1fr;
    gap: 48px;
    align-items: start;
  }
}

.about-label {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 300;
  line-height: 1.25;
  color: var(--ink);
}

.about-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about-text {
  margin: 0;
  max-width: 54ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.about-sub {
  margin: 0;
  max-width: 54ch;
  color: var(--faint);
  font-size: 0.95rem;
  line-height: 1.55;
  text-wrap: pretty;
}

/* Product landing pages (/family-calendar, /family-reminders, /car-cost): a
   small SEO page that explains one product and sends the visitor to the real
   app. Reuses .card-preview/.card-cta-arrow from the project cards above. */
.product-page {
  padding-block: clamp(56px, 10vh, 100px) clamp(64px, 12vh, 140px);
}

.product-back {
  margin-bottom: 32px;
  font-size: 0.9rem;
}

.product-head {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

@media (min-width: 720px) {
  .product-head {
    flex-direction: row;
    align-items: stretch;
    gap: 40px;
  }

  .product-head .card-preview {
    flex: 0 0 38%;
  }

  .product-head-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-inline-start: 32px;
    border-inline-start: 1px solid var(--line);
  }
}

.product-meta {
  color: var(--faint);
  font-size: 0.85rem;
}

.product-title {
  margin: 10px 0 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 300;
  line-height: 1.2;
}

.product-description {
  margin: 14px 0 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.product-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 13px 26px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 1rem;
  font-weight: 500;
  transition: transform var(--move), box-shadow var(--move);
}

.product-cta .card-cta-arrow {
  transition: transform var(--move);
}

@media (hover: hover) {
  .product-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px -20px rgba(20, 20, 20, 0.45);
  }

  .product-cta:hover .card-cta-arrow {
    transform: translateX(-4px);
  }
}

/* A real screenshot under the product head: concrete alongside the abstract
   illustration above it. */
.product-shot {
  margin: clamp(40px, 8vh, 72px) 0 0;
}

.product-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.product-shot-caption {
  margin-top: 12px;
  color: var(--faint);
  font-size: 0.85rem;
}

/* Small screens */
@media (max-width: 639px) {
  .header-inner {
    min-height: 60px;
  }

  .hero {
    padding-block: 44px 32px;
  }

  .card-title {
    font-size: 1.25rem;
  }
}

/* Reduced motion (the device's accessibility setting): like most sites, the
   small stuff stays (hover, the tiny idle drift inside the illustrations, a
   soft entrance). Only scroll-linked movement is removed: the hero no longer
   drifts and the cards simply fade in instead of rising. */
@keyframes fade-only {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero {
    animation: none;
  }

  .hero-title,
  .hero-intro,
  .section-head,
  .project,
  .about {
    animation-name: fade-only;
  }
}
