/* Northgate Homes: carta calda, verde profondo, ogni casa è un plastico. */
@font-face { font-family: 'Newsreader'; src: url('fonts/Newsreader.ttf') format('truetype'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('fonts/PublicSans.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #f6f2ec;
  --card: #fbf9f5;
  --sand: #ece5d9;
  --ink: #1d2620;
  --ink-2: #57605a;
  --green: #1f3d2b;
  --green-2: #2e5640;
  --clay: #b5674a;
  --line: #ded6c8;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Public Sans', 'Helvetica Neue', Arial, sans-serif;
  --t-hero: clamp(2.6rem, 1.3rem + 4.2vw, 5.25rem);
  --t-h2: clamp(2rem, 1.3rem + 2.2vw, 3.4rem);
  --t-small: 0.9375rem;
  --m: max(20px, 4.5vw);
  --r: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 4px; }
button, input, select, output { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
::selection { background: var(--green); color: var(--paper); }
:focus-visible { outline: 2.5px solid var(--green); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.h2 { font-family: var(--serif); font-size: var(--t-h2); font-weight: 500; line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; }
.note { font-size: 0.8125rem; color: var(--ink-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px; border: 0; border-radius: var(--r); background: var(--green); color: var(--paper); font-weight: 650; text-decoration: none; cursor: pointer; transition: background-color 0.25s, transform 0.25s var(--ease); }
.btn:hover { background: var(--green-2); }
.btn:active { transform: scale(0.98); }
.btn .ic { transition: transform 0.35s var(--ease); }
.btn:hover .ic { transform: translateX(3px); }
.btn--full { width: 100%; }
.link { padding: 3px 0; border: 0; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat; font-weight: 650; color: var(--green); cursor: pointer; text-decoration: none; transition: background-size 0.35s var(--ease); }
.link:hover { background-size: 0 1.5px; background-position: 100% 100%; }

/* logo */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); }
.logo__mark { width: 30px; height: 30px; }
.logo__word { display: grid; font-family: var(--serif); font-size: 1.375rem; font-weight: 600; line-height: 0.95; letter-spacing: -0.01em; }
.logo__word small { font-family: var(--sans); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-2); }

/* testata */
.top { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 24px; min-height: 72px; padding: 0 var(--m); background: rgba(246, 242, 236, 0.96); border-bottom: 1px solid var(--line); }
.top__back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.8125rem; font-weight: 600; text-decoration: none; color: var(--ink-2); transition: border-color 0.25s, color 0.25s; }
.top__back:hover { border-color: var(--green); color: var(--green); }
.top__back .ic { width: 15px; height: 15px; }
.top__nav { justify-self: end; display: flex; gap: 28px; font-weight: 550; font-size: var(--t-small); }
.top__nav a { text-decoration: none; color: var(--ink-2); transition: color 0.2s; }
.top__nav a:hover { color: var(--green); }
.saved { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-weight: 650; cursor: pointer; transition: border-color 0.2s; }
.saved:hover { border-color: var(--green); }
.saved .ic { color: var(--clay); }
.saved.is-bump { animation: bump 0.5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.12); } }

