/* ==========================================================================
   A Casa · owner: pages agent
   Opening: the head engraves itself (uninked plate → gold, line by line,
   under a moving burin; CSS only, the base image paints at once so LCP is
   not held). Chapters I–III with huge outlined Roman numerals; symbols as
   engraved medallions; the three engravings as cards that answer the hand.
   ========================================================================== */
.z-story { --z-story-gutter: clamp(2.5rem, 1rem + 5vw, 7rem); }

/* -- Opening ----------------------------------------------------------------- */
.z-story__open {
  position: relative;
  overflow: clip;
  padding-top: clamp(2rem, 1rem + 4vw, 5rem);
  padding-bottom: 0;
}
.z-story__open::before {         /* lamp light behind the head */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(42% 46% at 50% 30%, rgba(201, 166, 91, .12), rgba(201, 166, 91, .03) 50%, transparent 72%);
}
.z-story__open > .z-microprint { margin-top: clamp(3rem, 2rem + 4vw, 6rem); }
.z-story__open-grid { position: relative; display: grid; gap: clamp(1.5rem, 1rem + 2vw, 2.5rem); justify-items: center; text-align: center; }
.z-story__plate {
  --z-guilloche-opacity: .07;
  --z-rosette-size: 112%;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 4% 0 0;
}
.z-story__plate.z-guilloche::before {
  -webkit-mask-size: min(150%, 760px);
  mask-size: min(150%, 760px);
}
.z-story__engrave {
  position: relative;
  height: min(46svh, 400px);
  aspect-ratio: 512 / 756;
}
.z-story__engrave img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.z-story__head { opacity: .22; filter: saturate(.25) brightness(.7); }
.z-story__ink {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 100% 0);
  animation: z-story-engrave 3.8s var(--z-ease-inout) .35s forwards;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .6)) drop-shadow(0 0 30px rgba(201, 166, 91, .14));
}
.z-story__burin {                /* the cutting edge: a line of light that travels down */
  position: absolute;
  left: -6%;
  right: -6%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--z-gold-hi) 30%, #fff8e6 50%, var(--z-gold-hi) 70%, transparent);
  box-shadow: 0 0 14px 2px rgba(242, 222, 162, .45), 0 0 40px 6px rgba(201, 166, 91, .18);
  opacity: 0;
  pointer-events: none;
  animation: z-story-burin 3.8s var(--z-ease-inout) .35s forwards;
}
@keyframes z-story-engrave { to { clip-path: inset(0 0 0 0); } }
@keyframes z-story-burin {
  0% { top: 0; opacity: 0; }
  8% { opacity: .95; }
  90% { opacity: .9; }
  100% { top: 100%; opacity: 0; }
}

.z-story__open-text { position: relative; z-index: 1; display: grid; justify-items: center; gap: 22px; }
.z-story__open-eyebrow { justify-self: center; }
.z-story__open-title {
  font-size: clamp(3rem, 1.5rem + 6.4vw, 7rem);
  line-height: .94;
  letter-spacing: -.02em;
  max-width: 11ch;
}
.z-story__open-title em { white-space: nowrap; }
.z-story__open-intro { max-width: 40ch; font-size: var(--z-fs-lead); line-height: 1.6; color: var(--z-fg-2); }
.z-story__chapters ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.z-story__chapters a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--z-rule-soft);
  font-family: var(--z-font-caps);
  font-size: var(--z-fs-micro);
  letter-spacing: var(--z-track-caps);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--z-fg-2);
  transition: color var(--z-dur-base), border-color var(--z-dur-base), background-color var(--z-dur-base);
}
.z-story__chapters a span { font-family: var(--z-font-display); font-size: 1.35em; letter-spacing: .04em; color: var(--z-accent); text-transform: none; }
@media (hover: hover) { .z-story__chapters a:hover { color: var(--z-fg); border-color: var(--z-accent); background: rgba(201, 166, 91, .04); } }

@media (min-width: 990px) {
  .z-story__open { padding-top: clamp(3rem, 1rem + 3vw, 5rem); }
  .z-story__open-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: center;
    justify-items: start;
    text-align: left;
    min-height: min(calc(100svh - var(--z-header-h) - var(--z-announce-h) - 7rem), 780px);
  }
  .z-story__plate { grid-column: 2; grid-row: 1; padding: 0; }
  .z-story__open-text { grid-column: 1; grid-row: 1; justify-items: start; gap: 28px; }
  .z-story__open-eyebrow { justify-self: start; }
  .z-story__chapters ol { justify-content: flex-start; }
  .z-story__engrave { height: min(72svh, 700px); }
}

