/* RERA SRLS. Cool neutral greys with one blue accent; light and dark follow the system setting. */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/geist-var.woff2") format("woff2");
}

:root {
  --surface-base: rgb(252 252 253);
  --surface-alt: rgb(243 245 247);
  --surface-raised: rgb(234 237 241);
  --photo-empty: rgb(226 230 235);
  --border: rgb(222 227 232);
  --text: rgb(17 22 28);
  --text-muted: rgb(80 91 104);
  --accent: rgb(14 99 156);
  --accent-hover: rgb(10 78 124);
  --accent-soft: rgb(14 99 156 / 0.1);
  --on-accent: rgb(252 252 253);
  --ok: rgb(21 110 64);
  --ok-soft: rgb(21 110 64 / 0.1);
  --shadow: 0 10px 28px -16px rgb(17 22 28 / 0.28);

  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --container: 1120px;
  --gutter: 32px;
  --header-h: 64px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-base: rgb(17 20 24);
    --surface-alt: rgb(24 28 33);
    --surface-raised: rgb(32 37 43);
    --photo-empty: rgb(38 43 50);
    --border: rgb(45 51 58);
    --text: rgb(236 239 242);
    --text-muted: rgb(160 170 181);
    --accent: rgb(102 170 224);
    --accent-hover: rgb(140 192 235);
    --accent-soft: rgb(102 170 224 / 0.14);
    --on-accent: rgb(12 20 28);
    --ok: rgb(110 200 150);
    --ok-soft: rgb(110 200 150 / 0.14);
    --shadow: 0 10px 28px -16px rgb(0 0 0 / 0.6);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--surface-base);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--accent);
}

::selection { background: var(--accent); color: var(--on-accent); }

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 10;
  padding: 10px 14px; background: var(--text); color: var(--surface-base);
  font-size: 14px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

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

/* Photo slots: real image when available, otherwise a plain grey block. */
.photo-empty { background: var(--photo-empty); }

/* ---------- Type ---------- */

.display {
  font-size: 56px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.section-title {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.lead {
  max-width: 60ch;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
}
.text-link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 160ms var(--ease-out);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 15px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(0.98); }
.btn--small { gap: 8px; padding: 10px 14px; font-size: 14px; }
.btn--small svg { width: 16px; height: 16px; }
.btn--block { width: 100%; padding-block: 16px; line-height: 1.25; text-align: center; white-space: normal; }
.btn--outline { background: var(--surface-base); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }

@media (hover: hover) {
  .btn:hover { background: var(--accent-hover); }
  .btn--outline:hover { background: var(--surface-alt); box-shadow: inset 0 0 0 1px var(--accent); }
  .text-link:hover { color: var(--accent-hover); }
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 2;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: var(--surface-base);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
  padding-inline: 40px;
}
.site-header--detail .site-header__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.logo { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 28px; }
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 160ms var(--ease-out);
}
.header-actions { display: flex; align-items: center; gap: 24px; }
@media (hover: hover) { .nav-link:hover { color: var(--text); } }

/* ---------- Hero (photo band, dark in both themes) ---------- */

.hero {
  position: relative;
  display: flex;
  min-height: min(600px, calc(100dvh - var(--header-h)));
  color: rgb(250 251 252);
  background: rgb(12 15 19);
  overflow: hidden;
}
.hero__media {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: right center;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgb(12 15 19 / 0.85) 0%, rgb(12 15 19 / 0.55) 55%, rgb(12 15 19 / 0.15) 100%);
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding-block: 96px;
}
.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  max-width: 720px;
}
.hero .lead { color: rgb(250 251 252 / 0.82); max-width: 560px; }

/* One authored moment: the hero copy settles in on first paint. */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy { animation: rise 700ms var(--ease-out) both; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Sections ---------- */

.section { padding-block: 88px; }
.section--bordered { border-top: 1px solid var(--border); }
.section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 40px;
}
.section-head__note { max-width: 60ch; font-size: 17px; color: var(--text-muted); }

/* ---------- Category cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--border);
  background: var(--surface-base);
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.card__media { aspect-ratio: 4 / 3; border-bottom: 1px solid var(--border); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 20px 20px 24px;
}
.card__title { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
.card__text { font-size: 15px; line-height: 1.55; color: var(--text-muted); }
.card__count { margin-top: auto; padding-top: 8px; font-size: 14px; font-weight: 500; color: var(--text-muted); }
.card__cta { font-size: 14px; font-weight: 600; color: var(--accent); }
.card__cta span { display: inline-block; transition: transform 200ms var(--ease-out); }

@media (hover: hover) {
  .card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
  .card:hover .card__cta span { transform: translateX(3px); }
}

/* ---------- Enquiry ---------- */

.enquiry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 56px;
  align-items: start;
}
.enquiry__intro { display: flex; flex-direction: column; gap: 18px; }
.enquiry__intro .lead { max-width: 440px; }

.contact-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

/* ---------- Category page ---------- */

/* Compact header on a tinted band: title (and optional one-line description) on the left, actions on the right. */
.cat-head { padding-bottom: 48px; border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.cat-head__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px 56px;
  margin-top: 40px;
}
.cat-head__title { display: flex; flex-direction: column; gap: 14px; }
.cat-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 32px 64px;
  border-top: 1px solid var(--border);
}
.pager a { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; transition: color 160ms var(--ease-out); }
.pager__next { margin-left: auto; }
@media (hover: hover) { .pager a:hover { color: var(--accent); } }

/* ---------- Machine list ---------- */