/* apertura */
.hero { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 48px; align-items: center; padding: clamp(48px, 6vw, 88px) var(--m) clamp(64px, 7vw, 104px); }
.hero__text { display: grid; gap: 22px; }
.hero__title { font-family: var(--serif); font-size: var(--t-hero); font-weight: 500; line-height: 0.98; letter-spacing: -0.025em; max-width: 12ch; text-wrap: balance; }
.hero__lead { max-width: 40ch; font-size: 1.1875rem; color: var(--ink-2); }
.search { display: grid; gap: 18px; max-width: 520px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.search__row { display: grid; gap: 10px; }
.search__label { font-size: var(--t-small); font-weight: 650; color: var(--ink-2); }
.search__label output { color: var(--ink); font-family: var(--serif); font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.range { width: 100%; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(var(--green), var(--green)) 0 / var(--fill, 50%) 100% no-repeat, var(--line); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--green); box-shadow: 0 4px 10px -4px rgba(31, 61, 43, 0.5); transition: transform 0.2s var(--ease); }
.range:active::-webkit-slider-thumb { transform: scale(1.15); }
.range::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
.range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--green); }
.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 2px solid var(--green); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button, .types button { min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); font-weight: 600; font-size: var(--t-small); cursor: pointer; transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
.seg button:hover, .types button:hover { border-color: var(--green); }
.seg [aria-checked='true'] { background: var(--green); border-color: var(--green); color: var(--paper); }
.types [aria-pressed='true'] { background: #e5ece6; border-color: var(--green); color: var(--green); }
.types [aria-pressed='true']::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7' fill='none' stroke='%23000' stroke-width='2.4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7' fill='none' stroke='%23000' stroke-width='2.4'/%3E%3C/svg%3E") center / contain no-repeat; }
.types { display: flex; flex-wrap: wrap; gap: 6px; }
.search__go { justify-self: stretch; }
.search__go span { font-variant-numeric: tabular-nums; }
.feature { position: relative; overflow: hidden; border-radius: 22px; background: #efe9de; aspect-ratio: 9 / 10; }
.feature img { width: 100%; height: 100%; object-fit: cover; }
.feature__card { position: absolute; left: 20px; bottom: 20px; display: grid; gap: 2px; padding: 18px 20px; border-radius: 14px; background: var(--card); box-shadow: 0 18px 40px -24px rgba(29, 38, 32, 0.45); }
.feature__mo { color: var(--green) !important; font-weight: 650; }
.feature__price { font-family: var(--serif); font-size: 1.875rem; font-weight: 600; line-height: 1.1; }
.feature__card span { color: var(--ink-2); font-size: var(--t-small); }
.feature__card .link { justify-self: start; margin-top: 8px; }

/* case e mappa */
.homes { padding: clamp(72px, 9vw, 120px) var(--m) 0; border-top: 1px solid var(--line); }
.homes__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 36px; }
.sort { display: inline-flex; align-items: center; gap: 10px; font-size: var(--t-small); color: var(--ink-2); }
.sort select { appearance: none; min-height: 44px; padding: 0 40px 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%231f3d2b' stroke-width='1.8'/%3E%3C/svg%3E") right 12px center / 16px no-repeat; color: var(--ink); cursor: pointer; }
.homes__body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.card { position: relative; display: grid; border: 1px solid var(--line); border-radius: 16px; background: var(--card); overflow: hidden; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s, opacity 0.35s; }
.card:hover, .card.is-on { transform: translateY(-4px); border-color: #c8bca8; box-shadow: 0 24px 44px -30px rgba(29, 38, 32, 0.5); }
.card.is-enter { animation: enter 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }
.card__open { display: grid; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.card__img { overflow: hidden; aspect-ratio: 4 / 3; background: var(--sand); }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.card:hover .card__img img { transform: scale(1.04); }
.card__body { display: grid; gap: 4px; padding: 16px 18px 18px; }
.card__price { font-family: var(--serif); font-size: 1.625rem; font-weight: 600; line-height: 1.15; }
.card__addr { font-weight: 600; }
.card__area { font-size: var(--t-small); color: var(--ink-2); }
.card__mo { font-size: var(--t-small); font-weight: 650; color: var(--green); }
.card__specs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); font-size: var(--t-small); color: var(--ink-2); }
.card__specs span { display: inline-flex; align-items: center; gap: 6px; }
.card__specs .ic { width: 16px; height: 16px; }
.heart { position: absolute; right: 12px; top: 12px; z-index: 2; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--card); color: var(--ink-2); cursor: pointer; transition: transform 0.25s var(--ease), color 0.2s; }
.heart:hover { transform: scale(1.08); color: var(--clay); }
.heart[aria-pressed='true'] { color: var(--clay); }
.heart[aria-pressed='true'] .ic { fill: currentColor; }
.town { position: sticky; top: 96px; overflow: hidden; border-radius: 18px; border: 1px solid var(--line); background: var(--sand); }
.town svg { display: block; width: 100%; height: auto; }
.pins { position: absolute; inset: 0; }
.pin { position: absolute; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 0; border-radius: 999px; background: var(--green); color: var(--paper); font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; translate: -50% -100%; cursor: pointer; transition: transform 0.35s var(--ease), background-color 0.25s, opacity 0.3s; }
.pin::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); z-index: -1; }
.pin:hover, .pin.is-on { transform: translateY(-6px) scale(1.14); background: var(--paper); color: var(--green); box-shadow: 0 0 0 2px var(--green), 0 10px 18px -8px rgba(29, 38, 32, 0.6); z-index: 2; }
.pin.is-out { opacity: 0.25; pointer-events: none; }
.town__note { position: absolute; left: 12px; bottom: 10px; font-size: 0.75rem; color: #5c5447; }
.homes__empty { padding: 32px 0; color: var(--ink-2); }
.homes__est { flex-basis: 100%; order: 3; margin-top: -8px; }

/* vendere */
.sell { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: start; padding: clamp(80px, 10vw, 136px) var(--m) 0; }
.sell__text { display: grid; gap: 20px; }
.sell__text > p { max-width: 50ch; color: var(--ink-2); font-size: 1.125rem; }
.sell__steps { display: grid; gap: 0; counter-reset: s; border-top: 1px solid var(--line); }
.sell__steps li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.sell__steps b { font-family: var(--serif); font-size: 1.375rem; font-weight: 600; }
.sell__steps span { color: var(--ink-2); }
.valuation { display: grid; gap: 14px; padding: 26px; border-radius: 16px; background: var(--green); color: var(--paper); }
.valuation h3 { font-family: var(--serif); font-size: 1.75rem; font-weight: 500; }
.valuation .field span { color: #c9d6cc; }
.valuation .field input { border-color: #3c6a50; background: #24452f; color: var(--paper); }
.valuation .btn { background: var(--paper); color: var(--green); }
.valuation .btn:hover { background: #fff; }
.valuation .note { color: #c9d6cc; }
.valuation .form-ok { background: #24452f; color: var(--paper); }
.field { display: grid; gap: 6px; font-size: var(--t-small); font-weight: 600; color: var(--ink-2); }
.field input { min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); font-size: 1rem; color: var(--ink); }
.field input:focus { outline: none; border-color: var(--green); }
.field input:focus-visible { outline: 2.5px solid var(--green); outline-offset: 2px; }
.valuation :focus-visible { outline-color: var(--paper); }
.field input[aria-invalid='true'] { border-color: #b42318; }
.form-err { color: #b42318; font-size: var(--t-small); }
.valuation .form-err { color: #ffc9bd; }
.form-ok { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--sand); font-weight: 600; }

/* ufficio */
.office { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px 48px; padding: clamp(80px, 10vw, 136px) var(--m) clamp(80px, 9vw, 120px); }
.office__facts { display: grid; border-top: 1px solid var(--line); }
.office__facts div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.office__facts dt { color: var(--ink-2); }
.office__facts dd { font-weight: 600; }
.office .note { grid-column: 2; }

/* piede */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px 40px; padding: 40px var(--m) 48px; border-top: 1px solid var(--line); }
.foot p { max-width: 64ch; font-size: var(--t-small); color: var(--ink-2); }
.foot p a { color: var(--green); font-weight: 600; }

/* scheda della casa */
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(29, 38, 32, 0.45); animation: fade 0.3s both; }
@keyframes fade { from { opacity: 0; } }
.sheet__card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(1180px, 100%); max-height: calc(100svh - 48px); overflow: hidden; border-radius: 22px; background: var(--card); animation: up 0.5s var(--ease) both; }
@keyframes up { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
.sheet__x { position: absolute; right: 14px; top: 14px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--card); cursor: pointer; }
.sheet__img { overflow: hidden; background: var(--sand); }
.sheet__img img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 38%; transform: scale(1.25); }
.sheet__body { display: grid; align-content: start; gap: 14px; padding: 32px; overflow-y: auto; }
.sheet__area { margin-top: -6px; font-size: var(--t-small); color: var(--ink-2); }
.sheet__addr { font-family: var(--serif); font-size: 2.25rem; font-weight: 500; line-height: 1.05; }
.sheet__price { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--green); }
.specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.specs li { display: grid; gap: 2px; padding: 12px; border-radius: var(--r); background: var(--paper); }
.specs b { font-size: 1.125rem; }
.specs span { font-size: 0.8125rem; color: var(--ink-2); }
.sheet__desc { color: var(--ink-2); }
.calc, .view { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.calc h4, .view h4 { font-family: var(--serif); font-size: 1.375rem; font-weight: 600; }
.calc__out { display: flex; align-items: baseline; gap: 10px; }
.calc__out b { font-family: var(--serif); font-size: 2.5rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; color: var(--green); }
.calc__out span { color: var(--ink-2); font-size: var(--t-small); }
.calc__row { display: grid; gap: 6px; font-size: var(--t-small); font-weight: 600; color: var(--ink-2); }
.calc__row output { color: var(--ink); }
.calc__pair { grid-template-columns: auto 1fr; gap: 20px; align-items: end; }
.calc__pair label, .calc__pair > div { display: grid; gap: 6px; }
.calc__input { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.calc__input input { width: 84px; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.seg--small button { min-height: 38px; padding: 0 12px; }
.seg--days button { display: grid; min-height: 56px; padding: 6px 12px; line-height: 1.15; text-align: center; }
.seg--days small { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: var(--t-small); font-weight: 600; transform: translate(-50%, 140%); opacity: 0; transition: transform 0.45s var(--ease), opacity 0.3s; pointer-events: none; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* entrata: solo l'apertura */
.js .hero__text > *, .js .feature { animation: rise 0.8s var(--ease) both; }
.js .hero__text > :nth-child(2) { animation-delay: 0.06s; }
.js .hero__text > :nth-child(3) { animation-delay: 0.12s; }
.js .feature { animation-delay: 0.18s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* tablet e telefono */
@media (max-width: 1080px) {
  .top { grid-template-columns: auto auto 1fr auto; }
  .hero, .homes__body, .sell, .office { grid-template-columns: 1fr; }
  .town { position: relative; top: 0; order: -1; }
  .office .note { grid-column: 1; }
  .sheet__card { grid-template-columns: 1fr; overflow-y: auto; }
  .sheet__img { aspect-ratio: 4 / 3; }
  .sheet__body { overflow: visible; }
}
@media (max-width: 700px) {
  .top { grid-template-columns: auto 1fr auto; gap: 12px; }
  .top__nav { display: none; }
  .logo { justify-self: center; }
  .logo__word { font-size: 1.125rem; }
  .search { padding: 18px; }
  .cards { grid-template-columns: 1fr; }
  .feature { aspect-ratio: auto; display: grid; overflow: visible; background: none; }
  .feature img { aspect-ratio: 9 / 10; border-radius: 22px; background: #ece5d9; }
  .feature__card { position: static; margin-top: -40px; margin-inline: 16px; }
  .town svg text { font-size: 22px; }
  .sell__steps li { grid-template-columns: 1fr; gap: 4px; }
  .office__facts div { grid-template-columns: 1fr; gap: 2px; }
  .sheet { padding: 0; align-items: end; }
  .sheet__card { max-height: 94svh; border-radius: 20px 20px 0 0; }
  .sheet__body { padding: 22px; }
  .specs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calc__pair { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
