/* Perch Micro Markets — marketing site
   Dark charcoal, off-white, Inter. Mobile-first. */

:root {
  --ink: #0c0c0c;
  --ink-2: #161616;
  --paper: #f3f3f1;
  --paper-2: #fafaf8;
  --white: #ffffff;
  --cream: #f5f5f2;
  --muted: #5c5c58;
  --muted-on-dark: rgba(245, 245, 242, 0.68);
  --line: rgba(12, 12, 12, 0.1);
  --line-dark: rgba(255, 255, 255, 0.12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1180px;
  --nav-h: 4.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0;
}

h1 { font-size: clamp(2.35rem, 6vw, 4.35rem); }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.85rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.7rem); }

p { margin: 0; }

ul, ol { margin: 0; padding: 0; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--white);
  color: var(--ink);
  padding: 0.6rem 1rem;
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.45rem;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), opacity 0.25s var(--ease);
}

.btn-lg { padding: 1.05rem 1.7rem; font-size: 0.875rem; }
.btn-full { width: 100%; }
.btn-nav { padding: 0.7rem 1.15rem; }

.btn-solid-light {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
}
.btn-solid-light:hover { background: var(--cream); }

.btn-outline-light {
  background: transparent;
  color: var(--cream);
  border-color: rgba(255, 255, 255, 0.55);
}
.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--white);
}

.btn-solid-dark {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.btn-solid-dark:hover { opacity: 0.88; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  color: var(--cream);
  background: transparent;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled,
.nav.is-open {
  background: rgba(12, 12, 12, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line-dark);
}

.nav-inner {
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  height: 100%;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo,
.footer-brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 0.22rem;
}

.logo-mark {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.28em;
}

.logo-sub {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.62;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 1.35rem;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

.nav.is-open .nav-toggle-bar:first-child {
  transform: translateY(3.75px) rotate(45deg);
}
.nav.is-open .nav-toggle-bar:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

.nav-panel {
  display: none;
}

.nav.is-open .nav-panel {
  display: flex;
  flex-direction: column;
  position: absolute;
  left: 0;
  right: 0;
  top: var(--nav-h);
  background: rgba(12, 12, 12, 0.97);
  padding: 1.25rem 1.25rem 2rem;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line-dark);
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.7rem 0;
  opacity: 0.78;
  transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 1; }

.nav-panel .btn-nav { align-self: flex-start; }

@media (min-width: 860px) {
  .nav-toggle { display: none; }

  .nav-panel {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: static;
    background: none;
    padding: 0;
    gap: 2.25rem;
    border: 0;
  }

  .nav-links {
    flex-direction: row;
    gap: 1.75rem;
  }

  .nav-links a { padding: 0; font-size: 0.8125rem; letter-spacing: 0.04em; }

  .nav-inner { padding: 0 2rem; }
}

/* Full-bleed hero; fixed nav overlays the top of the image. */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  color: var(--cream);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 70% center;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(12, 12, 12, 0.78) 0%, rgba(12, 12, 12, 0.48) 42%, rgba(12, 12, 12, 0.22) 100%),
    linear-gradient(180deg, rgba(12, 12, 12, 0.5) 0%, rgba(12, 12, 12, 0.12) 28%, rgba(12, 12, 12, 0.28) 62%, rgba(12, 12, 12, 0.82) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  padding: 4.5rem 1.25rem 4rem;
}

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
  margin-bottom: 1.15rem;
}

.eyebrow.dark { color: var(--muted); }

.hero h1 {
  max-width: 16em;
  color: var(--white);
}

