/* The blocks of marketing/BLOCKS.md, plus the one-off sections.
   Every color, font, radius, duration and curve is a token from tokens.css. */

:root {
  --bar-height: 4.5rem;
}

[hidden] {
  display: none !important;
}

/* entrance: visible by default; page.js hides then shows when motion is allowed */
.reveal {
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

.reveal.is-waiting {
  opacity: 0;
  transform: translateY(12px);
}

/* ---------- wordmark ---------- */
.wordmark {
  display: inline-block;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 400;
  letter-spacing: var(--track-logo);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark small {
  display: block;
  margin-top: 0.2em;
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: var(--track-logo);
}

.wordmark--large {
  margin-bottom: 2.5rem;
  font-size: 1.5rem;
}

.wordmark--large small {
  font-size: 0.625rem;
}

/* ---------- block 1 · section opening ---------- */
.eyebrow {
  margin-bottom: 0.25rem;
  color: var(--brand-deep);
  font-family: var(--display);
  font-size: var(--fs-lede);
  font-style: italic;
  font-weight: 300;
}

.rule {
  width: 56px;
  height: 2px;
  margin-top: 1.5rem;
  background: var(--accent);
}

.lede {
  max-width: var(--max-narrow);
  margin-top: var(--space-block);
  color: var(--ink-soft);
}

.opening + * {
  margin-top: var(--space-block);
}

/* ---------- block 2 · action button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 14px 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: box-shadow var(--dur-fast) var(--ease);
}

.btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink);
}

.btn--primary:hover {
  box-shadow: var(--shadow);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: var(--space-block);
}

/* ---------- block 3 · quiet link ---------- */
.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-deep);
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  cursor: pointer;
  transition: text-decoration-thickness var(--dur-fast) var(--ease);
}

.link:hover {
  text-decoration-thickness: 2px;
}

/* a quiet link that stands alone gets a thumb-sized target */
.actions .link,
.card__actions .link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---------- top bar ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: calc(var(--max) + 2 * var(--gutter));
  min-height: var(--bar-height);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- hero ---------- */
.hero {
  scroll-margin-top: var(--bar-height);
}

.hero__photo {
  width: 100%;
}

.hero__facts {
  margin-top: 1.5rem;
  color: var(--ink-soft);
}

/* ---------- labels, prices, photos ---------- */
.label {
  color: var(--brand-deep);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.price {
  color: var(--brand-deep);
  font-family: var(--display);
  font-size: var(--fs-title);
}

.price small {
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: var(--fs-small);
}

.photo {
  width: 100%;
  margin-top: var(--space-block);
  border-radius: var(--radius-card);
}

/* ---------- block 5 · stat ---------- */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 5rem;
}

.stat b {
  display: block;
  color: var(--brand-deep);
  font-family: var(--display);
  font-size: var(--fs-heading);
  font-weight: 300;
  line-height: 1.1;
}

.stat span {
  color: var(--ink-soft);
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

/* ---------- block 4 · villa card ---------- */
.villas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 2.5rem;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-2);
  box-shadow: var(--shadow);
}

.card > img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card__body {
  padding: 1.5rem 1.75rem 1.75rem;
}

.card__body h3 {
  margin: 0.5rem 0;
}

.card__facts {
  color: var(--ink-soft);
}

.card__body .price {
  margin-top: 0.75rem;
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}

/* ---------- block 6 · dash list ---------- */
.dash-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  column-gap: 3.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-list li {
  display: flex;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--line);
}

.dash-list li::before {
  content: "—";
  flex: none;
  color: var(--accent);
}

* + .dash-list {
  margin-top: var(--space-block);
}

/* ---------- the signature: one deep lagoon band ---------- */
.band {
  background: var(--brand-deep);
  color: var(--bg);
}

.band .eyebrow,
.band h2,
.band .lede,
.band .stat span {
  color: var(--bg);
}

.band h2 em {
  color: var(--bg-2);
}

.band .stat b {
  color: var(--accent);
}

.band :focus-visible {
  outline-color: var(--bg);
}