/* -- Chapters ----------------------------------------------------------------- */
.z-story__chapter { scroll-margin-top: var(--z-header-h); }
.z-story__title { font-size: var(--z-fs-display-l); max-width: 13ch; }
.z-story__title em { white-space: nowrap; }
.z-center .z-story__title { margin-inline: auto; }
.z-story__lead { max-width: 52ch; font-size: var(--z-fs-lead); line-height: 1.62; color: var(--z-fg-2); }
.z-center .z-story__lead { margin-inline: auto; }

.z-story__chapter-grid { display: grid; gap: 8px; }
.z-story__numeral {
  font-family: var(--z-font-display);
  font-size: clamp(6rem, 3rem + 14vw, 17rem);
  font-weight: 300;
  line-height: .8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(201, 166, 91, .45);
  user-select: none;
  -webkit-user-select: none;
}
.z-story__chapter-body { display: grid; gap: 22px; align-content: start; }
.z-story__prose { display: grid; gap: 1.1em; margin-top: 12px; max-width: 34em; }
.z-story__prose p {
  font-family: var(--z-font-display);
  font-size: clamp(1.375rem, 1.15rem + .9vw, 1.9rem);
  font-weight: 400;
  line-height: 1.42;
  color: var(--z-fg-2);
  text-wrap: pretty;
}
.z-story__prose p:first-child { color: var(--z-fg); }
.z-story__prose p:last-child {
  position: relative;
  margin-top: .6em;
  padding-top: 1.1em;
  color: var(--z-fg);
  font-style: italic;
}
.z-story__prose p:last-child::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 1px;
  background: var(--z-accent);
}
@media (min-width: 990px) {
  .z-story__chapter-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: var(--z-story-gutter); align-items: start; }
  .z-story__numeral { position: sticky; top: calc(var(--z-header-offset, 0px) + 40px); text-align: right; padding-top: .04em; transition: top var(--z-dur-slow) var(--z-ease-out); }
}

/* II · Como: three symbols as engraved medallions */
.z-story__how-head { display: grid; justify-items: center; gap: 22px; margin-bottom: clamp(3rem, 2.2rem + 3vw, 5rem); }
.z-story__symbols {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--z-rule);
}
.z-story__symbol {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 16px;
  padding: clamp(2.25rem, 1.8rem + 2vw, 3.25rem) clamp(.5rem, -1rem + 3vw, 2.5rem);
  text-align: center;
  border-bottom: 1px solid var(--z-rule-soft);
}
.z-story__medal {
  --z-guilloche-opacity: .85;
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  aspect-ratio: 1;
  margin-bottom: 8px;
  border-radius: 50%;
  border: 1px solid var(--z-rule);
  box-shadow: inset 0 0 0 5px var(--z-bg), inset 0 0 0 6px var(--z-rule-soft), 0 20px 40px -24px rgba(0, 0, 0, .9);
  background: radial-gradient(circle at 50% 38%, rgba(201, 166, 91, .1), transparent 64%);
  overflow: hidden;
}
.z-story__medal.z-guilloche::before { inset: 9px; border-radius: 50%; -webkit-mask-size: contain; mask-size: contain; }
.z-story__medal-img { width: 58%; height: auto; }
.z-story__laurel { width: 78%; height: auto; stroke: var(--z-accent); stroke-width: .62; }
.z-story__rosette { width: 86%; height: auto; stroke: var(--z-accent); stroke-width: .5; opacity: .9; }
.z-story__rib { stroke-width: .34; opacity: .7; }
.z-story__symbol-title { font-family: var(--z-font-display); font-size: var(--z-fs-display-s); font-weight: 400; line-height: 1.1; }
.z-story__symbol-text { max-width: 36ch; font-size: var(--z-fs-base); line-height: 1.7; color: var(--z-fg-2); }
@media (min-width: 990px) {
  .z-story__symbols { grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--z-rule-soft); }
  .z-story__symbol { border-bottom: 0; }
  .z-story__symbol + .z-story__symbol { border-left: 1px solid var(--z-rule-soft); }
}