.hero h1 .title-line {
  display: block;
  margin-top: 0.28em;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero-lead {
  max-width: 38rem;
  margin-top: 1.35rem;
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  color: var(--muted-on-dark);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

@media (min-width: 860px) {
  .hero { align-items: center; }
  .hero-content { padding: 7rem 2rem 5.5rem; }
  .hero-bg { object-position: center right; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-content {
    animation: rise 0.9s var(--ease) both;
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- Stats ---------- */
.stats {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats-grid {
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.stat {
  padding: 1.6rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.stat:nth-child(odd) { border-right: 1px solid var(--line); }
.stat:nth-last-child(-n + 2) { border-bottom: 0; }

.stat-value {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.stat-label {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (min-width: 860px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stat {
    padding: 2.15rem 2rem;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .stat:last-child { border-right: 0; }
}

/* ---------- Use cases ---------- */
.use-cases {
  background: var(--paper-2);
  padding: 4.5rem 1.25rem 2rem;
}

.section-head {
  max-width: var(--max);
  margin: 0 auto 3rem;
}

.section-head h2 { max-width: 18ch; }

.use-row {
  max-width: var(--max);
  margin: 0 auto 3.5rem;
  display: grid;
  gap: 1.5rem;
}

.use-photo {
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  aspect-ratio: 3 / 2;
}

.use-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

@media (prefers-reduced-motion: no-preference) {
  .use-row:hover .use-photo img { transform: scale(1.03); }
}

.use-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.25rem 0 0.5rem;
}

.use-copy p {
  margin-top: 0.85rem;
  color: var(--muted);
  max-width: 36rem;
}

.use-bullets {
  list-style: none;
  margin-top: 1.35rem;
  display: grid;
  gap: 0.65rem;
}

.use-bullets li {
  padding-left: 1.15rem;
  position: relative;
  font-size: 0.95rem;
  font-weight: 500;
}

.use-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.55rem;
  height: 1px;
  background: var(--ink);
}

@media (min-width: 900px) {
  .use-cases { padding: 7rem 2rem 3.5rem; }
  .use-row {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4.5rem;
    align-items: center;
    margin-bottom: 6.5rem;
  }
  .use-row-reverse { grid-template-columns: 0.85fr 1.15fr; }
  .use-row-reverse .use-photo { order: 2; }
  .use-row-reverse .use-copy { order: 1; padding-left: 0.5rem; }
  .use-row:last-child { margin-bottom: 0; }
  .use-copy { padding: 1rem 0; }
}

/* ---------- Technology ---------- */
.technology {
  background: var(--ink);
  color: var(--cream);
  padding: 4.5rem 1.25rem;
}

.tech-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 2.25rem;
}

.tech-copy h2 { max-width: 14ch; color: var(--white); }

.tech-lead {
  margin-top: 1.2rem;
  color: var(--muted-on-dark);
  max-width: 34rem;
}

.tech-features {
  list-style: none;
  margin-top: 2.25rem;
  display: grid;
  gap: 0;
}

.tech-features li {
  padding: 1.15rem 0;
  border-top: 1px solid var(--line-dark);
}

.tech-features li:last-child { border-bottom: 1px solid var(--line-dark); }

.tech-feature-name {
  display: block;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.tech-feature-desc {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted-on-dark);
  font-size: 0.95rem;
}

.tech-photo {
  margin: 0;
  overflow: hidden;
  background: var(--ink-2);
  aspect-ratio: 3 / 2;
}

.tech-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 900px) {
  .technology { padding: 7rem 2rem; }
  .tech-grid {
    grid-template-columns: 0.92fr 1.08fr;
    gap: 5rem;
    align-items: center;
  }
}

/* ---------- Process ---------- */
.process {
  background: var(--paper-2);
  padding: 4.5rem 1.25rem;
}

.process-grid {
  max-width: var(--max);
  margin: 0 auto;
  list-style: none;
  display: grid;
  gap: 0;
  counter-reset: none;
}

.process-step {
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
}

.process-step:last-child { border-bottom: 1px solid var(--line); }

.process-num {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.process-step p {
  margin-top: 0.55rem;
  color: var(--muted);
  max-width: 28rem;
}

@media (min-width: 800px) {
  .process { padding: 7rem 2rem; }
  .process-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
  }
  .process-step {
    padding: 0 2.5rem 0 0;
    border-top: 0;
    border-right: 1px solid var(--line);
  }
  .process-step:first-child { padding-left: 0; }
  .process-step:last-child {
    border-right: 0;
    border-bottom: 0;
    padding-right: 0;
    padding-left: 2.5rem;
  }
  .process-step:nth-child(2) { padding: 0 2.5rem; }
}

/* ---------- Contact / form ---------- */
.contact {
  background: var(--paper);
  padding: 4.5rem 1.25rem 5.5rem;
}

.contact-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 2.5rem;
}

.contact-intro h2 { max-width: 12ch; }

.contact-intro > p {
  margin-top: 1.1rem;
  color: var(--muted);
  max-width: 32rem;
}

.contact-note {
  font-size: 0.9rem;
}

.lead-form,
.form-thanks {
  background: var(--paper-2);
  padding: 1.5rem 1.25rem 1.6rem;
}

.field { margin-bottom: 1.05rem; }

.field-row {
  display: grid;
  gap: 0;
}

.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(12, 12, 12, 0.22);
  border-radius: 0;
  padding: 0.55rem 0 0.65rem;
  outline: none;
  transition: border-color 0.2s;
}

.field textarea { resize: vertical; min-height: 6.5rem; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-bottom-color: var(--ink);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%230c0c0c' stroke-width='1.2' d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 1.4rem;
}

.form-fine {
  margin-top: 0.9rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.form-thanks[hidden] { display: none; }
.form-thanks h2 { margin-bottom: 0.75rem; }
.form-thanks a { text-decoration: underline; text-underline-offset: 0.15em; }

@media (min-width: 800px) {
  .contact { padding: 7rem 2rem 8rem; }
  .contact-grid {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 5rem;
    align-items: start;
  }
  .lead-form,
  .form-thanks { padding: 2.25rem 2.15rem 2.1rem; }
  .field-row {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: var(--cream);
  padding: 2.5rem 1.25rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 0.85rem;
}

.footer-nap {
  font-style: normal;
  font-size: 0.875rem;
  color: var(--muted-on-dark);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-contact a {
  font-size: 0.875rem;
  opacity: 0.85;
}
.footer-contact a:hover { opacity: 1; }

@media (min-width: 800px) {
  .footer { padding: 2.75rem 2rem; }
  .footer-inner {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1.5rem;
  }
  .footer-nap { justify-self: end; text-align: right; }
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.lead-form :focus-visible,
.use-cases :focus-visible,
.process :focus-visible,
.contact :focus-visible {
  outline-color: var(--ink);
}

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

@media print {
  .nav { display: none !important; }
  .hero { min-height: auto; }
  .hero-overlay { background: rgba(12,12,12,0.55); }
}