/* ---------- payment schedule ---------- */
.schedule {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.schedule th,
.schedule td {
  padding: 0.875rem 1rem 0.875rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.schedule thead th {
  color: var(--brand-deep);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.schedule tbody th {
  font-weight: 500;
}

.schedule td:nth-child(2) {
  color: var(--brand-deep);
  font-family: var(--display);
  font-size: var(--fs-title);
  line-height: 1.1;
  white-space: nowrap;
}

.schedule td:last-child {
  color: var(--ink-soft);
}

/* the payment calculator: a villa chooser above the schedule, an amount column, a total row */
.calc__choose {
  min-width: 0;
  margin: 0 0 2rem;
  padding: 0;
  border: 0;
}

.calc__choose legend {
  margin-bottom: 1rem;
  padding: 0;
}

.section--alt .choice span {
  background: var(--bg);
}

.schedule [data-amount],
.schedule tfoot td {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.schedule tbody [data-amount] {
  color: var(--ink);
  font-weight: 500;
}

.schedule tfoot th,
.schedule tfoot td {
  border-bottom: 0;
}

.schedule tfoot th,
.schedule tfoot td:nth-child(3) {
  color: var(--brand-deep);
  font-family: var(--display);
  font-size: var(--fs-title);
  font-weight: 400;
  line-height: 1.1;
}

.calc .hint {
  margin-top: 1rem;
}

/* phone: the milestone drops under the instalment name, leaving Đợt · Tỷ lệ · Số tiền */
@media (max-width: 40rem) {
  .schedule,
  .schedule thead,
  .schedule tbody,
  .schedule tfoot {
    display: block;
  }

  .schedule tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3.25rem 11rem;
    column-gap: 0.5rem;
    align-items: baseline;
    border-bottom: 1px solid var(--line);
  }

  .schedule tfoot tr {
    border-bottom: 0;
  }

  .schedule th,
  .schedule td {
    padding-right: 0;
    border-bottom: 0;
  }

  .schedule thead th:last-child {
    display: none;
  }

  .schedule tbody td:last-child,
  .schedule tfoot td:last-child {
    grid-column: 1 / -1;
    padding-top: 0;
    font-size: var(--fs-small);
  }

  .schedule td:nth-child(2) {
    font-size: var(--fs-body);
    font-family: var(--body);
    line-height: inherit;
  }

  .schedule tfoot th,
  .schedule tfoot td:nth-child(3) {
    font-size: var(--fs-body);
    font-family: var(--body);
    font-weight: 500;
    line-height: inherit;
  }
}

/* ---------- block 7 · document row ---------- */
.docs {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.doc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  padding: 1.5rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease);
}

.doc:hover {
  background: var(--bg-2);
}

.doc__title {
  display: block;
  font-family: var(--display);
  font-size: var(--fs-title);
  line-height: var(--lh-display);
}

.doc__description {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink-soft);
}

.doc__open {
  flex: none;
  color: var(--brand-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

/* ---------- block 9 · form field ---------- */
.field label {
  display: block;
  margin-bottom: 0.5rem;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--fs-body);
  transition: border-color var(--dur-fast) var(--ease);
}

.section--alt .field input {
  background: var(--bg);
}

.field input::placeholder {
  color: var(--ink-soft);
}

.field input:focus {
  border-color: var(--brand-deep);
}

.field input[aria-invalid="true"] {
  border-color: var(--ink);
}

.error {
  margin-top: 0.5rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--brand-deep);
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 500;
}

.hint {
  color: var(--ink-soft);
  font-size: var(--fs-small);
}

.notice {
  max-width: var(--max-narrow);
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--brand-deep);
  border-radius: var(--radius-card);
  background: var(--bg-2);
}

.section--alt .notice {
  background: var(--bg);
}

.notice h3 {
  margin-bottom: 0.5rem;
}

.notice .actions {
  margin-top: 1.25rem;
}

/* ---------- block 8 · question row ---------- */
.faq {
  max-width: 50rem;
}

.faq__count {
  min-height: 1.5em;
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: var(--fs-small);
}

.faq__group {
  margin-top: 2.5rem;
}