.machines { padding-block: 72px; }
.machines-empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 40px;
  border: 1px dashed var(--border);
}
.machines-empty__title { font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; }
.machines-empty p { max-width: 56ch; color: var(--text-muted); }
.machine-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0; padding: 0; list-style: none;
}
.machine {
  display: flex; flex-direction: column;
  height: 100%;
  border: 1px solid var(--border);
  background: var(--surface-base);
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.machine__media { aspect-ratio: 4 / 3; border-bottom: 1px solid var(--border); }
.machine__media img { width: 100%; height: 100%; object-fit: cover; }
.machine__body { display: flex; flex-direction: column; flex: 1; gap: 6px; padding: 24px; }
/* A machine alone in its list gets the full row: photo on the left, details on the right. */
@media (min-width: 810px) {
  .machine-grid > li:only-child { grid-column: 1 / -1; }
  .machine-grid > li:only-child .machine { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .machine-grid > li:only-child .machine__media { border-bottom: 0; border-right: 1px solid var(--border); }
  .machine-grid > li:only-child .machine__body { padding: 36px; }
  .machine-grid > li:only-child .machine__name { font-size: 28px; line-height: 1.2; letter-spacing: -0.025em; }
  .machine-grid > li:only-child .specs { margin-top: 20px; padding-top: 20px; gap: 16px 24px; }
}
@media (hover: hover) {
  .machine:hover { border-color: var(--accent); box-shadow: var(--shadow); }
  .machine:hover .card__cta span { transform: translateX(3px); }
}
.machine__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.machine__name { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
.machine__year { font-size: 14px; color: var(--text-muted); }
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 14px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
.specs dt { font-size: 13px; color: var(--text-muted); }
.specs dd { margin: 2px 0 0; font-size: 15px; font-weight: 500; }
.machine__foot { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: auto; padding-top: 18px; }
.machine__price { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.machine .card__cta { margin-left: auto; }
.machine--sold { background: var(--surface-alt); }
.machine--sold .machine__name, .machine--sold .specs dd { color: var(--text-muted); }

.badge { flex: none; padding: 3px 8px; font-size: 12px; font-weight: 600; line-height: 1.4; border-radius: 2px; white-space: nowrap; }
.badge--disponibile { background: var(--ok-soft); color: var(--ok); }
.badge--in-arrivo { background: var(--accent-soft); color: var(--accent); }
.badge--venduta { background: var(--surface-raised); color: var(--text-muted); }

/* ---------- Machine page ---------- */

.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 32px; font-size: 14px; color: var(--text-muted); }
.breadcrumb a { transition: color 160ms var(--ease-out); }
.breadcrumb [aria-current] { color: var(--text); }
@media (hover: hover) { .breadcrumb a:hover { color: var(--accent); } }
.machine-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-block: 32px 72px;
}
.gallery { display: flex; flex-direction: column; gap: 12px; }
.gallery__main { aspect-ratio: 4 / 3; }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.gallery__thumbs img { aspect-ratio: 1; width: 100%; object-fit: cover; }
.gallery__note { font-size: 14px; color: var(--text-muted); }
.machine-page__info { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.machine-page__meta { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-muted); }
.machine-page__title { font-size: 48px; }
.machine-page__price { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.machine-page__sold { padding: 16px 20px; background: var(--surface-alt); color: var(--text-muted); }
.machine-page__subtitle { margin-top: 16px; font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.spec-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; margin: 0; }
.spec-tiles div { padding: 14px 16px; background: var(--surface-alt); }
.spec-tiles dt { font-size: 13px; color: var(--text-muted); }
.spec-tiles dd { margin: 4px 0 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Simple pages (404) ---------- */

.notice { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; padding-block: 120px; max-width: 640px; }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 64px 32px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 32px 48px;
}
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h2 { font-size: 14px; font-weight: 600; line-height: 1.3; }
.footer-col p, .footer-col a { font-size: 15px; color: var(--text-muted); }
.footer-col .logo { color: var(--text); }
.footer-col a { transition: color 160ms var(--ease-out); }
.placeholder { font-style: italic; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
@media (hover: hover) { .footer-col a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; } }

/* ---------- Tablet (810-1199px) ---------- */

@media (max-width: 1199.98px) {
  .display { font-size: 48px; }
  .section-title { font-size: 36px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .enquiry { grid-template-columns: minmax(0, 1fr); }
  .enquiry .contact-panel { max-width: 560px; }
  .machine-page { gap: 40px; }
  .machine-page__title { font-size: 40px; }
}

/* ---------- Phone (<810px) ---------- */

@media (max-width: 809.98px) {
  :root { --gutter: 20px; }
  .display { font-size: 36px; line-height: 1.1; letter-spacing: -0.03em; }
  .section-title { font-size: 30px; line-height: 1.15; letter-spacing: -0.025em; }
  .lead { font-size: 17px; }
  .site-header__inner { padding-inline: var(--gutter); }
  .nav-links, .back-link { display: none; }
  .hero { min-height: 0; }
  .hero__inner { padding-block: 64px; }
  .section { padding-block: 56px 64px; }
  .section-head { margin-bottom: 28px; }
  .card-grid { grid-template-columns: 1fr; }
  .contact-panel { padding: 20px; }
  .cat-head { padding-bottom: 36px; }
  .cat-head__row { margin-top: 24px; gap: 24px; }
  .machines-empty { padding: 24px 20px; }
  .machine-grid { grid-template-columns: 1fr; }
  .machines { padding-block: 56px; }
  .machine__body { padding: 20px; }
  .machine-page { grid-template-columns: 1fr; gap: 28px; padding-block: 20px 56px; }
  .machine-page__title { font-size: 32px; }
  .breadcrumb { padding-top: 20px; }
  .pager a { font-size: 17px; }
  .site-footer { padding-block: 48px 28px; }
  .footer-bottom { flex-direction: column; }
}
