/* Patternwire: tokens from the Figma file "Patternwire Website" */
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg-canvas: #ffffff;
  --bg-muted: #f5f5f4;
  --bg-ink: #161616;
  --bg-ink-raised: #242424;
  --text-primary: #161616;
  --text-secondary: #6b6b6b;
  --text-on-ink: #ffffff;
  --text-on-ink-muted: #a3a3a3;
  --accent: #b8431a;
  --accent-hover: #9c3814;
  --accent-on-ink: #f0834d;
  --border: #dededc;

  --radius-sm: 10px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --pad-x: 120px;
  --section-y: 120px;
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- type ramp ---------- */
.display-xl { font-size: 80px; line-height: 84px; font-weight: 600; letter-spacing: -0.03em; }
.display-l  { font-size: 56px; line-height: 60px; font-weight: 600; letter-spacing: -0.025em; }
.heading-l  { font-size: 40px; line-height: 44px; font-weight: 600; letter-spacing: -0.02em; }
.heading-m  { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.015em; }
.heading-s  { font-size: 21px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
.body-l     { font-size: 24px; line-height: 34px; letter-spacing: -0.01em; }
.body-m     { font-size: 17px; line-height: 26px; letter-spacing: -0.005em; }
.body-s     { font-size: 14px; line-height: 20px; }
.label-s    { font-size: 14px; line-height: 18px; font-weight: 500; }
.caption    { font-size: 12px; line-height: 16px; }
.muted      { color: var(--text-secondary); }
.sr-only    { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--pad-x)); margin: 0 auto; padding: 0 var(--pad-x); }
.section { padding: var(--section-y) 0; }
.section--muted { background: var(--bg-muted); }
.section--ink { background: var(--bg-ink); color: var(--text-on-ink); }
.section-head { max-width: 920px; margin: 0 auto 64px; text-align: center; display: grid; gap: 20px; }
.section-head .body-l { max-width: 760px; margin: 0 auto; color: var(--text-secondary); }
.section--ink .section-head .body-l { color: var(--text-on-ink-muted); }

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: var(--radius-pill); border: 0;
  font: inherit; font-size: 17px; line-height: 22px; letter-spacing: -0.005em;
  cursor: pointer; transition: background-color .2s ease, transform .2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--dark { background: var(--bg-ink); color: #fff; }
.btn--dark:hover { background: #000; }
.btn--light { background: var(--bg-canvas); color: var(--text-primary); }
.btn--light:hover { background: var(--bg-muted); }
.btn--ghost { background: var(--bg-muted); color: var(--text-primary); }
.btn--ghost:hover { background: var(--border); }
.link { color: var(--accent); font-size: 17px; line-height: 22px; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--bg-canvas); border-bottom: 1px solid var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 21px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
.wordmark img { width: 24px; height: 24px; }
.nav__links { display: flex; gap: 32px; font-size: 14px; line-height: 20px; }
.nav__links a:hover { color: var(--accent); }
.nav__toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav__toggle span { display: block; width: 22px; height: 2px; background: var(--text-primary); margin: 5px 0; transition: transform .25s ease; }

/* ---------- hero ---------- */
.hero { padding: 120px 0 96px; text-align: center; }
.hero h1 { max-width: 1000px; margin: 0 auto; }
/* each word box is taller than its line so descenders (g, y, p) stay inside their own box and never peek into view */
.rotator { display: block; height: 1.3em; margin-bottom: -0.25em; overflow: hidden; color: var(--accent); white-space: nowrap; }
.rotator__list { display: block; transition: transform .7s cubic-bezier(.65,0,.35,1); }
.rotator__item { display: block; height: 1.3em; line-height: 1.05em; padding-bottom: .25em; }
.hero__sub { max-width: 760px; margin: 24px auto 0; color: var(--text-secondary); }
.hero__actions { display: flex; gap: 24px; justify-content: center; align-items: center; margin-top: 32px; flex-wrap: wrap; }
.trust { margin-top: 96px; padding-top: 32px; border-top: 1px solid var(--border); display: grid; justify-items: center; gap: 24px; }
.trust__label { color: var(--text-secondary); font-size: 14px; }
/* sliding logo strip: the list is cloned once in JS and moved by -50% so the loop is seamless */
.marquee { width: min(820px, 100%); overflow: hidden; }
.marquee__track { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; width: max-content; animation: marquee 28s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track li { flex: none; padding-right: 72px; display: flex; align-items: center; height: 72px; }
@keyframes marquee { to { transform: translateX(-50%); } }
/* client logos in grey so they sit quietly under the hero; real colour on hover */
.trust__logos img { height: 56px; width: auto; filter: grayscale(1) contrast(.55) brightness(1.25); transition: filter .3s ease; }
.trust__logos img:hover { filter: none; }
.trust__logos .trust__lentera { height: 68px; }
.trust__word { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; color: #9a9a9a; }
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
  .marquee__track [aria-hidden="true"] { display: none; }
}

/* ---------- tiles ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.tile { background: var(--bg-muted); border-radius: var(--radius-lg); padding: 40px; display: grid; gap: 12px; align-content: start; }
.tile p.body-m { color: var(--text-secondary); }
.section--muted .tile { background: var(--bg-canvas); }

/* ---------- price list ---------- */
.rows { border-bottom: 1px solid var(--border); }
.row { display: grid; grid-template-columns: 320px 1fr 300px; gap: 40px; padding: 32px 0; border-top: 1px solid var(--border); align-items: start; }
.row .body-m { color: var(--text-secondary); }
.row__price { text-align: right; }
.custom { margin-top: 64px; background: var(--bg-ink); color: var(--text-on-ink); border-radius: var(--radius-lg); padding: 48px; display: flex; gap: 64px; align-items: center; }
.custom__copy { flex: 1; display: grid; gap: 16px; }
.custom__copy .body-m { color: var(--text-on-ink-muted); }
.custom__action { display: grid; gap: 16px; justify-items: end; }

/* ---------- work ---------- */
.bento { display: grid; grid-template-columns: 690fr 486fr; gap: 24px; }
.bento__side { display: grid; gap: 24px; }
.work { color: var(--text-on-ink); background: var(--bg-ink-raised); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.work__img { height: 300px; object-fit: cover; width: 100%; }
.work__body { padding: 32px; display: grid; gap: 12px; }
.work__body .body-m { color: var(--text-on-ink-muted); }
.work__link { color: var(--accent-on-ink); font-size: 17px; line-height: 22px; }
.work__link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.step { display: grid; gap: 16px; align-content: start; }
.step__num { color: var(--text-secondary); }
.step .body-m { color: var(--text-secondary); margin-top: -8px; }

/* ---------- faq ---------- */
.faq { border-bottom: 1px solid var(--border); }
.faq__row { display: grid; grid-template-columns: 440px 1fr; gap: 40px; padding: 28px 0; border-top: 1px solid var(--border); }
.faq__row .body-m { color: var(--text-secondary); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 480px 1fr; gap: 80px; }
.about .body-l { color: var(--text-secondary); }
.list { margin-top: 32px; border-bottom: 1px solid var(--border); }
.list > div { padding: 16px 0; border-top: 1px solid var(--border); }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 520px; gap: 80px; align-items: start; }
.contact__copy { display: grid; gap: 32px; }
.contact__copy > .body-l { color: var(--text-secondary); }
.lines { border-bottom: 1px solid var(--border); }
.lines > * { display: grid; gap: 4px; padding: 16px 0; border-top: 1px solid var(--border); }
.lines .caption { color: var(--text-secondary); }
a.lines__value:hover .body-m { color: var(--accent); }
.form { background: var(--bg-canvas); border-radius: var(--radius-lg); padding: 40px; display: grid; gap: 20px; position: relative; }
.field { display: grid; gap: 8px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 17px; line-height: 26px; color: var(--text-primary);
  background: var(--bg-canvas); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; transition: border-color .2s ease;
}
.field textarea { height: 120px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-secondary); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--text-primary); }
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--accent); }
.form__note { color: var(--text-secondary); }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 64px 0 40px; }
.footer__top { display: grid; grid-template-columns: 1fr 180px 180px 180px; gap: 64px; }
.footer__brand p { margin-top: 12px; max-width: 320px; color: var(--text-secondary); }
.footer__col { display: grid; gap: 12px; align-content: start; font-size: 14px; }
.footer__col a, .footer__col button { color: var(--text-secondary); line-height: 20px; }
.footer__col a:hover, .footer__col button:hover { color: var(--text-primary); }
.footer__col button { background: none; border: 0; padding: 0; font: inherit; text-align: left; cursor: pointer; }
.footer__bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-secondary); }