/* III · O quê: the three cards */
.z-story__what-head { display: grid; justify-items: center; gap: 22px; margin-bottom: clamp(3rem, 2.2rem + 3vw, 5rem); }
.z-story__cards { display: grid; gap: clamp(2.5rem, 2rem + 2vw, 3.5rem); margin: 0; padding: 0; list-style: none; }
.z-story__card-link { display: grid; gap: 22px; color: inherit; text-decoration: none; }
.z-story__tilt { display: block; --zt-radius: var(--z-radius-card); }
.z-story__face { display: block; aspect-ratio: 1024 / 646; border-radius: var(--z-radius-card); overflow: hidden; background: var(--z-onyx); }
.z-story__face img { width: 100%; height: 100%; object-fit: cover; }
.z-story__card-meta { display: grid; justify-items: center; gap: 6px; text-align: center; }
.z-story__card-name {
  font-family: var(--z-font-caps);
  font-size: var(--z-fs-eyebrow);
  letter-spacing: var(--z-track-caps);
  text-transform: uppercase;
  color: var(--z-fg);
  transition: color var(--z-dur-base);
}
.z-story__card-tag { font-family: var(--z-font-display); font-size: var(--z-fs-display-xs); font-style: italic; color: var(--z-fg-2); }
.z-story__card-price { font-size: var(--z-fs-sm); color: var(--z-fg-2); }
.z-story__card-price .z-price { color: var(--z-fg-2); }
@media (hover: hover) { .z-story__card-link:hover .z-story__card-name { color: var(--z-accent-hi); } }
.z-story__card-link:focus-visible { outline-offset: 8px; }
.z-story__illus { margin-top: clamp(1.5rem, 1rem + 1.6vw, 2.5rem); text-align: center; }
@media (min-width: 750px) {
  .z-story__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--z-gap); }
}
@media (min-width: 990px) {
  .z-story__cards { column-gap: clamp(1.5rem, .5rem + 2.2vw, 3rem); align-items: start; }
  .z-story__card:nth-child(2) { transform: translateY(-28px); }   /* the three set out like a small arch */
}

.z-story__what-body {
  display: grid;
  justify-items: center;
  gap: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
  max-width: 760px;
  margin: clamp(3.5rem, 2.6rem + 4vw, 6rem) auto 0;
  text-align: center;
}
.z-story__what-text p + p { margin-top: 1em; }
.z-story__statement { font-size: var(--z-fs-display-m); line-height: 1.06; max-width: 18ch; }
.z-story__after { display: inline-flex; align-items: baseline; gap: 12px; color: var(--z-fg-2); }
.z-story__after .z-lozenge { color: var(--z-accent); }

/* Closing */
.z-story__close { --z-guilloche-opacity: .05; --z-rosette-size: min(980px, 170vw); overflow: clip; border-top: 1px solid var(--z-line-soft); }
.z-story__close.z-guilloche::before { -webkit-mask-size: var(--z-rosette-size); mask-size: var(--z-rosette-size); }
.z-story__close > .z-container { position: relative; display: grid; justify-items: center; gap: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem); }
.z-story__orn { width: min(220px, 56vw); }
.z-story__quote { margin: 0; display: grid; justify-items: center; gap: 22px; }
.z-story__quote .z-display { font-size: var(--z-fs-display-xl); line-height: .96; max-width: 12ch; }
.z-story__quote em { white-space: nowrap; }
.z-story__sign { font-family: var(--z-font-caps); font-size: var(--z-fs-micro); letter-spacing: var(--z-track-caps-wide); text-transform: uppercase; color: var(--z-fg-2); text-wrap: balance; }
@media (max-width: 749px) { .z-story__cta { width: 100%; } }

@media (prefers-reduced-motion: reduce) {
  .z-story__ink { animation: none; clip-path: none; }
  .z-story__burin { display: none; }
  .z-story__card:nth-child(2) { transform: none; }
}

/* v2: «A nossa história», the founding story in the opening column */
.z-story__tale { display: grid; gap: 1em; max-width: 46ch; color: var(--z-fg-2); font-size: var(--z-fs-lead); line-height: 1.65; }
.z-story__tale p { margin: 0; }
.z-story__tale-lead { font-family: var(--z-font-display); font-style: italic; font-size: 1.35em; line-height: 1.3; color: var(--z-fg); }
.z-story__signoff { font-size: var(--z-fs-display-s, 2rem); line-height: 1.1; color: var(--z-fg); }
.z-story__signoff em { color: var(--z-accent); }
@media (max-width: 989.98px) { .z-story__tale { text-align: center; margin-inline: auto; } }