.faq__group > h3 {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.faq__row {
  border-bottom: 1px solid var(--line);
}

.faq__row summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

.faq__row summary::-webkit-details-marker {
  display: none;
}

.faq__row summary::after {
  content: "+";
  flex: none;
  color: var(--brand-deep);
  font-family: var(--display);
  font-size: var(--fs-title);
  line-height: 1;
}

.faq__row[open] summary::after {
  content: "–";
}

.faq__answer {
  max-width: var(--max-narrow);
  padding-bottom: 1.25rem;
  color: var(--ink-soft);
}

.faq mark {
  background: none;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.faq .notice {
  margin-top: 2rem;
}

/* ---------- section 9 · the slip tool ---------- */
.slip {
  display: grid;
  gap: 2.5rem;
  max-width: 50rem;
}

.slip__group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.slip__group legend {
  margin-bottom: 1rem;
  padding: 0;
}

.picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 1rem;
}

.pick {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-2);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.pick input {
  position: absolute;
  opacity: 0;
}

.pick img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.pick__body {
  display: block;
  padding: 0.75rem 0.875rem 0.875rem;
}

.pick__name {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: var(--lh-display);
}

.pick__price {
  display: block;
  color: var(--ink-soft);
  font-size: var(--fs-small);
}

.pick:has(input:checked) {
  border-color: var(--brand-deep);
  box-shadow: inset 0 0 0 1px var(--brand-deep), var(--shadow);
}

.pick:has(input:focus-visible) {
  outline: 2px solid var(--brand-deep);
  outline-offset: 3px;
}

/* block 10 · choice */
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.choice {
  position: relative;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
}

.choice span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.choice input:checked + span {
  border-color: var(--brand-deep);
  background: var(--brand-deep);
  color: var(--bg-2);
}

.choice input:focus-visible + span {
  outline: 2px solid var(--brand-deep);
  outline-offset: 3px;
}

.slip__group .hint {
  margin-top: 0.75rem;
}

.summary {
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-2);
}

.summary dl {
  margin: 0.75rem 0 0;
}

.summary dl > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--line);
}

.summary dl > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.summary dt {
  color: var(--ink-soft);
}

.summary dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
}

.summary__total dd {
  color: var(--brand-deep);
  font-family: var(--display);
  font-size: var(--fs-title);
  font-weight: 400;
  line-height: 1.1;
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.5rem;
}

.field--wide {
  grid-column: 1 / -1;
}

.slip__submit {
  display: grid;
  justify-items: start;
  gap: 1rem;
}

.slip__recap {
  color: var(--ink-soft);
}

/* ---------- block 11 · pop-up ---------- */
.popup {
  width: min(100% - 2rem, 56rem);
  max-width: none;
  height: min(100% - 2rem, 60rem);
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--bg-2);
  box-shadow: var(--shadow);
  color: var(--ink);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}

.popup.is-open {
  opacity: 1;
}

.popup--small {
  width: min(100% - 2rem, 32rem);
  height: auto;
  max-height: calc(100% - 2rem);
}

.popup::backdrop {
  background: var(--ink);
  opacity: 0.6;
}

.popup__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: inherit;
}

.popup__head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.popup__head h2 {
  font-size: var(--fs-title);
  font-weight: 400;
}

.popup__close {
  flex: none;
  min-height: 44px;
  padding: 0 1.25rem;
  border: 1px solid var(--brand-deep);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--brand-deep);
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.popup__close:hover {
  background: var(--brand-deep);
  color: var(--bg-2);
}

.popup__body {
  flex: 1;
  min-height: 0;
  padding: 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.popup__body .dash-list {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.popup__body .hint {
  margin-bottom: 1rem;
}

.viewer__page {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--bg);
}

.viewer__page + .viewer__page {
  margin-top: 1rem;
}

body.is-locked {
  overflow: hidden;
}

@media (max-width: 40rem) {
  .popup,
  .popup--small {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .popup__body {
    padding: 1rem;
  }
}

/* ---------- footer ---------- */
.footer {
  padding: 4rem var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
}

.footer__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 4rem;
  margin: 2rem 0;
}

.footer__facts dt {
  color: var(--brand-deep);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.footer__facts dd {
  margin: 0.25rem 0 0;
  color: var(--ink);
}

.footer__notice {
  max-width: var(--max-narrow);
  font-size: var(--fs-small);
}

/* ---------- small screens ---------- */
@media (max-width: 30rem) {
  .bar .wordmark {
    font-size: 0.875rem;
    letter-spacing: 0.25em;
  }

  .bar .wordmark small {
    letter-spacing: 0.25em;
  }

  .bar .btn {
    padding: 12px 18px;
  }

  .card__body {
    padding: 1.25rem;
  }
}