/* ---------- cookie banner ---------- */
.cookie {
  position: fixed; left: 24px; bottom: 24px; z-index: 100; width: min(440px, calc(100% - 48px));
  background: var(--bg-canvas); border: 1px solid var(--border); border-radius: 20px; padding: 24px;
  display: grid; gap: 16px; transform: translateY(calc(100% + 40px)); visibility: hidden;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), visibility 0s linear .45s;
}
.cookie.is-open { transform: none; visibility: visible; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.cookie p.body-s { color: var(--text-secondary); }
.cookie a { text-decoration: underline; text-underline-offset: 3px; }
.cookie__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cookie .btn { font-size: 15px; padding: 10px 18px; }

/* ---------- reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.js .reveal.is-in { opacity: 1; transform: none; }
.hero .reveal { transition-delay: calc(var(--d, 0) * 90ms); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .rotator__list { transition: none; }
}

/* ---------- legal page ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 96px 24px; }
.legal h1 { margin-bottom: 24px; }
.legal h2 { margin: 40px 0 12px; }
.legal p, .legal li { color: var(--text-secondary); font-size: 17px; line-height: 26px; }
.legal ul { padding-left: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  :root { --pad-x: 64px; }
  .row { grid-template-columns: 240px 1fr 220px; }
  .faq__row { grid-template-columns: 340px 1fr; }
  .about { grid-template-columns: 360px 1fr; }
  .contact { grid-template-columns: 1fr 460px; gap: 56px; }
}
@media (max-width: 960px) {
  :root { --pad-x: 32px; --section-y: 88px; }
  .display-xl { font-size: 60px; line-height: 64px; }
  .display-l { font-size: 44px; line-height: 48px; }
  .heading-l { font-size: 32px; line-height: 38px; }
  .body-l { font-size: 20px; line-height: 30px; }
  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .nav .btn { display: none; }
  .nav.is-open .nav__links { display: grid; gap: 4px; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-canvas); border-bottom: 1px solid var(--border); padding: 8px var(--pad-x) 24px; font-size: 21px; line-height: 44px; }
  .nav.is-open .nav__toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav.is-open .nav__toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .grid-3, .steps { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 1fr; gap: 8px; }
  .row__price { text-align: left; }
  .custom { flex-direction: column; align-items: stretch; gap: 32px; }
  .custom__action { justify-items: start; }
  .bento { grid-template-columns: 1fr; }
  .faq__row { grid-template-columns: 1fr; gap: 8px; }
  .about, .contact { grid-template-columns: 1fr; gap: 40px; }
  .footer__top { grid-template-columns: 1fr 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  :root { --pad-x: 20px; --section-y: 72px; }
  .display-xl { font-size: 42px; line-height: 46px; }
  .rotator { font-size: min(1em, 9.4vw); }
  .trust { gap: 20px; }
  .marquee__track li { padding-right: 48px; height: 60px; }
  .trust__word { font-size: 22px; }
  .trust__logos img { height: 44px; }
  .trust__logos .trust__lentera { height: 54px; }
  .display-l { font-size: 34px; line-height: 38px; }
  .heading-m { font-size: 24px; line-height: 30px; }
  .body-l { font-size: 18px; line-height: 27px; }
  .hero { padding: 72px 0 64px; }
  .grid-3, .grid-2, .steps { grid-template-columns: 1fr; }
  .tile { padding: 28px; }
  .custom, .form { padding: 28px; }
  .work__img { height: 200px; }
  .trust { gap: 24px; margin-top: 64px; }
  .footer__top { grid-template-columns: 1fr 1fr; gap: 40px; }
}

/* ---------- language switch ---------- */
.nav__end { display: flex; align-items: center; gap: 20px; }
.lang { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-secondary); padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); }
.lang:hover { color: var(--text-primary); border-color: var(--text-primary); }
@media (max-width: 960px) {
  .nav__end { margin-left: auto; margin-right: 12px; }
}

/* ---------- iPhone frame (same component as the portfolio) ---------- */
/* screen = black; bezel = inset ring; the top band is the status-bar area so the island never covers app content */
.iphone { --r: 46px; --b: 9px; --bar: 40px; position: relative; background: #000; border-radius: var(--r); padding: calc(var(--b) + var(--bar)) var(--b) var(--b); box-shadow: inset 0 0 0 var(--b) #111, inset 0 0 0 calc(var(--b) + 1px) #000, 0 0 0 1.5px #4a4a4a, 0 0 0 3px #1c1c1c, 0 30px 60px -20px #000; }
.iphone img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 0 0 calc(var(--r) - var(--b)) calc(var(--r) - var(--b)); }
.iphone__island { position: absolute; top: calc(var(--b) + 9px); left: 50%; width: 31%; height: 22px; margin-left: -15.5%; background: #000; border-radius: 999px; box-shadow: 0 0 0 1px #1a1a1a; }
.iphone::before, .iphone::after { content: ""; position: absolute; width: 3px; background: #2a2a2a; border-radius: 2px; }
.iphone::before { left: -4px; top: 22%; height: 9%; box-shadow: 0 54px 0 #2a2a2a; }
.iphone::after { right: -4px; top: 27%; height: 13%; }
.work__phones { position: relative; height: 300px; background: #1c1c1c; overflow: hidden; }
.work__phones .iphone { position: absolute; --r: 32px; --b: 6px; --bar: 26px; width: 180px; height: 380px; }
.work__phones .iphone__island { top: calc(var(--b) + 5px); height: 15px; }
.work__phones .iphone:nth-child(1) { left: 50%; margin-left: -300px; top: 64px; }
.work__phones .iphone:nth-child(2) { left: 50%; margin-left: -100px; top: 30px; z-index: 1; width: 200px; height: 420px; }
.work__phones .iphone:nth-child(3) { left: 50%; margin-left: 120px; top: 64px; }
@media (max-width: 600px) {
  .work__phones { height: 240px; }
  .work__phones .iphone:nth-child(1), .work__phones .iphone:nth-child(3) { display: none; }
}
